2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-10 22:00:56 +00:00

move helper function to models.py

This commit is contained in:
Matthias
2022-04-02 00:01:38 +02:00
parent 80fa8f6d18
commit 66e14b6ad0
2 changed files with 15 additions and 15 deletions

View File

@@ -60,6 +60,20 @@ def rename_company_image(instance, filename):
return os.path.join(base, fn)
def get_deleted_company():
"""
Returns the deleted company object
"""
return Company.objects.get_or_create(
name='deleted',
email='deleted',
is_deleted=True,
is_customer = True,
is_supplier = True,
is_manufacturer = True
)[0]
class Company(models.Model):
""" A Company object represents an external company.
It may be a supplier or a customer or a manufacturer (or a combination)