← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~ruchir.shukla/banking-addons/banking-addons-fix-1266890 into lp:banking-addons

 

Ruchir Shukla(BizzAppDev) has proposed merging lp:~ruchir.shukla/banking-addons/banking-addons-fix-1266890 into lp:banking-addons.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)
Related bugs:
  Bug #1266890 in Banking Addons: "Change account on statement line"
  https://bugs.launchpad.net/banking-addons/+bug/1266890

For more details, see:
https://code.launchpad.net/~ruchir.shukla/banking-addons/banking-addons-fix-1266890/+merge/203237

Fix bug 
-- 
https://code.launchpad.net/~ruchir.shukla/banking-addons/banking-addons-fix-1266890/+merge/203237
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~ruchir.shukla/banking-addons/banking-addons-fix-1266890 into lp:banking-addons.
=== modified file 'account_banking/account_banking_view.xml'
--- account_banking/account_banking_view.xml	2013-10-31 07:33:46 +0000
+++ account_banking/account_banking_view.xml	2014-01-26 12:37:44 +0000
@@ -248,7 +248,10 @@
                            position="after">
                         <field name="partner_bank_id"/>
                     </xpath>
-
+                    <xpath expr="//field[@name='line_ids']/tree//field[@name='account_id']"
+                           position="attributes">
+                       <attribute name="attrs">{'readonly': [('state', '!=', 'draft'), ('match_type', 'in', ('move', 'payment'))]}</attribute>
+                    </xpath>
                     <xpath expr="//field[@name='line_ids']/tree/field[@name='amount']"
                            position="after">
                         <field name="match_type"/>
@@ -336,7 +339,8 @@
                     <field name="partner_bank_id"/>
                     <field name="type" on_change="onchange_type(partner_id, type)"/>
                     <!-- TODO note the references to parent from the statement form view -->
-                    <field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
+                    <field domain="[('journal_id','=',parent.journal_id)]" 
+                        attrs="{'readonly': [('state', '!=', 'draft'), ('match_type', 'in', ('move', 'payment'))]}" name="account_id"/>
                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]"/>
                     <field name="amount"/>
                     <field name="match_type"/>


Follow ups