Skip to content

Commit

Permalink
[IMP] Use api.one to avoid a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpeiffer committed Feb 11, 2015
1 parent 85fd4d5 commit 0984153
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions account_cash_discount_base/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def compute_discount_amount(self):
self.discount_percent != 0.0):
self.discount_amount = self._compute_discount_amount()

@api.v8
@api.one
def compute_discount_due_date(self):
if self.discount_delay != 0 and (self.type != 'in_invoice' or
self.discount_delay != 0):
Expand All @@ -90,6 +90,5 @@ def action_move_create(self):
@api.multi
def action_date_assign(self):
super(account_invoice, self).action_date_assign()
for inv in self:
inv.compute_discount_due_date()
self.compute_discount_due_date()
return True

0 comments on commit 0984153

Please sign in to comment.