diff --git a/invoice.py b/invoice.py index 7ffa0aef2a..3f2201cc9c 100644 --- a/invoice.py +++ b/invoice.py @@ -920,9 +920,12 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): keys.remove(key) if len(keys): self.check_modify(cursor, user, ids, context=context) + update_tax_ids = [x.id for x in self.browse(cursor, user, ids, + context=context) if x.state == 'draft'] res = super(Invoice, self).write(cursor, user, ids, vals, context=context) - self.update_taxes(cursor, user, ids, context=context) + if update_tax_ids: + self.update_taxes(cursor, user, update_tax_ids, context=context) if 'state' in vals and vals['state'] in ('paid', 'cancel'): self.workflow_trigger_trigger(cursor, user, ids, context=context) return res