From a94bd3582b21223eb96815ef58b47e8bae7b23e4 Mon Sep 17 00:00:00 2001 From: "Alexandre Fayolle @ camptocamp" Date: Tue, 27 Nov 2012 11:51:47 +0100 Subject: [PATCH] [FIX] account_statement_base_import: use the in-db action with a fixed domain to display the correct view after a statement is imported --- .../wizard/import_statement.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/account_statement_base_import/wizard/import_statement.py b/account_statement_base_import/wizard/import_statement.py index 23bb6c3b..6be40c06 100644 --- a/account_statement_base_import/wizard/import_statement.py +++ b/account_statement_base_import/wizard/import_statement.py @@ -110,11 +110,9 @@ class CreditPartnerStatementImporter(osv.osv_memory): ftype.replace('.',''), context=context ) - return { - 'domain': "[('id','in', ["+','.join(map(str,[sid]))+"])]", - 'name': 'Imported Bank Statement', - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'account.bank.statement', - 'type': 'ir.actions.act_window', - } + model_obj = self.pool.get('ir.model.data') + action_obj = self.pool.get('ir.actions.act_window') + action_id = model_obj.get_object_reference(cursor, uid, 'account', 'action_bank_statement_tree')[1] + res = action_obj.read(cursor, uid, action_id) + res['domain'] = res['domain'][:-1] + ",('id', '=', %d)]" % sid + return res