mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add "is_manufacturer" field to company model
This commit is contained in:
parent
a8ceddc8e4
commit
fd45db9e22
@ -26,8 +26,9 @@ class EditCompanyForm(HelperForm):
|
||||
'phone',
|
||||
'email',
|
||||
'contact',
|
||||
'is_customer',
|
||||
'is_supplier',
|
||||
'is_manufacturer',
|
||||
'is_customer',
|
||||
]
|
||||
|
||||
|
||||
|
18
InvenTree/company/migrations/0015_company_is_manufacturer.py
Normal file
18
InvenTree/company/migrations/0015_company_is_manufacturer.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.10 on 2020-04-12 23:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('company', '0014_auto_20200407_0116'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='company',
|
||||
name='is_manufacturer',
|
||||
field=models.BooleanField(default=True, help_text='Does this company manufacture parts?'),
|
||||
),
|
||||
]
|
@ -56,7 +56,12 @@ def rename_company_image(instance, filename):
|
||||
|
||||
class Company(models.Model):
|
||||
""" A Company object represents an external company.
|
||||
It may be a supplier or a customer (or both).
|
||||
It may be a supplier or a customer or a manufacturer (or a combination)
|
||||
|
||||
- A supplier is a company from which parts can be purchased
|
||||
- A customer is a company to which parts can be sold
|
||||
- A manufacturer is a company which manufactures a raw good (they may or may not be a "supplier" also)
|
||||
|
||||
|
||||
Attributes:
|
||||
name: Brief name of the company
|
||||
@ -70,6 +75,7 @@ class Company(models.Model):
|
||||
notes: Extra notes about the company
|
||||
is_customer: boolean value, is this company a customer
|
||||
is_supplier: boolean value, is this company a supplier
|
||||
is_manufacturer: boolean value, is this company a manufacturer
|
||||
"""
|
||||
|
||||
name = models.CharField(max_length=100, blank=False, unique=True,
|
||||
@ -106,6 +112,8 @@ class Company(models.Model):
|
||||
|
||||
is_supplier = models.BooleanField(default=True, help_text=_('Do you purchase items from this company?'))
|
||||
|
||||
is_manufacturer = models.BooleanField(default=True, help_text=_('Does this company manufacture parts?'))
|
||||
|
||||
def __str__(self):
|
||||
""" Get string representation of a Company """
|
||||
return "{n} - {d}".format(n=self.name, d=self.description)
|
||||
|
Loading…
Reference in New Issue
Block a user