← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~c2c/banking-addons/bank-statement-reconcile-61-fix-1083517 into lp:banking-addons/bank-statement-reconcile-61

 

Alexandre Fayolle @ camptocamp has proposed merging lp:~c2c/banking-addons/bank-statement-reconcile-61-fix-1083517 into lp:banking-addons/bank-statement-reconcile-61.

Requested reviews:
  Banking Addons Team (banking-addons-team)
Related bugs:
  Bug #1083517 in Banking Addons: "account_statement_base_import: bad redirection after wizard has imported a statement"
  https://bugs.launchpad.net/banking-addons/+bug/1083517

For more details, see:
https://code.launchpad.net/~c2c/banking-addons/bank-statement-reconcile-61-fix-1083517/+merge/136365

use an in-database action with a customized domain to get the correct redirection after the wizard has run. 
-- 
https://code.launchpad.net/~c2c/banking-addons/bank-statement-reconcile-61-fix-1083517/+merge/136365
Your team Banking Addons Team is requested to review the proposed merge of lp:~c2c/banking-addons/bank-statement-reconcile-61-fix-1083517 into lp:banking-addons/bank-statement-reconcile-61.
=== modified file 'account_statement_base_import/wizard/import_statement.py'
--- account_statement_base_import/wizard/import_statement.py	2012-08-02 12:46:12 +0000
+++ account_statement_base_import/wizard/import_statement.py	2012-11-27 10:56:20 +0000
@@ -110,11 +110,9 @@
                                             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


Follow ups