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

index ac4c029..fe1bd4d 100644 (file)
@@ -50,6 +50,7 @@ It installs the profile for bike co-ops to manage some features like:
     'update_xml': [
         'view/account_invoice_view.xml',
         'view/hr_expense.xml',
+        'view/purchase.xml',
         'view/sale.xml',
     ],
     'installable': True,
diff --git a/view/purchase.xml b/view/purchase.xml
new file mode 100644 (file)
index 0000000..c2371b7
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="view_purchase_order_form" model="ir.ui.view">
+            <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>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>