[FIX] account_statement_base_import: use the in-db action with a fixed domain to display the correct view after a statement is imported

This commit is contained in:
Alexandre Fayolle @ camptocamp
2012-11-27 11:51:47 +01:00
parent 3ac78f679b
commit a94bd3582b

View File

@@ -110,11 +110,9 @@ class CreditPartnerStatementImporter(osv.osv_memory):
ftype.replace('.',''), ftype.replace('.',''),
context=context context=context
) )
return { model_obj = self.pool.get('ir.model.data')
'domain': "[('id','in', ["+','.join(map(str,[sid]))+"])]", action_obj = self.pool.get('ir.actions.act_window')
'name': 'Imported Bank Statement', action_id = model_obj.get_object_reference(cursor, uid, 'account', 'action_bank_statement_tree')[1]
'view_type': 'form', res = action_obj.read(cursor, uid, action_id)
'view_mode': 'tree,form', res['domain'] = res['domain'][:-1] + ",('id', '=', %d)]" % sid
'res_model': 'account.bank.statement', return res
'type': 'ir.actions.act_window',
}