Merge lp:~openerp-dev/openobject-addons/trunk-bug-1179762-ishwar into lp:openobject-addons

Proposed by Ishwar Malvi(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1179762-ishwar
Merge into: lp:openobject-addons
Diff against target: 55 lines (+13/-6)
2 files modified
account_voucher/account_voucher.py (+8/-3)
account_voucher/voucher_sales_purchase_view.xml (+5/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1179762-ishwar
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+168433@code.launchpad.net

Description of the change

Hello,

    I have fixed the problem of bank reconciliation with voucher without partner.

Thanks,
Ishwar Malvi

To post a comment you must log in.
Revision history for this message
Mohammad Alhashash (alhashash) wrote :

In line 21, account_id will always take the value of the first of account_id of random move line from the journal (first line from search in line 10) even if there is a partner!!!!

Unmerged revisions

8757. By Ishwar Malvi(OpenERP)

[FIX]bank reconciliation error with voucher without partner

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-05-28 09:19:41 +0000
3+++ account_voucher/account_voucher.py 2013-06-10 13:10:46 +0000
4@@ -1306,7 +1306,8 @@
5
6 voucher = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
7 current_currency_obj = voucher.currency_id or voucher.journal_id.company_id.currency_id
8-
9+ account_move_line_obj = self.pool.get('account.move.line')
10+ move_line_id = account_move_line_obj.search(cr,uid,[('journal_id','=',voucher.journal_id.id)])
11 if not currency_obj.is_zero(cr, uid, current_currency_obj, line_total):
12 diff = line_total
13 account_id = False
14@@ -1315,9 +1316,13 @@
15 account_id = voucher.writeoff_acc_id.id
16 write_off_name = voucher.comment
17 elif voucher.type in ('sale', 'receipt'):
18- account_id = voucher.partner_id.property_account_receivable.id
19+ if voucher.partner_id:
20+ account_id = voucher.partner_id.property_account_receivable.id
21+ account_id = account_move_line_obj.browse(cr,uid,move_line_id[0],context).account_id.id
22 else:
23- account_id = voucher.partner_id.property_account_payable.id
24+ if voucher.partner_id:
25+ account_id = voucher.partner_id.property_account_payable.id
26+ account_id = account_move_line_obj.browse(cr,uid,move_line_id[0],context).account_id.id
27 sign = voucher.type == 'payment' and -1 or 1
28 move_line = {
29 'name': write_off_name or name,
30
31=== modified file 'account_voucher/voucher_sales_purchase_view.xml'
32--- account_voucher/voucher_sales_purchase_view.xml 2013-05-14 11:52:13 +0000
33+++ account_voucher/voucher_sales_purchase_view.xml 2013-06-10 13:10:46 +0000
34@@ -223,9 +223,6 @@
35 <sheet string="Supplier Voucher">
36 <h1><label for="number" string="Purchase Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
37
38- <field name="pay_now" invisible="1"/>
39- <field name="account_id" domain="[('type','=','other')]" invisible="True"/>
40- <field name="type" invisible="True"/>
41 <group>
42 <group>
43 <field name="partner_id" domain="[('supplier','=',True)]" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
44@@ -285,6 +282,11 @@
45 </div>
46 <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
47 </group>
48+ <group>
49+ <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
50+ <field name="account_id" domain="[('type','=','other')]" attrs="{'invisible':[('pay_now','!=','pay_now')]}" />
51+ <field name="type"/>
52+ </group>
53 </group>
54 </page>
55 <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">

Subscribers

People subscribed via source and target branches

to all changes: