InvenTree/InvenTree/stock/migrations
Oliver 9e77b9fc56
Parameter filtering (#4823)
* adds new field 'parameter type' to PartParameterTemplate model

* Move part parameter settings onto their own page

* Add "choices" and "regex" template types

* Adds validation for PartParameter based on template type

* javascript cleanup

* Fix for serializers.py

* Add unit testing for parameter validation

* Add filters

* Rename "type" field to "param_type"

- Should have seen that one coming

* Coerce 'boolean' value to True/False

* table update

* js linting

* Add requirement for "pint" package

* Add validator for physical unit types

- Revert a previous migration which adds "parameter type" and "validator" fields
- These will get implemented later, too much scope creep for this PR
- Add unit test for validation of "units" field

* Update PartParameter model

- Add data_numeric field (will be used later)
- Add MinLengthValidator to data field

* Run validation for part parameter data

- Ensure it can be converted to internal units

* Update admin interface to display partparameter values inline for a part

* Adds validation of part parameter data value

- Also converts to base units, and stores as "numeric" value
- Display "numeric" value in tables
- Create new file conversion.py for data conversion

* Update unit tests and fix some bugs

* Update docstring

* Add units to parameter columns in parameteric part table

* Allow part list to be ordered by a particular parameter value

- Annotate queryset with new "order_by_parameter" method
- Skeleton method for future work

* Bump API version

* Adds unit testing for sorting parts by parameter value

* Update historical data migrations

- Turns out RunPython.noop is a thing?

* Cache the unit registry

- Creating the unit registry takes a significant amount of time
- Construct when first called, and then cache for subsequent hits
- Massive improvement in performance

* Throw error on empty values when converting between units

* Data migration for converting existing part parameter values

* Handle more error cases

* Show parameteric table on top-level part page too

* Unit test for data migration

* Update credits in docs

* Improved error checking

* WIP docs updates

* Fix parameteric table filtering

* remove zoom property

* Fix for import path

* Update parameter docs

* Run background task to rebuild parameters when template changes

* Make "data_numeric" field nullable

- Defaulting to zero is not appropriate, as the actual value may be zero
- Sorting still seems to work just fine

* Fixes for unit test

* More unit test fixes

* Further fixes for unit tests

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2023-05-19 13:24:55 +10:00
..
0001_initial.py
0002_auto_20190525_2226.py
0003_auto_20190525_2303.py
0004_auto_20190525_2356.py
0005_auto_20190602_1944.py
0006_stockitem_purchase_order.py
0007_auto_20190618_0042.py
0008_stockitemtracking_url.py
0009_auto_20190715_2351.py
0010_stockitem_build.py
0011_auto_20190908_0404.py
0012_auto_20190908_0405.py
0013_auto_20190908_0916.py
0014_auto_20190908_0918.py
0015_auto_20190913_1407.py
0016_auto_20191118_2146.py
0017_auto_20191118_2311.py
0018_auto_20200202_0103.py
0019_auto_20200202_1024.py
0020_auto_20200206_1213.py
0021_auto_20200215_2232.py
0022_auto_20200217_1109.py
0023_auto_20200318_1027.py
0024_auto_20200405_2239.py
0025_auto_20200405_2243.py
0026_stockitem_uid.py
0027_stockitem_sales_order.py
0028_auto_20200421_0724.py
0029_auto_20200421_2359.py
0030_auto_20200422_0015.py
0031_auto_20200422_0209.py
0032_stockitem_build_order.py
0033_auto_20200426_0539.py
0034_auto_20200426_0602.py
0035_auto_20200502_2308.py
0036_stockitemattachment.py
0037_stockitemattachment_user.py
0038_stockitemattachment_upload_date.py
0039_auto_20200513_0016.py
0040_stockitemtestresult.py
0041_stockitemtestresult_notes.py
0042_auto_20200523_0121.py
0043_auto_20200525_0420.py
0044_auto_20200528_1036.py
0045_stockitem_customer.py
0046_auto_20200605_0931.py
0047_auto_20200605_0932.py
0048_auto_20200807_2344.py
0049_auto_20200820_0454.py
0050_auto_20200821_1403.py
0051_auto_20200928_0928.py
0052_stockitem_is_building.py
0053_auto_20201110_0513.py
0054_remove_stockitem_build_order.py
0055_auto_20201117_1453.py
0056_stockitem_expiry_date.py
0057_stock_location_item_owner.py
0058_stockitem_packaging.py
0059_auto_20210404_2016.py
0060_auto_20210511_1713.py
0061_auto_20210511_0911.py Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
0062_auto_20210511_2151.py
0063_auto_20210511_2343.py
0064_auto_20210621_1724.py Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
0065_auto_20210701_0509.py
0066_stockitem_scheduled_for_deletion.py
0067_alter_stockitem_part.py
0068_stockitem_serial_int.py
0069_auto_20211109_2347.py Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
0070_auto_20211128_0151.py
0071_auto_20211205_1733.py Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
0072_remove_stockitem_scheduled_for_deletion.py
0073_alter_stockitem_belongs_to.py
0074_alter_stockitem_batch.py
0075_auto_20220515_1440.py
0076_alter_stockitem_status.py
0077_alter_stockitem_notes.py
0078_alter_stockitem_supplier_part.py
0079_alter_stocklocation_name.py
0080_stocklocation_pathstring.py
0081_auto_20220801_0044.py Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
0082_alter_stockitem_link.py
0083_stocklocation_icon.py
0084_auto_20220903_0154.py
0085_auto_20220903_0225.py
0086_remove_stockitem_uid.py
0087_auto_20220912_2341.py
0088_remove_stockitem_infinite.py
0089_alter_stockitem_purchase_price.py
0090_stocklocation_structural.py
0091_alter_stockitem_delete_on_deplete.py
0092_alter_stockitem_updated.py
0093_auto_20230217_2140.py
0094_auto_20230220_0025.py Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
0095_stocklocation_external.py
0096_auto_20230330_1121.py Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
0097_alter_stockitem_notes.py
0098_auto_20230427_2033.py
0099_alter_stockitem_status.py [Feature] Scrap Build Outputs (#4800) 2023-05-13 22:19:35 +10:00
0100_auto_20230515_0004.py Allow tag fields to be empty (#4816) 2023-05-15 10:57:12 +10:00
0100_stockitem_consumed_by.py Build consume stock (#4817) 2023-05-16 21:25:02 +10:00
__init__.py