From 766ff3fa3602a7780e4dae823269138319b36e9f Mon Sep 17 00:00:00 2001 From: "Ravi Gohil (Open ERP)" Date: Thu, 30 Jun 2011 11:42:16 +0530 Subject: [PATCH] [FIX] l10n_ch : Improved importing data with BVR Import wizard(Case:6139) bzr revid: rgo@tinyerp.com-20110630061216-2t61ilu5x642470j --- addons/l10n_ch/wizard/bvr_import.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/l10n_ch/wizard/bvr_import.py b/addons/l10n_ch/wizard/bvr_import.py index 5fb7bda2a12..4c3a6e0de6f 100644 --- a/addons/l10n_ch/wizard/bvr_import.py +++ b/addons/l10n_ch/wizard/bvr_import.py @@ -181,17 +181,18 @@ def _import(self, cursor, user, data, context=None): 'period_id': statement.period_id.id } voucher_id = voucher_obj.create(cursor, user, voucher_res, context=context) - context.update({'move_line_ids': line_ids}) + ctx = context.copy() + ctx.update({'move_line_ids': line_ids}) values['voucher_id'] = voucher_id voucher_line_dict = False if result['value']['line_ids']: for line_dict in result['value']['line_ids']: - move_line = move_line_obj.browse(cursor, user, line_dict['move_line_id'], context) + move_line = move_line_obj.browse(cursor, user, line_dict['move_line_id'], context=ctx) if move_id == move_line.move_id.id: voucher_line_dict = line_dict if voucher_line_dict: voucher_line_dict.update({'voucher_id':voucher_id}) - voucher_line_obj.create(cursor, user, voucher_line_dict, context=context) + voucher_line_obj.create(cursor, user, voucher_line_dict, context=ctx) if not account_id: if record['amount'] >= 0: @@ -224,7 +225,7 @@ def _import(self, cursor, user, data, context=None): _('The properties account payable account receivable are not set')) values['account_id'] = account_id values['partner_id'] = partner_id - statement_line_obj.create(cursor, user, values, context=context) + statement_line_obj.create(cursor, user, values, context=ctx) attachment_obj.create(cursor, user, { 'name': 'BVR', 'datas': file,