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
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2012-07-27 11:43:03 +0000
+++ account/account_move_line.py 2012-08-31 10:33:26 +0000
@@ -229,8 +229,15 @@
229 data = super(account_move_line, self).default_get(cr, uid, fields, context=context)229 data = super(account_move_line, self).default_get(cr, uid, fields, context=context)
230 # Starts: Manual entry from account.move form230 # Starts: Manual entry from account.move form
231 if context.get('lines'):231 if context.get('lines'):
232 for line_record in context['lines']:
233 if not isinstance(line_record, (tuple, list)):
234 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'])
235 else:
236 line_record_detail = line_record[2]
237 for item in line_record_detail.keys():
238 data[item] = line_record_detail[item]
232 total_new = context.get('balance', 0.00)239 total_new = context.get('balance', 0.00)
233 if context['journal']:240 if context.get('journal'):
234 journal_data = journal_obj.browse(cr, uid, context['journal'], context=context)241 journal_data = journal_obj.browse(cr, uid, context['journal'], context=context)
235 if journal_data.type == 'purchase':242 if journal_data.type == 'purchase':
236 if total_new > 0:243 if total_new > 0:
@@ -247,7 +254,6 @@
247 account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)254 account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
248 account = account_obj.browse(cr, uid, account, context=context)255 account = account_obj.browse(cr, uid, account, context=context)
249 data['account_id'] = account.id256 data['account_id'] = account.id
250
251 s = -total_new257 s = -total_new
252 data['debit'] = s > 0 and s or 0.0258 data['debit'] = s > 0 and s or 0.0
253 data['credit'] = s < 0 and -s or 0.0259 data['credit'] = s < 0 and -s or 0.0
@@ -307,7 +313,6 @@
307 data['ref'] = ref_id313 data['ref'] = ref_id
308 if 'partner_id' in fields:314 if 'partner_id' in fields:
309 data['partner_id'] = partner_id315 data['partner_id'] = partner_id
310
311 if move.journal_id.type == 'purchase':316 if move.journal_id.type == 'purchase':
312 if total > 0:317 if total > 0:
313 account = move.journal_id.default_credit_account_id318 account = move.journal_id.default_credit_account_id
314319
=== modified file 'account/account_view.xml'
--- account/account_view.xml 2012-05-28 06:02:51 +0000
+++ account/account_view.xml 2012-08-31 10:33:26 +0000
@@ -1360,7 +1360,7 @@
1360 <field name="balance" invisible="1"/>1360 <field name="balance" invisible="1"/>
1361 <field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list" 1361 <field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list"
1362 on_change="onchange_line_id(line_id)"1362 on_change="onchange_line_id(line_id)"
1363 context="{'balance': balance , 'journal': journal_id }">1363 context="{'balance': balance , 'journal': journal_id,'lines': line_id}">
1364 <form string="Journal Item">1364 <form string="Journal Item">
1365 <group col="6" colspan="4">1365 <group col="6" colspan="4">
1366 <field name="name"/>1366 <field name="name"/>