diff --git a/sale_multic_fix/models/account_invoice.py b/sale_multic_fix/models/account_invoice.py index 8e832fdf..60eb4ca7 100644 --- a/sale_multic_fix/models/account_invoice.py +++ b/sale_multic_fix/models/account_invoice.py @@ -18,3 +18,12 @@ def _onchange_partner_shipping_id(self): self.partner_id.id, self.partner_shipping_id.id) if fiscal_position: self.fiscal_position_id = fiscal_position + + @api.onchange('partner_id', 'company_id') + def _onchange_delivery_address(self): + """ when changing company, we prefer to keep original terms just in case + they where modified manually on SO / or invoice""" + original_comment = self._origin.comment + super(AccountInvoice,self)._onchange_delivery_address() + if original_comment and original_comment != self.comment: + self.comment = original_comment