Commit Graph

14145 Commits

Author SHA1 Message Date
Oliver
ba4e264e6e
Report template updates (#4454)
* Update default purchase order report template

- Add line pricing data
- Add extra lines
- Add methods for returning total line item price
- Include total order price

* Similar updates for sales order reports
2023-03-05 23:59:54 +11:00
Oliver
5ba75c868d
total_price for orders (#4447)
* Adds unit test for counting queries on PurchaseOrderList API endpoint

- We will work to make this queryset more efficient

* PEP fixes

* Add 'total_price' fields to SalesOrder and PurchaseOrder models

* PurchaseOrder list API now has constant query count

* Data migration for updating existing PurchaseOrder and SalesOrder instances

- Calculate total_price for any existing order
- Will fail if exchange rates are not available

* Add total_price_currency to API serializers

* Render total_price in SalesOrder table

* Add ability to filter both lists by total_price field

* Update total_price whenever an order is updated

* Update total price whenever a lineitem is saved or deleted

* Add query-counting unit test for SalesOrder list API

* Calling refresh_from_db inside a save() method is *not* a good idea
2023-03-05 22:22:18 +11:00
simonkuehling
c0f405243a
Add total cost column to purchase order list (#4445)
* add total price column to purchase order list

* bump API version
2023-03-04 10:09:40 +11:00
Oliver
575d62bff4
Add mathematical operator tags to report templates (#4443) 2023-03-03 21:42:04 +11:00
Oliver
cce0fe8236
New Crowdin updates (#4436)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-03 16:35:00 +11:00
Oliver
2d7f9e3a4c
Fixes for unit tests (#4441)
(cherry picked from commit 0bbba26e6331b05696cadfb21e36617de62d999c)
2023-03-03 15:53:31 +11:00
Philipp Fruck
31f4045465
Fix parsing dict variables from env (#4438)
* fix parsing dict variables from env

The INVENTREE_SOCIAL_PROVIDERS variable has been parsed as a string from
the environment which resulted in an attribute error as dict was the
expected variable type. To circumvent this error, parsing JSON strings
as dictionary values from the environment has been added

* add unit tests for env typecasting to dict
2023-03-03 10:47:15 +11:00
Oliver
f4bb7c29c7
Settings translation text consistency (#4440) 2023-03-03 10:38:24 +11:00
Oliver
7aee97d63b
Fix rendering of purchase_price for exporting StockItem data (#4434)
* Fix rendering of purchase_price for exporting StockItem data

* Stock item quantity is a decimal field

* Update other fields
2023-03-02 14:50:04 +11:00
Oliver
db42ffcf7c
Slow tests (#4435)
* Add integration for django-slowtest

* Sample test improvement

- Reduces test from 0.7s to 0.2s

* Run CI tests with slowreport

* Fix requirements file

* Fix test command

* Fix bulk_create in unit tests

* Remove bulk_create entirely

* remove another bulk_create call

* Reduce long test from ~1000 seconds to ~1 second
2023-03-02 13:51:52 +11:00
Oliver
ec66e5351b
Translation Fixes (#4433)
* Change 'zh-cn' to 'zh-hans'

* Enforce consistent naming scheme when rendering translated javascript files

* More intelligent lookup of translated javascript files

- Ensure that the language code is lower-case (to match translated files)
- Provide fallback if specified langauge code is not found

* Replace underscore characters

* remove debug hook
2023-03-02 08:24:31 +11:00
Oliver
fdfc3e5e7e
New Crowdin updates (#4394)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-01 15:31:22 +11:00
simonkuehling
f86bea75a1
Add base part info to [Add Supplier Part] modal form (#4427)
* Add base part info to [Add Supplier Part] modal form

* fix JS style
2023-03-01 08:16:26 +11:00
simonkuehling
03e105dd95
Fix some regressions in new "Responsible" filter for build orders (#4430)
* fix responsible user/group icons with translations

* fix display of active filters after recent changes
2023-03-01 07:25:12 +11:00
simonkuehling
e9a1b57941
Add unallocated quantity to StockItem renderer (#4425)
* add unallocated quantity to StockItem renderer

* introduce parameter to switch between total quantity and available quantity
2023-02-28 12:22:27 +11:00
Oliver
71db557d3b
Part API query tests (#4423)
* Add unit tests for validating number of queries

* Simplify category_detail annotation to PartList API endpoint

- Previous approach was an old hack from before the n+1 problem was understood
2023-02-26 23:33:23 +11:00
Oliver
b657fb4405
Pricing bug fix (#4422)
* Control when a new PartPricing object can be created

- Prevent this when calling from an on_delete signal
- There is an edge case where deleting a part triggers a series of on_delete signals inside an atomic transaction
- When the new PartPricing object is created,

* Add unit testing:

- Ensure PartPricing gets created when a new StockItem is added
- Part.delete() works without error
- PartPricing instances are deleted also

* style fixes
2023-02-26 16:36:11 +11:00
simonkuehling
0c5dc2865c
fix typo in user display settings (#4420) 2023-02-26 07:58:37 +11:00
Oliver
eefad0baca
Convert pricing data in stock table (#4417)
(cherry picked from commit 468a0f1fdf)
2023-02-25 18:59:16 +11:00
Oliver
b6b701b077
Improve rendering efficiency for build detail page (#4416)
- Remove pre-calculated context data (which is not used)
2023-02-25 18:58:59 +11:00
Matthias Mair
5037e427b6
Auto migrating (#3741)
* base structure for updates

* add base structure

* add settingscheck

* update docstring

* only load plugins if needed

* fix misstyping

* run migration

* check if there are open migrations

* log open migration

* add more logging

* patch in fore reloading on unload

* only run if database is ready

* check every 5 minutes

* remove non implemented feautres  from desc

* add command flag to makr if cmmand runs as worker

* Add tests for migrations

* factor mmigration plan into own function

* Add print statements

* add initial migrations for tests

* remove last assertation

* cleanup migrations after run

* add flag to accept empty source code files

* the flag is enough for reporting

* fix test

* do not run migrations on sqlite3

* make sure migrations don't fail if no plan ran

* increase coverage for  migration

* spell fix

* check for migrations daily

* add a migration check after plugins are installed
2023-02-25 16:52:16 +11:00
Oliver
75b223acc4
Consolidate label printing and reporting options into a single screen (#4415) 2023-02-25 15:54:51 +11:00
Oliver
fd84e590ec
Bugfix for auto-backup task (#4406)
* Bugfix for auto-backup task

- Dont' mix datetime with timezone

* Use different variable names

- If old names are stuck in the database, error could still occur

* Exclude internal settings from API

* Make INVENTREE_LATEST_VERSION setting an internal one
2023-02-25 13:53:57 +11:00
simonkuehling
f523fb44f6
Filter build orders by responsible owner (#4383) (#4408)
* add assigned_to filter to Build API

* extend API to filter build orders by assigned owner

* rename API filter to 'responsible'

* add 'Responsible' filter to build oders table

* add user/group icon to owners in 'Responsible' column

* remove unused python class import

* bump API version number

* fix handling of invalid IDs

* refactor filter options as a callback function

* fix JS styling
2023-02-25 13:52:12 +11:00
Oliver
c46f153449
Bug fix for build detail template (#4412)
- Remove reference to old expand/collapse templates (which no longer exist)
- Update tables to use javascript buttons
2023-02-25 09:56:13 +11:00
Oliver
ed7d2e1262
Add option to filter stockitems by "external" location status (#4407)
* Add option to filter stockitems by "external" location status

* flake fix
2023-02-25 07:19:41 +11:00
simonkuehling
8b7e41baf9
fix stock health calculation to account for allocated stock (#4385) (#4399)
* fix stock health calculation to account for allocated stock (#4385)

* add required stock from sales orders to demand and stock_health calculation
2023-02-24 12:01:40 +11:00
Oliver
a28063a59c
Allow pricing updates when PartPricing object does not yet exist (#4400)
- Previously if the Part did not have a referenced PartPricing object, the schedule_pricing_update method would fail
- Required a PartPricing object to actually exist (i.e. be manually created)
- This patch fixes a logic error which resulted in updating being skipped if a PartPricing instance did not already exist
2023-02-24 06:59:24 +11:00
simonkuehling
efb55c720f
Improve wording for "Inherited" option of BOM items (#4376) (#4397)
* improve wording for "Inherited" option of BOM items (#4376)

* add migrations
2023-02-24 06:58:54 +11:00
Oliver
89ac0a623b
Add migration test (#4398)
* Add migration test

Looking at older data migration which removes stock items which are "scheduled_for_deletion"

* Account for parent / child relationships
2023-02-23 23:12:48 +11:00
simonkuehling
93ce55298f
improve stock status badges for parts (#4385) (#4393)
* improve stock status badges for parts (#4385)

* fix trailing whitespace
2023-02-23 08:41:02 +11:00
Oliver
92a049be96
Adds ability to export sales order line table to a file (#4392)
* Adds ability to export sales order line table to a file

* Fix expand / collapse buttons

* Fix other expand / collapse buttons

* Add export functionality for "extra" line items
2023-02-23 07:20:03 +11:00
Oliver
71af30f0d2
New Crowdin updates (#4356)
* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin
2023-02-23 07:19:27 +11:00
simonkuehling
fa7a33dc9c
add missing units to Build Order view (#4386) (#4388)
* add missing units to Build Order view (#4386)

* JS styling fixes

* more JS styling fixes
2023-02-22 09:51:09 +11:00
Oliver
a2b55314cb
Adding icons for forms (#4381) 2023-02-21 13:57:10 +11:00
Oliver
62455199f3
Js forms updates (#4378)
* Refactor forms for creating and editing SalesOrder

- Common function for defining fields

* More visual improvements for forms

* Refactor fields for SupplierPartPriceBreak

* More refactoring

* Refactor for stockitemtestresult table

* Comment fields

* JS linting fix
2023-02-21 07:24:49 +11:00
simonkuehling
17bfea4428
add user setting to select a default label printer (#4349) (#4362) 2023-02-21 07:24:11 +11:00
Oliver
75ca325892
Add "external" field to StockLocation (#4377)
* Add "external" field to StockLocation

- New model for field
- Database migrations
- Serializer / API updates
- Front end tables / filters

* Update API version
2023-02-21 00:42:18 +11:00
Oliver
782ae133b7
Part duplicate bug fix (#4370)
* Make 'copy_category_parameters' part of actual serializer

* Parameter copying is now handled by the API serializer

* Make field not required

* linting fixes

* pre commit fix

* Fix unit tests

* Further fix for unit test

* Unit tests for category parameter duplication
2023-02-20 18:48:55 +11:00
Oliver
95ecd0cd32
Bug fix for purchase order pricing (#4373)
* Account for pack size when calculating purchase_price for received line items

* Clearer display of "unit pricing" when part has units

* Add data migration to fix historical pricing bugs

* Remove debug statement
2023-02-20 17:22:47 +11:00
Philipp Fruck
9964687cf3
support podman and selinux for dev setup (#4354)
SELinux labels are required in order to mount the volumes into the dev
containers. The build config has been added to the dev-worker to prevent
podman from trying to pull from docker hub
2023-02-20 07:21:17 +11:00
simonkuehling
2986f8d61a
clear IPN field when duplicating part and PART_ALLOW_DUPLICATE_IPN is False (#4359) (#4365) 2023-02-20 07:17:00 +11:00
Oliver
bf8a59c604
Fix bug rendering part without a category (#4369) 2023-02-19 22:39:36 +11:00
Matthias Mair
32be1b2035
Update dependencies (#4368)
* update reqs

* bump pre-commit

* remove bugbear
2023-02-19 21:33:04 +11:00
Oliver
e78161bd00
Add FAQ link to issues template (#4364) 2023-02-18 19:40:09 +11:00
Oliver
cc2e7ee8a5
Move Meta class to top of class definition (#4363) 2023-02-18 18:51:00 +11:00
Oliver
139274f356
Bug fix for ensuring location and category names are unique for common parent (#4361)
* Update Meta class for StockLocation and PartCategory

* Migration files

* Add extra unique requirements to  InvenTreeTree model

- unique_together does not work as expected with null values
2023-02-18 11:42:53 +11:00
Oliver
cde2050236
Client side QR Codes (#4357)
* Add JS for qrcodejs

Ref: https://davidshimjs.github.io/qrcodejs/

* Simple function for rendering a QR code

* Refactor QR code view for Part

* Replace QR code view for SupplierPart

* Refactor QR codes for stock item and stock location models

* Remove base QRCodeView entirely
2023-02-17 13:33:36 +11:00
Oliver
0f445ea6e4
[Feature] Stocktake reports (#4345)
* Add settings to control upcoming stocktake features

* Adds migration for "cost range" when performing stocktake

* Add cost data to PartStocktakeSerializer

Implement a new custom serializer for currency data type

* Refactor existing currency serializers

* Update stocktake table and forms

* Prevent trailing zeroes in forms

* Calculate cost range when adding manual stocktake entry

* Display interactive chart for part stocktake history

* Ensure chart data are converted to common currency

* Adds new model for building stocktake reports

* Add admin integration for new model

* Adds API endpoint to expose list of stocktake reports available for download

- No ability to edit or delete via API

* Add setting to control automated deletion of old stocktake reports

* Updates for settings page

- Load part stocktake report table
- Refactor function to render a downloadable media file
- Fix bug with forcing files to be downloaded
- Split js code into separate templates
- Make use of onPanelLoad functionalitty

* Fix conflicting migration files

* Adds API endpoint for manual generation of stocktake report

* Offload task to generate new stocktake report

* Adds python function to perform stocktake on a single part instance

* Small bug fixes

* Various tweaks

- Prevent new stocktake models from triggering plugin events when created
- Construct a simple csv dataset

* Generate new report

* Updates for report generation

- Prefetch related data
- Add extra columns
- Keep track of stocktake instances (for saving to database later on)

* Updates:

- Add confirmation message
- Serializer validation checks

* Ensure that background worker is running before manually scheduling a new stocktake report

* Add extra fields to stocktake models

Also move code from part/models.py to part/tasks.py

* Add 'part_count' to PartStocktakeReport table

* Updates for stocktake generation

- remove old performStocktake javascript code
- Now handled by automated server-side calculation
- Generate report for a single part

* Add a new "role" for stocktake

- Allows fine-grained control on viewing / creating / deleting stocktake data
- More in-line with existing permission controls
- Remove STOCKTAKE_OWNER setting

* Add serializer field to limit stocktake report to particular locations

* Use location restriction when generating a stocktake report

* Add UI buttons to perform stocktake for a whole category tree

* Add button to perform stocktake report for a location tree

* Adds a background tasks to handle periodic generation of stocktake reports

- Reports are generated at fixed intervals
- Deletes old reports after certain number of days

* Implement notifications for new stocktake reports

- If manually requested by a user, notify that user
- Cleanup notification table
- Amend PartStocktakeModel for better notification rendering

* Hide buttons on location and category page if stocktake is not enabled

* Cleanup log messages during server start

* Extend functionality of RoleRequired permission mixin

- Allow 'role_required' attribute to be added to an API view
- Useful when using a serializer class that does not have a model defined

* Add boolean option to toggle whether a report will be generated

* Update generateStocktake function

* Improve location filtering

- Don't limit the actual stock items
- Instead, select only parts which exist within a given location tree

* Update API version

* String tweaks

* Fix permissions for PartStocktake API

* More unit testing for stocktake functionality

* QoL fix

* Fix for assigning inherited permissions
2023-02-17 11:42:48 +11:00
Philipp Fruck
e6c9db2ff3
configure cors and allowed hosts using env vars (#4355) 2023-02-17 10:53:28 +11:00