Merge lp:~therp-nl/banking-addons/ba61-lp1073521_force_alternative_move_line_tree_view into lp:banking-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 154
Proposed branch: lp:~therp-nl/banking-addons/ba61-lp1073521_force_alternative_move_line_tree_view
Merge into: lp:banking-addons/6.1
Diff against target: 26 lines (+15/-1)
1 file modified
account_banking/wizard/banking_transaction_wizard.xml (+15/-1)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/ba61-lp1073521_force_alternative_move_line_tree_view
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Review via email: mp+143043@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Shouldn't it be 'view_mode': 'tree'?

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

Ok, I understood by reading the fields_view_get override in account/account_move_line.py

1009 if context.get('view_mode', False):
1010 return result

Whatever context['view_mode'] contains, it will return early and won't replace your view by the hardcoded one.

That's a bit disturbing but should work to workaround the bug.

review: Approve
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Yes, I could have annotated that I used a nonsense value to reflect the nonsense of the code that it needs to interact with. Thank you for finding that out yourself.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_banking/wizard/banking_transaction_wizard.xml'
--- account_banking/wizard/banking_transaction_wizard.xml 2012-02-25 01:15:48 +0000
+++ account_banking/wizard/banking_transaction_wizard.xml 2013-01-13 14:15:23 +0000
@@ -93,7 +93,21 @@
93 </page>93 </page>
94 <page string="Manual match">94 <page string="Manual match">
95 <field name="manual_invoice_id"/>95 <field name="manual_invoice_id"/>
96 <field name="manual_move_line_id"/>96 <!--
97 Specify alternative tree_view_ref as a
98 workaround for lp:1073521 in OpenERP 6.1
99 Need to also define 'view_mode' to prevent
100 an instant editable tree view
101 reconstruction by account.move.line's
102 fields_view_get().
103 Both are not needed in OpenERP 6.0 or 7.0.
104 -->
105 <field name="manual_move_line_id"
106 context="{
107 'tree_view_ref': 'account.view_move_line_tax_tree',
108 'view_mode': 'yes'
109 }"
110 />
97 <newline/>111 <newline/>
98 <button colspan="1"112 <button colspan="1"
99 name="trigger_write"113 name="trigger_write"

Subscribers

People subscribed via source and target branches