2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Update BomItem 'validated' field (#4486)

* Adds new "validated" field to the BomItem model

- Previously this was dynamically calculated (very expensive)
- Now cached and updated whenever a BomItem instance is saved
- Will make the BOM API much more responsive
- Cleanup BomItem list API code also

* Adds data migration to update existing BomItem objects

* Exclude 'validated' field from BomItemResource class
This commit is contained in:
Oliver
2023-03-14 13:53:33 +11:00
committed by GitHub
parent 06f8a50956
commit 1ba51e51c3
6 changed files with 84 additions and 34 deletions

View File

@ -1099,8 +1099,6 @@ class BomItemSerializer(InvenTreeModelSerializer):
sub_part_detail = PartBriefSerializer(source='sub_part', many=False, read_only=True)
validated = serializers.BooleanField(read_only=True, source='is_line_valid')
on_order = serializers.FloatField(read_only=True)
# Cached pricing fields