From 6e8a72e1b5da405d5616e6f648b6748b02c2448c Mon Sep 17 00:00:00 2001 From: "Jay Vora (OpenERP)" Date: Fri, 6 May 2011 20:35:22 +0530 Subject: [PATCH] [FIX] Account : default_get() corrected in order to be compatible with web client lp bug: https://launchpad.net/bugs/772451 fixed bzr revid: jvo@tinyerp.com-20110506150522-mheeupuiizhjqayy --- addons/account/account_move_line.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 7ed1c675662..91a15e8189e 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -226,11 +226,14 @@ class account_move_line(osv.osv): # Starts: Manual entry from account.move form if context.get('lines',[]): total_new = 0.00 - for i in context['lines']: - if i[2]: - total_new += (i[2]['debit'] or 0.00)- (i[2]['credit'] or 0.00) - for item in i[2]: - data[item] = i[2][item] + 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] + total_new += (line_record_detail['debit'] or 0.00)- (line_record_detail['credit'] or 0.00) + for item in line_record_detail.keys(): + data[item] = line_record_detail[item] if context['journal']: journal_data = journal_obj.browse(cr, uid, context['journal'], context=context) if journal_data.type == 'purchase':