Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-61-fix-1083517 into lp:banking-addons/bank-statement-reconcile-61

Proposed by Alexandre Fayolle - camptocamp
Status: Merged
Merged at revision: 71
Proposed branch: lp:~camptocamp/banking-addons/bank-statement-reconcile-61-fix-1083517
Merge into: lp:banking-addons/bank-statement-reconcile-61
Diff against target: 21 lines (+6/-8)
1 file modified
account_statement_base_import/wizard/import_statement.py (+6/-8)
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-61-fix-1083517
Reviewer Review Type Date Requested Status
Nicolas Bessi - Camptocamp (community) Approve
Review via email: mp+136365@code.launchpad.net

Description of the change

use an in-database action with a customized domain to get the correct redirection after the wizard has run.

To post a comment you must log in.
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello
In domain can sid be a list? If it is not the case the fix seems ok else the case should be managed.

Regards

Nicolas

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

> Hello
> In domain can sid be a list? If it is not the case the fix seems ok else the
> case should be managed.

The code for statement_import in AccountStatementProfile returns a single statement id.

(and the original code used a very complicated construct to put the single integer in a list)

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Seems good to me

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_statement_base_import/wizard/import_statement.py'
2--- account_statement_base_import/wizard/import_statement.py 2012-08-02 12:46:12 +0000
3+++ account_statement_base_import/wizard/import_statement.py 2012-11-27 10:56:20 +0000
4@@ -110,11 +110,9 @@
5 ftype.replace('.',''),
6 context=context
7 )
8- return {
9- 'domain': "[('id','in', ["+','.join(map(str,[sid]))+"])]",
10- 'name': 'Imported Bank Statement',
11- 'view_type': 'form',
12- 'view_mode': 'tree,form',
13- 'res_model': 'account.bank.statement',
14- 'type': 'ir.actions.act_window',
15- }
16+ model_obj = self.pool.get('ir.model.data')
17+ action_obj = self.pool.get('ir.actions.act_window')
18+ action_id = model_obj.get_object_reference(cursor, uid, 'account', 'action_bank_statement_tree')[1]
19+ res = action_obj.read(cursor, uid, action_id)
20+ res['domain'] = res['domain'][:-1] + ",('id', '=', %d)]" % sid
21+ return res

Subscribers

People subscribed via source and target branches