diff --git a/inventree/company.py b/inventree/company.py index a158aed..5b6aee8 100644 --- a/inventree/company.py +++ b/inventree/company.py @@ -15,6 +15,13 @@ class Contact(inventree.base.InventreeObject): REQUIRED_API_VERSION = 104 +class Address(inventree.base.InventreeObject): + """Class representing the Address model""" + + URL = 'company/address/' + REQUIRED_API_VERSION = 126 + + class Company(inventree.base.ImageMixin, inventree.base.MetadataMixin, inventree.base.InventreeObject): """ Class representing the Company database model """ @@ -25,6 +32,11 @@ def getContacts(self, **kwargs): kwargs['company'] = self.pk return Contact.list(self._api, **kwargs) + def getAddresses(self, **kwargs): + """Return addresses associated with this Company""" + kwargs['company'] = self.pk + return Address.list(self._api, **kwargs) + def getSuppliedParts(self, **kwargs): """ Return list of SupplierPart objects supplied by this Company