Merge lp:~openerp-dev/openobject-addons/7.0-opw-593538-dhr into lp:openobject-addons/7.0

Proposed by Dharti Ratani(OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 9219
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-593538-dhr
Merge into: lp:openobject-addons/7.0
Diff against target: 31 lines (+6/-2)
2 files modified
account_voucher/wizard/account_statement_from_invoice.py (+5/-1)
account_voucher/wizard/account_statement_from_invoice_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-593538-dhr
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+168641@code.launchpad.net

Description of the change

Hello Sir,

Fixed the issue : when account_voucher is installed, it is impossible to import invoices that are partially paid in bank statements from Import Invoices button.

Thanks
dhr

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

9219. By Dharti Ratani(OpenERP)

[FIX]Fixed the issue : when account_voucher is installed, it impossible to Import Invoices partially paid in bank statements

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_voucher/wizard/account_statement_from_invoice.py'
2--- account_voucher/wizard/account_statement_from_invoice.py 2012-12-18 17:55:47 +0000
3+++ account_voucher/wizard/account_statement_from_invoice.py 2013-06-11 11:03:48 +0000
4@@ -110,9 +110,13 @@
5 if voucher_line_dict:
6 voucher_line_dict.update({'voucher_id': voucher_id})
7 voucher_line_obj.create(cr, uid, voucher_line_dict, context=context)
8+
9+ #Updated the amount of voucher in case of partially paid invoice
10+ amount_res = voucher_line_dict.get('amount_unreconciled',amount)
11+ voucher_obj.write(cr, uid, voucher_id, {'amount':amount_res}, context=context)
12 statement_line_obj.create(cr, uid, {
13 'name': line.name or '?',
14- 'amount': amount,
15+ 'amount': amount_res if amount >= 0 else -amount_res,
16 'type': type,
17 'partner_id': line.partner_id.id,
18 'account_id': line.account_id.id,
19
20=== modified file 'account_voucher/wizard/account_statement_from_invoice_view.xml'
21--- account_voucher/wizard/account_statement_from_invoice_view.xml 2012-11-29 22:26:45 +0000
22+++ account_voucher/wizard/account_statement_from_invoice_view.xml 2013-06-11 11:03:48 +0000
23@@ -7,7 +7,7 @@
24 <field name="arch" type="xml">
25 <form string="Import Entries" version="7.0">
26 <separator string="Payable and Receivables"/>
27- <field height="300" width="700" name="line_ids" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('reconcile_partial_id','=',False), ('state', '=', 'valid')]"/>
28+ <field height="300" width="700" name="line_ids" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('state', '=', 'valid')]"/>
29 <footer>
30 <button string="Ok" name="populate_statement" type="object" class="oe_highlight"/>
31 or