Closed agrings closed 5 years ago
Well, the example in the documentation was for old on_change methods (old api) not new ones.
For api.onchange(...)
methods, you have to call the generic method onchange(...)
on your record (link).
For instance, if I change the date_begin
value of an event.event
record, I want to get back the corresponding date_end
(link):
>>> event = odoo.env['event.event'].browse(5)
>>> event.onchange({'date_begin': u"2018-01-31 00:00:00", 'date_end': False}, 'date_begin', {'date_begin': '1'})
{u'value': {u'date_end': u'2018-01-31 01:00:00'}}
This part of the documentation needs to be improved to explain both types of onchange, thank you for the report.
Thank you for the quick reply
Closing as seems answered.
Hello,
Im trying to call the following onchange method:
So i used the suggestion given in the docs:
And called the function:
But I'm getting the error: