Need to override onchange function from old v7 API, like this one:
Python (v7 API):
...
def onchange_field_a(self, cr, uid, ids, field_a, field_b, field_c, context=None):
vals = {'value':{} }
#
# A huge code here to be executed on field_a changes...
#
return vals
...
XML (v7 API):
...
<field name="field_a" on_change="onchange_field_a(field_a, field_b, field_c)"
...
v7 onchange function said to be incompatible with the new v8 api. here is related posts on this forum that I've found for now:
https://www.odoo.com/forum/help-1/question/75299
https://www.odoo.com/forum/help-1/question/73893
- however, we'd like to override onchange_field_a function using new v8.0 API and 1) we do not want to rewrite a huge code written in v7 onchange function, which is well tested and working in the parent model and 2) we do not want to copy-paste it either. Beside that it's bad practice to have copy of a same code in several places, it should be harder to maintain such a copy, as it's likely to receive further bugfixes and improvements (if any) in the same v7 implementation and the same place where it's defined. So, we need to reuse existing v7 onchange_field_a function code defined in the superclass by calling it from overridden v8 onchange_field_a function and add our additional code afterwards (or before,depending on case).