Add module sale_line_product_required

This commit is contained in:
Alexis de Lattre
2014-09-19 17:45:49 +02:00
parent cffd57797b
commit 06808dde92
3 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.line.product.required.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<!-- High priority, to go after sale_stock, which STUPIDLY replaces the field
product_id, instead of doing position="attributes" -->
<field name="priority">100</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="attributes">
<attribute name="required">1</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="attributes">
<attribute name="required">1</attribute>
</xpath>
</field>
</record>
</data>
</openerp>