diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index bef59e4282e..0f0384b4cb7 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2254,7 +2254,7 @@ class AccountMove(models.Model): return copied_am def _sanitize_vals(self, vals): - if 'invoice_line_ids' in vals and 'line_ids' in vals: + if vals.get('invoice_line_ids') and vals.get('line_ids'): # values can sometimes be in only one of the two fields, sometimes in # both fields, sometimes one field can be explicitely empty while the other # one is not, sometimes not...