[VIEW] +analytic account is required in supplier invoice master
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Fri, 8 Apr 2016 08:09:59 +0000 (10:09 +0200)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Fri, 8 Apr 2016 08:09:59 +0000 (10:09 +0200)
__openerp__.py
view/account.xml [new file with mode: 0644]
view/account_invoice_view.xml [deleted file]
view/purchase.xml

index fe1bd4d..3982ab5 100644 (file)
@@ -48,7 +48,7 @@ It installs the profile for bike co-ops to manage some features like:
     'init_xml': [
     ],
     'update_xml': [
-        'view/account_invoice_view.xml',
+        'view/account.xml',
         'view/hr_expense.xml',
         'view/purchase.xml',
         'view/sale.xml',
diff --git a/view/account.xml b/view/account.xml
new file mode 100644 (file)
index 0000000..c9d2900
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="invoice_form" model="ir.ui.view">
+            <field name="name">account.invoice.form</field>
+            <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>
+            </field>
+        </record>
+        <record id="view_invoice_supplier_form" model="ir.ui.view">
+            <field name="name">account.invoice.form</field>
+            <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>
+            </field>
+        </record>
+    </data>
+</openerp>
diff --git a/view/account_invoice_view.xml b/view/account_invoice_view.xml
deleted file mode 100644 (file)
index 04acc9b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<openerp>
-    <data>
-        <record id="invoice_form" model="ir.ui.view">
-            <field name="name">account.invoice.form</field>
-            <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>
-            </field>
-        </record>
-    </data>
-</openerp>
index c2371b7..c1bca0f 100644 (file)
@@ -5,7 +5,6 @@
             <field name="name">purchase.order.form</field>
             <field name="model">purchase.order</field>
             <field name="inherit_id" ref="purchase.purchase_order_form"/>
-            <field name="priority" eval="8"/>
             <field name="arch" type="xml">
                 <xpath expr="//field[@name='account_analytic_id']" position="attributes">
                     <attribute name="required">1</attribute>