Hello, in Odoo 8 i created @api.onchange function that sets domain to many2one field if another field is changed. This works OK so far but the problem is if editing existing records.
For example if i have Selection field with options Yes and No and if Yes is selected then Many2one field must allow only ids 1,2,3. If No is selected the Many2one must allow 4,5.
Changing Selection applies the domain to Many2one.
If i edit already saved record having Selection=Yes i see all the values 1,2,3,4,5 in Many2one.
Why onchange and domain is not applied when editing records?