Merge lp:~openerp-dev/openobject-addons/6.0-opw-577037-rgo into lp:openobject-addons/6.0

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Xavier ALT
Approved revision: no longer in the source branch.
Merged at revision: 5383
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-577037-rgo
Merge into: lp:openobject-addons/6.0
Diff against target: 49 lines (+2/-12)
2 files modified
account_voucher/account_voucher.py (+1/-11)
account_voucher/wizard/account_statement_from_invoice_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-577037-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+118353@code.launchpad.net

Description of the change

Hello,

This fix enables the listing of credit notes while importing invoices in bank statement and voucher will behave like supplier payment when the amount is negative in bank statement line.

Kindly review the fix.

Thanks.

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 2012-03-20 07:20:19 +0000
3+++ account_voucher/account_voucher.py 2012-11-01 11:17:23 +0000
4@@ -466,9 +466,7 @@
5 account_type = 'receivable'
6
7 if not context.get('move_line_ids', False):
8- domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)]
9- if context.get('invoice_id', False):
10- domain.append(('invoice', '=', context['invoice_id']))
11+ domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id), ('journal_id.type', 'not in', ('bank', 'cash'))]
12 ids = move_line_pool.search(cr, uid, domain, context=context)
13 else:
14 ids = context['move_line_ids']
15@@ -483,10 +481,6 @@
16 total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit, context=context_multi_currency)
17
18 for line in moves:
19- if line.credit and line.reconcile_partial_id and ttype == 'receipt':
20- continue
21- if line.debit and line.reconcile_partial_id and ttype == 'payment':
22- continue
23 if invoice_id:
24 if line.invoice.id == invoice_id:
25 #if the invoice linked to the voucher line is equal to the invoice_id in context
26@@ -510,10 +504,6 @@
27 total_credit += line.credit and line.amount_currency or 0.0
28 total_debit += line.debit and line.amount_currency or 0.0
29 for line in moves:
30- if line.credit and line.reconcile_partial_id and ttype == 'receipt':
31- continue
32- if line.debit and line.reconcile_partial_id and ttype == 'payment':
33- continue
34 original_amount = line.credit or line.debit or 0.0
35 amount_unreconciled = currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, abs(line.amount_residual_currency), context=context_multi_currency)
36 line_currency_id = line.currency_id and line.currency_id.id or company_currency
37
38=== modified file 'account_voucher/wizard/account_statement_from_invoice_view.xml'
39--- account_voucher/wizard/account_statement_from_invoice_view.xml 2011-05-26 11:41:00 +0000
40+++ account_voucher/wizard/account_statement_from_invoice_view.xml 2012-11-01 11:17:23 +0000
41@@ -38,7 +38,7 @@
42 <form string="Import Entries">
43 <group colspan="4" expand="1">
44 <separator string="Payable and Receivables" colspan="4"/>
45- <field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('journal_id.type','in',['sale','purchase']), ('state', '=', 'valid')]"/>
46+ <field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False),('state', '=', 'valid')]"/>
47 </group>
48 <group colspan="4" col="6">
49 <label string ="" colspan="2"/>