Add "consumable" field to the Part model
This commit is contained in:
parent
66d1884ad9
commit
da4cc739da
|
|
@ -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",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -503,6 +503,7 @@ class Part(
|
||||||
active: Is this part active? Parts are deactivated instead of being deleted
|
active: Is this part active? Parts are deactivated instead of being deleted
|
||||||
locked: This part is locked and cannot be edited
|
locked: This part is locked and cannot be edited
|
||||||
virtual: Is this part "virtual"? e.g. a software product or similar
|
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
|
notes: Additional notes field for this part
|
||||||
creation_date: Date that this part was added to the database
|
creation_date: Date that this part was added to the database
|
||||||
creation_user: User who added this part 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?'),
|
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(
|
bom_validated = models.BooleanField(
|
||||||
default=False,
|
default=False,
|
||||||
verbose_name=_('BOM Validated'),
|
verbose_name=_('BOM Validated'),
|
||||||
|
|
|
||||||
|
|
@ -357,6 +357,7 @@ class PartBriefSerializer(
|
||||||
'testable',
|
'testable',
|
||||||
'trackable',
|
'trackable',
|
||||||
'virtual',
|
'virtual',
|
||||||
|
'consumable',
|
||||||
'units',
|
'units',
|
||||||
'pricing_min',
|
'pricing_min',
|
||||||
'pricing_max',
|
'pricing_max',
|
||||||
|
|
@ -649,6 +650,7 @@ class PartSerializer(
|
||||||
'units',
|
'units',
|
||||||
'variant_of',
|
'variant_of',
|
||||||
'virtual',
|
'virtual',
|
||||||
|
'consumable',
|
||||||
'pricing_min',
|
'pricing_min',
|
||||||
'pricing_max',
|
'pricing_max',
|
||||||
'pricing_updated',
|
'pricing_updated',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue