Somesh Khare(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-578620-skh into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578620-skh/+merge/122232

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
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578620-skh/+merge/122232
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-578620-skh.
=== 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 @@
         data = super(account_move_line, self).default_get(cr, uid, fields, context=context)
         # Starts: Manual entry from account.move form
         if context.get('lines'):
+            for line_record in context['lines']:
+                if not isinstance(line_record, (tuple, list)):
+                    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'])
+                else:
+                    line_record_detail = line_record[2]
+                for item in line_record_detail.keys():
+                    data[item] = line_record_detail[item]
             total_new = context.get('balance', 0.00)
-            if context['journal']:
+            if context.get('journal'):
                 journal_data = journal_obj.browse(cr, uid, context['journal'], context=context)
                 if journal_data.type == 'purchase':
                     if total_new > 0:
@@ -247,7 +254,6 @@
                     account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
                     account = account_obj.browse(cr, uid, account, context=context)
                     data['account_id'] =  account.id
-
             s = -total_new
             data['debit'] = s > 0 and s or 0.0
             data['credit'] = s < 0 and -s or 0.0
@@ -307,7 +313,6 @@
             data['ref'] = ref_id
         if 'partner_id' in fields:
             data['partner_id'] = partner_id
-
         if move.journal_id.type == 'purchase':
             if total > 0:
                 account = move.journal_id.default_credit_account_id

=== 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 @@
                             <field name="balance" invisible="1"/>
                             <field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list" 
                             on_change="onchange_line_id(line_id)"
-                            context="{'balance': balance , 'journal': journal_id }">
+                            context="{'balance': balance , 'journal': journal_id,'lines': line_id}">
                                 <form string="Journal Item">
                                     <group col="6" colspan="4">
                                         <field name="name"/>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to