Merge lp:~serpentcs/openerp-usa/fix-check-writing-amount into lp:openerp-usa/6.0

Proposed by Serpent Consulting Services
Status: Merged
Merged at revision: 149
Proposed branch: lp:~serpentcs/openerp-usa/fix-check-writing-amount
Merge into: lp:openerp-usa/6.0
Diff against target: 17 lines (+1/-6)
1 file modified
account_check_writing/account_voucher.py (+1/-6)
To merge this branch: bzr merge lp:~serpentcs/openerp-usa/fix-check-writing-amount
Reviewer Review Type Date Requested Status
npg Pending
Review via email: mp+215745@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_check_writing/account_voucher.py'
2--- account_check_writing/account_voucher.py 2014-04-14 13:43:11 +0000
3+++ account_check_writing/account_voucher.py 2014-04-14 19:42:22 +0000
4@@ -130,12 +130,7 @@
5 context = {}
6 amount = 0
7 for rec in self.browse(cr, uid, ids, context=context):
8- LINES = rec.line_cr_ids
9- if rec.type in ('purchase', 'payment'):
10- LINES = rec.line_dr_ids
11- for voucher_line in LINES:
12- if voucher_line.pay:
13- amount += round(voucher_line.amount,2)
14+ amount = sum([round(x.amount,2) for x in rec.line_ids])
15 if str(rec.amount) != str(amount):
16 raise osv.except_osv(_('Error'),_('Please re-calculate the amount as it does not match to the total!'))
17 return super(account_voucher, self).proforma_voucher(cr, uid, ids, context=context)

Subscribers

People subscribed via source and target branches