forked from akretion/sale-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sale_view.xml
54 lines (48 loc) · 3.21 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">sale_rental.view_order_form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_start_end_dates.view_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/form//field[@name='start_date']" position="before">
<field name="rental_type"
attrs="{'invisible': [('rental', '=', False)], 'required': [('rental', '=', True)]}"/>
<field name="extension_rental_id"
attrs="{'invisible': [('rental_type', '!=', 'rental_extension')], 'required': [('rental_type', '=', 'rental_extension')]}"
domain="[('rental_product_id', '=', product_id), ('state', 'in', ('ordered', 'out'))]" />
<field name="sell_rental_id"
attrs="{'invisible': [('can_sell_rental', '=', False)]}"
domain="[('rented_product_id', '=', product_id), ('state', '=', 'out')]"/>
<field name="rental" invisible="1"/>
<field name="can_sell_rental" invisible="1"/>
</xpath>
<label for="product_uom_qty" position="before">
<field name="rental_qty" attrs="{'invisible': [('rental', '=', False)], 'required': [('rental', '=', True)]}"/>
</label>
</field>
</record>
<record id="view_order_form_sale_stock" model="ir.ui.view">
<field name="name">sale_rental.sale_stock.view_order_form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_stock.view_order_form_inherit" />
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="attributes">
<attribute name="on_change">product_id_change_with_wh_with_rental(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, False, name, parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, rental_type, rental_qty, context)</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/form//field[@name='product_uom_qty']" position="attributes">
<attribute name="on_change">product_id_change_with_wh_with_rental(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,False,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, rental_type, rental_qty, context)</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/form//field[@name='product_uos_qty']" position="attributes">
<attribute name="on_change">product_id_change_with_wh_with_rental(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,False,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, rental_type, rental_qty, context)</attribute>
</xpath>
</field>
</record>
</data>
</openerp>