Merge lp:~serpentcs/openerp-usa/supp_credits-fix into lp:openerp-usa/6.0

Proposed by Serpent Consulting Services
Status: Merged
Merged at revision: 142
Proposed branch: lp:~serpentcs/openerp-usa/supp_credits-fix
Merge into: lp:openerp-usa/6.0
Diff against target: 41 lines (+5/-6)
1 file modified
account_voucher_credits_us/voucher.py (+5/-6)
To merge this branch: bzr merge lp:~serpentcs/openerp-usa/supp_credits-fix
Reviewer Review Type Date Requested Status
npg Pending
Review via email: mp+211710@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_voucher_credits_us/voucher.py'
2--- account_voucher_credits_us/voucher.py 2014-03-10 14:54:29 +0000
3+++ account_voucher_credits_us/voucher.py 2014-03-19 12:23:51 +0000
4@@ -523,17 +523,16 @@
5 line.type = 'dr'
6
7 if line.type == 'dr':
8- line_total += amount
9- move_line['debit'] = amount
10+ line_total += amount + line.credit_used
11+ move_line['debit'] = move_line['amount_currency'] = amount + line.credit_used
12 else:
13 line_total -= amount + line.credit_used
14- move_line['credit'] = amount + line.credit_used
15+ move_line['credit'] = move_line['amount_currency'] = amount + line.credit_used
16
17- if vch.tax_id and vch.type in ('sale', 'purchase'):
18+ if vch.tax_id:
19 move_line.update({
20 'account_tax_id': vch.tax_id.id,
21 })
22-
23 if line_total < 0.01 and line_total > -0.01:
24 line_total = 0.0
25 master_line = move_line_pool.create(cr, uid, move_line, context=context)
26@@ -680,7 +679,6 @@
27
28 # if line.type == 'dr':
29 # line.write({'pending_credits': 0})
30-
31 move_line_credit_id = False
32 ACC = False
33 move_line = {
34@@ -722,6 +720,7 @@
35 'debit': diff < 0 and -diff or 0.0,
36 'account_id':ACC,
37 'currency_id': vch.currency_id.id,
38+ 'amount_currency' : abs(diff),
39 }
40 # if vch.type in ('purchase', 'payment'):
41 # move_line.update({

Subscribers

People subscribed via source and target branches