Add "consumable" field to the Part model

This commit is contained in:
Oliver Walters 2026-07-02 07:26:04 +00:00
parent 66d1884ad9
commit da4cc739da
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# Generated by Django 5.2.15 on 2026-07-02 07:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("part", "0150_part_maximum_stock"),
]
operations = [
migrations.AddField(
model_name="part",
name="consumable",
field=models.BooleanField(
default=False,
help_text="Is this part consumable, such as glue or a fastener?",
verbose_name="Consumable",
),
),
]

View File

@ -503,6 +503,7 @@ class Part(
active: Is this part active? Parts are deactivated instead of being deleted
locked: This part is locked and cannot be edited
virtual: Is this part "virtual"? e.g. a software product or similar
consumable: Is this part consumable, such as glue or a fastener?
notes: Additional notes field for this part
creation_date: Date that this part was added to the database
creation_user: User who added this part to the database
@ -1308,6 +1309,12 @@ class Part(
help_text=_('Is this a virtual part, such as a software product or license?'),
)
consumable = models.BooleanField(
default=False,
verbose_name=_('Consumable'),
help_text=_('Is this part consumable, such as glue or a fastener?'),
)
bom_validated = models.BooleanField(
default=False,
verbose_name=_('BOM Validated'),

View File

@ -357,6 +357,7 @@ class PartBriefSerializer(
'testable',
'trackable',
'virtual',
'consumable',
'units',
'pricing_min',
'pricing_max',
@ -649,6 +650,7 @@ class PartSerializer(
'units',
'variant_of',
'virtual',
'consumable',
'pricing_min',
'pricing_max',
'pricing_updated',