Rename "manufacturer" to "manufacturer_name"

(cherry picked from commit e9e734acce)
This commit is contained in:
Oliver Walters 2020-04-13 13:29:11 +10:00
parent 2a4e8cd062
commit 8b366fc4a0
5 changed files with 30 additions and 3 deletions

View File

@ -121,7 +121,7 @@ class SupplierPartList(generics.ListCreateAPIView):
search_fields = [
'SKU',
'supplier__name',
'manufacturer',
'manufacturer_name',
'description',
'MPN',
]

View File

@ -53,6 +53,7 @@ class EditSupplierPartForm(HelperForm):
'SKU',
'description',
'manufacturer',
'manufacturer_name',
'MPN',
'link',
'note',

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.10 on 2020-04-13 03:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('company', '0016_auto_20200412_2330'),
]
operations = [
migrations.RenameField(
model_name='supplierpart',
old_name='manufacturer',
new_name='manufacturer_name',
),
]

View File

@ -224,7 +224,7 @@ class SupplierPart(models.Model):
part: Link to the master Part
supplier: Company that supplies this SupplierPart object
SKU: Stock keeping unit (supplier part number)
manufacturer: Manufacturer name
manufacturer: Company that manufactures the SupplierPart (leave blank if it is the sample as the Supplier!)
MPN: Manufacture part number
link: Link to external website for this part
description: Descriptive notes field
@ -261,7 +261,14 @@ class SupplierPart(models.Model):
SKU = models.CharField(max_length=100, help_text=_('Supplier stock keeping unit'))
manufacturer = models.CharField(max_length=100, blank=True, help_text=_('Manufacturer'))
manufacturer = models.ForeignKey(Company, on_delete=models.SET_NULL,
related_name='manufactured_parts',
limit_choices_to={'is_manufacturer': True},
help_text=_('Select manufacturer'),
null=True, blank=True,
)
manufacturer_name = models.CharField(max_length=100, blank=True, help_text=_('Manufacturer'))
MPN = models.CharField(max_length=100, blank=True, help_text=_('Manufacturer part number'))

View File

@ -90,6 +90,7 @@ class SupplierPartSerializer(InvenTreeModelSerializer):
'supplier_logo',
'SKU',
'manufacturer',
'manufacturer_name',
'description',
'MPN',
'link',