InvenTree/InvenTree/company
Oliver 5dd6f18495
Part units (#4854)
* Add validation to part units field

* Add "pack_units" field to the SupplierPart model

* Migrate old units to new units, and remove old field

* Table fix

* Fixture fix

* Update migration

* Improve "hook" for loading custom unit database

* Display part units column in part table

- Also allow ordering by part units
- Allow filtering to show parts which have defined units

* Adds data migration for converting units to valid values

* Add "pack_units_native" field to company.SupplierPart model

* Clean pack units when saving a SupplierPart

- Convert to native part units
- Handle empty units value
- Add unit tests

* Add background function to rebuild supplier parts when a part is saved

- Required to ensure that the "pack_size_native" is up to date

* Template updates

* Sort by native units first

* Bump API version

* Rename "pack_units" to "pack_quantity"

* Update migration file

- Allow reverse migration

* Fix for currency migration

- Handle case where no currencies are provided
- Handle case where base currency is not in provided options

* Adds unit test for data migration

* Add unit test for part.units data migration

- Check that units fields are updated correctly

* Add some extra "default units"

- each / piece
- dozen / hundred / thousand
- Add unit testing also

* Update references to "pack_size"

- Replace with "pack_quantity" or "pack_quantity_native" as appropriate

* Improvements based on unit testing

* catch error

* Docs updates

* Fixes for pricing tests

* Update unit tests for part migrations · 1b6b6d9d

* Bug fix for conversion code

* javascript updates

* JS formatting fix
2023-05-26 16:57:23 +10:00
..
fixtures Part units (#4854) 2023-05-26 16:57:23 +10:00
migrations Part units (#4854) 2023-05-26 16:57:23 +10:00
templates/company Part units (#4854) 2023-05-26 16:57:23 +10:00
__init__.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
admin.py Code style improvements (#4683) 2023-04-28 20:49:53 +10:00
api.py Part units (#4854) 2023-05-26 16:57:23 +10:00
apps.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
models.py Part units (#4854) 2023-05-26 16:57:23 +10:00
serializers.py Part units (#4854) 2023-05-26 16:57:23 +10:00
test_api.py Cleanup / consolidate unit testing code (#4831) 2023-05-17 07:35:26 +10:00
test_migrations.py Part units (#4854) 2023-05-26 16:57:23 +10:00
test_supplier_parts.py Part units (#4854) 2023-05-26 16:57:23 +10:00
test_views.py Cleanup / consolidate unit testing code (#4831) 2023-05-17 07:35:26 +10:00
tests.py Metadata fix (#4725) 2023-05-05 14:06:19 +10:00
urls.py [Feature] Add RMA support (#4488) 2023-03-29 10:35:43 +11:00
views.py Client side QR Codes (#4357) 2023-02-17 13:33:36 +11:00