You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class Company has several methods which help in usage, eg. getting Contacts for the Company (getCompany).
Spontaneously, a new class along the lines of Contact for addresses, and a method in Company to return them, is probably what you're after.
General notes
There is no contribution docs here, but there are pre-commit checks defined. Installing these before you commit locally will make it easier to pass the tests later on.
There are also invoke commands to use locally, see tasks.py.
Activity
miggland commentedon Nov 29, 2023
I assume you've seen the documentation, available for example at:
https://demo.inventree.org/api-doc/
New classes can be added simply, see the example for
Contacts:inventree-python/inventree/company.py
Line 11 in b7f4cab
These use the methods defined in
inventree.base.InventreeObject.Get the URL from the docs, the relevant API_VERSION can be found in https://github.com/inventree/InvenTree/blob/master/InvenTree/InvenTree/api_version.py, or via the corresponding PR which enabled addresses.
The class
Companyhas several methods which help in usage, eg. getting Contacts for the Company (getCompany).Spontaneously, a new class along the lines of
Contactfor addresses, and a method in Company to return them, is probably what you're after.General notes
There is no contribution docs here, but there are pre-commit checks defined. Installing these before you commit locally will make it easier to pass the tests later on.
There are also
invokecommands to use locally, seetasks.py.miggland commentedon Nov 29, 2023
Also, you'll need to add some tests for your new methods. You should be able to find inspiration in the tets for Company and Contact