Skip to content

Commit

Permalink
Merge dd01dab into 17c5c09
Browse files Browse the repository at this point in the history
  • Loading branch information
damdam-s committed Dec 21, 2015
2 parents 17c5c09 + dd01dab commit 65b2b58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sale_payment_method/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import logging
from openerp import api, models, fields, exceptions, _
import openerp.addons.decimal_precision as dp
from openerp.tools import float_is_zero

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -102,9 +103,11 @@ def automatic_payment(self, amount=None):
else:
amounts = [(date, amount)]

precision = self.env['decimal.precision'].precision_get('Account')
# reversed is cosmetic, compute returns terms in the 'wrong' order
for date, amount in reversed(amounts):
self._add_payment(journal, amount, date)
if not float_is_zero(amount, precision_digits=precision):
self._add_payment(journal, amount, date)
return True

@api.multi
Expand Down

0 comments on commit 65b2b58

Please sign in to comment.