mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add 'manufacturer' field to SupplierPart object
- ForeignKey link to Company model
This commit is contained in:
parent
e9e734acce
commit
acebe61ac5
@ -115,7 +115,8 @@ class SupplierPartList(generics.ListCreateAPIView):
|
||||
|
||||
filter_fields = [
|
||||
'part',
|
||||
'supplier'
|
||||
'supplier',
|
||||
'manufacturer',
|
||||
]
|
||||
|
||||
search_fields = [
|
||||
|
@ -13,6 +13,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='company',
|
||||
name='is_manufacturer',
|
||||
field=models.BooleanField(default=True, help_text='Does this company manufacture parts?'),
|
||||
field=models.BooleanField(default=False, help_text='Does this company manufacture parts?'),
|
||||
),
|
||||
]
|
||||
|
@ -265,7 +265,7 @@ class SupplierPart(models.Model):
|
||||
related_name='manufactured_parts',
|
||||
limit_choices_to={'is_manufacturer': True},
|
||||
help_text=_('Select manufacturer'),
|
||||
null=True, blank=True,
|
||||
null=True, blank=True
|
||||
)
|
||||
|
||||
manufacturer_name = models.CharField(max_length=100, blank=True, help_text=_('Manufacturer'))
|
||||
@ -296,7 +296,7 @@ class SupplierPart(models.Model):
|
||||
items = []
|
||||
|
||||
if self.manufacturer:
|
||||
items.append(self.manufacturer)
|
||||
items.append(self.manufacturer.name)
|
||||
if self.MPN:
|
||||
items.append(self.MPN)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user