item_serial_number = fields.Char(....,help = 'The serial number of an item')
model = fields.Char('Model',...
manufacturer = fields.Char('Original manufacturer'
year_of_production = fields.Date('Year'
based on item_serial_number I could request from REST API of the manufacturer’s web-site to obtain data to fill the fields for the user’s convenience: model, manufacturer, year_of_production. What function do you recommend to apply?
I feel that the use
Model.on_change_with_<field_name>
would be correct but how to make ONE API request for all three dependent fields?
to change all at once inside this def on_change_item_serial_number()
and fill out other fields. Is that correct? And if you could point me to the example if any?
I understand, that I was not clear enough. I have edited the original question.
So, I want Tryton fills these fields automatically, based on serial number from user and data pulled from manufacturer’s server trough API.
I want to make user’s life easier and fill the form: so it would be easier just to enter the serial number and other data will be filled automatically.
User enters ‘item_serial_number’
Press Store
Tryton pulls data trough API based on data from ‘items_serial_number’