[VIEW] ~fix open analytic accounts are selectable in supplier invoice too
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Mon, 17 Dec 2018 14:48:15 +0000 (15:48 +0100)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Mon, 17 Dec 2018 14:48:15 +0000 (15:48 +0100)
view/account.xml

index c9d2900..a7fb198 100644 (file)
@@ -6,9 +6,6 @@
             <field name="model">account.invoice</field>
             <field name="inherit_id" ref="account.invoice_form"/>
             <field name="arch" type="xml">
             <field name="model">account.invoice</field>
             <field name="inherit_id" ref="account.invoice_form"/>
             <field name="arch" type="xml">
-                <xpath expr="//field[@name='account_analytic_id']" position="attributes">
-                    <attribute name="required">1</attribute>
-                </xpath>
                 <xpath expr="//tree/field[@name='account_analytic_id']" position="replace">
                     <field name="account_analytic_id" domain="[('type', '=', 'normal'), ('company_id', '=', parent.company_id), ('code', '!=', 'False'), ('state', '=', 'open')]" required="1" />
                 </xpath>
                 <xpath expr="//tree/field[@name='account_analytic_id']" position="replace">
                     <field name="account_analytic_id" domain="[('type', '=', 'normal'), ('company_id', '=', parent.company_id), ('code', '!=', 'False'), ('state', '=', 'open')]" required="1" />
                 </xpath>
@@ -19,8 +16,8 @@
             <field name="model">account.invoice</field>
             <field name="inherit_id" ref="account.invoice_supplier_form"/>
             <field name="arch" type="xml">
             <field name="model">account.invoice</field>
             <field name="inherit_id" ref="account.invoice_supplier_form"/>
             <field name="arch" type="xml">
-                <xpath expr="//field[@name='account_analytic_id']" position="attributes">
-                    <attribute name="required">1</attribute>
+                <xpath expr="//tree/field[@name='account_analytic_id']" position="replace">
+                    <field name="account_analytic_id" domain="[('type', '=', 'normal'), ('company_id', '=', parent.company_id), ('code', '!=', 'False'), ('state', '=', 'open')]" required="1" />
                 </xpath>
             </field>
         </record>
                 </xpath>
             </field>
         </record>