forked from akretion/sale-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sale_view.xml
54 lines (48 loc) · 2.65 KB
/
sale_view.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014-2015 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <[email protected]>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_order_form" model="ir.ui.view">
<field name="name">start.end.dates.view_order_form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="after">
<field name="start_date"
attrs="{'invisible': [('must_have_dates', '=', False)], 'required': [('must_have_dates', '=', True)]}"/>
<field name="end_date"
attrs="{'invisible': [('must_have_dates', '=', False)], 'required': [('must_have_dates', '=', True)]}"/>
<field name="number_of_days"
attrs="{'invisible': [('must_have_dates', '=', False)], 'required': [('must_have_dates', '=', True)]}"/>
<field name="must_have_dates" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="start_date"/>
<field name="end_date"/>
<field name="number_of_days" invisible="1"/>
<field name="must_have_dates" invisible="1"/>
</xpath>
<field name="pricelist_id" position="after">
<field name="default_start_date"/>
<field name="default_end_date"/>
</field>
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="attributes">
<attribute name="context_default_start_date">{'default_start_date': parent.default_start_date}</attribute>
<attribute name="context_default_end_date">{'default_end_date': parent.default_end_date}</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="attributes">
<attribute name="context_default_start_date">{'default_start_date': parent.default_start_date}</attribute>
<attribute name="context_default_end_date">{'default_end_date': parent.default_end_date}</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/form//field[@name='product_uom_qty']" position="attributes">
<attribute name="context_default_start_date">{'default_start_date': parent.default_start_date}</attribute>
<attribute name="context_default_end_date">{'default_end_date': parent.default_end_date}</attribute>
</xpath>
</field>
</record>
</data>
</openerp>