Merge lp:~openerp-dev/openobject-addons/6.1-opw-578620-skh into lp:openobject-addons/6.1

Proposed by Somesh Khare
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-578620-skh
Merge into: lp:openobject-addons/6.1
Diff against target: 49 lines (+9/-4)
2 files modified
account/account_move_line.py (+8/-3)
account/account_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-578620-skh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+122232@code.launchpad.net

Description of the change

Hello Sir,

[FIX]: Counterpart entries not created when created manual entries from Journal Entries menu.

Steps:
1. Open Menu Journal Entries and select journal and period.
2. Create move line and enter the required details and press Enter.

No counterpart entries created for the move line. This branch fixes this issue for GTK client, It should also be fixed from the web-client for the context related issue.

Kindly review the branch and share your views on it.

Thanks,
Somesh Khare

To post a comment you must log in.

Unmerged revisions

6970. By Somesh Khare

[FIX]account: Counterpart entries not created when created manual entries from Journal Entries menu(Case: Ref 578620)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2012-07-27 11:43:03 +0000
3+++ account/account_move_line.py 2012-08-31 10:33:26 +0000
4@@ -229,8 +229,15 @@
5 data = super(account_move_line, self).default_get(cr, uid, fields, context=context)
6 # Starts: Manual entry from account.move form
7 if context.get('lines'):
8+ for line_record in context['lines']:
9+ if not isinstance(line_record, (tuple, list)):
10+ line_record_detail = self.read(cr, uid, line_record, ['analytic_account_id','debit','credit','name','reconcile_id','tax_code_id','tax_amount','account_id','ref','currency_id','date_maturity','amount_currency','partner_id', 'reconcile_partial_id'])
11+ else:
12+ line_record_detail = line_record[2]
13+ for item in line_record_detail.keys():
14+ data[item] = line_record_detail[item]
15 total_new = context.get('balance', 0.00)
16- if context['journal']:
17+ if context.get('journal'):
18 journal_data = journal_obj.browse(cr, uid, context['journal'], context=context)
19 if journal_data.type == 'purchase':
20 if total_new > 0:
21@@ -247,7 +254,6 @@
22 account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
23 account = account_obj.browse(cr, uid, account, context=context)
24 data['account_id'] = account.id
25-
26 s = -total_new
27 data['debit'] = s > 0 and s or 0.0
28 data['credit'] = s < 0 and -s or 0.0
29@@ -307,7 +313,6 @@
30 data['ref'] = ref_id
31 if 'partner_id' in fields:
32 data['partner_id'] = partner_id
33-
34 if move.journal_id.type == 'purchase':
35 if total > 0:
36 account = move.journal_id.default_credit_account_id
37
38=== modified file 'account/account_view.xml'
39--- account/account_view.xml 2012-05-28 06:02:51 +0000
40+++ account/account_view.xml 2012-08-31 10:33:26 +0000
41@@ -1360,7 +1360,7 @@
42 <field name="balance" invisible="1"/>
43 <field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list"
44 on_change="onchange_line_id(line_id)"
45- context="{'balance': balance , 'journal': journal_id }">
46+ context="{'balance': balance , 'journal': journal_id,'lines': line_id}">
47 <form string="Journal Item">
48 <group col="6" colspan="4">
49 <field name="name"/>