Hello i would like to add new Records of Products into my Tryton over a API.
I have read the Articel in the Manual “User Application — trytond latest documentation” and had build successful interfaces.
Now i am trying to add an Api to the Products Module, so i can add new Records by an interface. But i cant find the Function i need to manipulate to achieve it.
When i look into the product.py file i found some Functions but the don t make sense to me.
Did some tried something like this? How do modules write Information into the Database?
There is some code in the timesheet module that creates / updates timesheet lines using an API defined for use by User Applications: modules/timesheet: d5bd5090b474 routes.py
You should be able to do something similar, but for products instead of timesheet lines.
User aplications are for token based autentication APIs.
It is also possible to use the plain JSON-RPC API with standar authentication (user/password+session). This way you can directly call the create method of the product model without requiring to develop any custom code on server side.
The only think i dont unterstand is how to create the payload for the JSON_RPC. The documentation is a bit empty.
Here is an example of my python code :