class SoftOneInvoice(models.Model):
_inherit= "account.move"
global_discount=fields.Float('global discount')
class SoftOneInvoiceLine(models.Model):
_inherit= "account.move.line" @api.onchange("discount")
def _onchange_discount(self):
self.move_id.global_discount=0.0
The code above doesn't update in form view the custom field global_discount of account.move model when I change the discount field of an account move line.