Merge lp:~gs.clearcorp/openobject-addons/6.1-ccorp into lp:~clearcorp-drivers/openobject-addons/6.1-ccorp

Proposed by Glen Sojo
Status: Merged
Merged at revision: 6824
Proposed branch: lp:~gs.clearcorp/openobject-addons/6.1-ccorp
Merge into: lp:~clearcorp-drivers/openobject-addons/6.1-ccorp
Diff against target: 98 lines (+60/-28)
1 file modified
account_voucher/account_voucher.py (+60/-28)
To merge this branch: bzr merge lp:~gs.clearcorp/openobject-addons/6.1-ccorp
Reviewer Review Type Date Requested Status
ClearCorp drivers Pending
Review via email: mp+240725@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/account_voucher.py'
2--- account_voucher/account_voucher.py 2013-08-07 21:35:18 +0000
3+++ account_voucher/account_voucher.py 2014-11-05 14:27:57 +0000
4@@ -937,34 +937,66 @@
5 # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
6 # the receivable/payable account may have a secondary currency, which render this field mandatory
7 account_currency_id = company_currency <> current_currency and current_currency or False
8- move_line = {
9- 'journal_id': line.voucher_id.journal_id.id,
10- 'period_id': line.voucher_id.period_id.id,
11- 'name': _('change')+': '+(line.name or '/'),
12- 'account_id': line.voucher_id.type in ('sale', 'receipt') and line.account_id.id or account_id.id,
13- 'move_id': move_id,
14- 'partner_id': line.voucher_id.partner_id.id,
15- 'currency_id': account_currency_id,
16- 'amount_currency': 0.0,
17- 'quantity': 1,
18- 'credit': amount_residual > 0 and amount_residual or 0.0,
19- 'debit': amount_residual < 0 and -amount_residual or 0.0,
20- 'date': line.voucher_id.date,
21- }
22- move_line_counterpart = {
23- 'journal_id': line.voucher_id.journal_id.id,
24- 'period_id': line.voucher_id.period_id.id,
25- 'name': _('change')+': '+(line.name or '/'),
26- 'account_id': line.voucher_id.type in ('sale', 'receipt') and account_id.id or line.account_id.id,
27- 'move_id': move_id,
28- 'amount_currency': 0.0,
29- 'partner_id': line.voucher_id.partner_id.id,
30- 'currency_id': account_currency_id,
31- 'quantity': 1,
32- 'debit': amount_residual > 0 and amount_residual or 0.0,
33- 'credit': amount_residual < 0 and -amount_residual or 0.0,
34- 'date': line.voucher_id.date,
35- }
36+ if line.voucher_id.type == 'payment':
37+ #if True:
38+ move_line = {
39+ 'journal_id': line.voucher_id.journal_id.id,
40+ 'period_id': line.voucher_id.period_id.id,
41+ 'name': _('change')+': '+(line.name or '/'),
42+ 'account_id': line.voucher_id.type in ('sale', 'receipt') and line.account_id.id or account_id.id,
43+ 'move_id': move_id,
44+ 'partner_id': line.voucher_id.partner_id.id,
45+ 'currency_id': account_currency_id,
46+ 'amount_currency': 0.0,
47+ 'quantity': 1,
48+ 'credit': amount_residual < 0 and -amount_residual or 0.0,
49+ 'debit': amount_residual > 0 and amount_residual or 0.0,
50+ 'date': line.voucher_id.date,
51+ }
52+ move_line_counterpart = {
53+ 'journal_id': line.voucher_id.journal_id.id,
54+ 'period_id': line.voucher_id.period_id.id,
55+ 'name': _('change')+': '+(line.name or '/'),
56+ 'account_id': line.voucher_id.type in ('sale', 'receipt') and account_id.id or line.account_id.id,
57+ 'move_id': move_id,
58+ 'amount_currency': 0.0,
59+ 'partner_id': line.voucher_id.partner_id.id,
60+ 'currency_id': account_currency_id,
61+ 'quantity': 1,
62+ 'debit': amount_residual < 0 and -amount_residual or 0.0,
63+ 'credit': amount_residual > 0 and amount_residual or 0.0,
64+ 'date': line.voucher_id.date,
65+ }
66+ else:
67+ move_line = {
68+ 'journal_id': line.voucher_id.journal_id.id,
69+ 'period_id': line.voucher_id.period_id.id,
70+ 'name': _('change')+': '+(line.name or '/'),
71+ 'account_id': line.voucher_id.type in ('sale', 'receipt') and line.account_id.id or account_id.id,
72+ 'move_id': move_id,
73+ 'partner_id': line.voucher_id.partner_id.id,
74+ 'currency_id': account_currency_id,
75+ 'amount_currency': 0.0,
76+ 'quantity': 1,
77+ 'credit': amount_residual > 0 and amount_residual or 0.0,
78+ 'debit': amount_residual < 0 and -amount_residual or 0.0,
79+ 'date': line.voucher_id.date,
80+ }
81+ move_line_counterpart = {
82+ 'journal_id': line.voucher_id.journal_id.id,
83+ 'period_id': line.voucher_id.period_id.id,
84+ 'name': _('change')+': '+(line.name or '/'),
85+ 'account_id': line.voucher_id.type in ('sale', 'receipt') and account_id.id or line.account_id.id,
86+ 'move_id': move_id,
87+ 'amount_currency': 0.0,
88+ 'partner_id': line.voucher_id.partner_id.id,
89+ 'currency_id': account_currency_id,
90+ 'quantity': 1,
91+ 'debit': amount_residual > 0 and amount_residual or 0.0,
92+ 'credit': amount_residual < 0 and -amount_residual or 0.0,
93+ 'date': line.voucher_id.date,
94+ }
95+
96 if line.voucher_id.type not in ('sale', 'receipt'):
97 # in case of supplier vouchers, the line with the payable account is 'move_line_counterpart',
98 # and thus it must be returned as first element

Subscribers

People subscribed via source and target branches