mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 03:25:42 +00:00
Add "is_manufacturer" field to company model
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user