[IMP] sale_stock: better inherit
[odoo/odoo.git] / addons / sale_stock / sale_stock_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5         <record id="view_order_form_inherit" model="ir.ui.view">
6             <field name="name">sale.order.form.sale.stock</field>
7             <field name="model">sale.order</field>
8             <field name="inherit_id" ref="sale.view_order_form"/>
9             <field name="arch" type="xml">
10                 <data>
11                    <xpath expr="//button[@name='invoice_corrected']" position="after">
12                        <button name="ship_recreate" states="shipping_except" string="Recreate Delivery Order"/>
13                        <button name="ship_corrected" states="shipping_except" string="Ignore Exception"/>
14                    </xpath>
15                    <xpath expr="//button[@name='action_view_invoice']" position="after">
16                        <field name="picking_ids" invisible="1"/>
17                        <button name="action_view_delivery" string="View Delivery Order" type="object" class="oe_highlight"
18                            attrs="{'invisible': ['|',('picking_ids','=',False),('picking_ids','=',[])]}" groups="base.group_user"/>
19                    </xpath>
20                     <xpath expr="//button[@name='action_cancel']" position="after">
21                         <button name="ship_cancel" states="shipping_except" string="Cancel Order"/>
22                     </xpath>
23                     <field name="state" position="attributes">
24                         <attribute name="statusbar_colors" t-translate="off">{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}</attribute>
25                     </field>
26                     <field name="company_id" position="replace">
27                         <field name="company_id" readonly="True"/>
28                     </field>
29                     <field name="client_order_ref" position="after">
30                          <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" options="{'no_create': True}" groups="stock.group_locations"/>
31                     </field>
32                    <xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="attributes">
33                        <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)</attribute>
34                    </xpath>
35                    <xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="attributes">
36                        <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)</attribute>
37                    </xpath>
38                    <xpath expr="//field[@name='order_line']/tree//field[@name='product_uom_qty']" position="attributes">
39                        <attribute name="on_change">product_id_change_with_wh(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, context)</attribute>
40                    </xpath>
41                    <xpath expr="//field[@name='order_line']/form//field[@name='product_uos_qty']" position="attributes">
42                        <attribute name="context">{'partner_id':parent.partner_id, 'quantity':product_uos_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}</attribute>
43                         <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)</attribute>
44                    </xpath>
45                    <xpath expr="//field[@name='order_line']/form//field[@name='product_uom_qty']" position="attributes">
46                        <attribute name="on_change">product_id_change_with_wh(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, context)</attribute>
47                    </xpath>
48                    <field name='invoiced' position="after">
49                        <field name="shipped"/>
50                        <field name="invoice_exists" invisible="1"/>
51                    </field>
52                    <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='tax_id']" position="after">
53                        <label for="delay"/>
54                        <div>
55                            <field name="delay" class="oe_inline"/> days
56                        </div>
57                    </xpath>
58                    <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='tax_id']" position="before">
59                        <field name="product_tmpl_id" invisible="1"/>
60                        <field name="product_packaging" context="{'default_product_tmpl_id': product_tmpl_id, 'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}" on_change="product_packaging_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, parent.partner_id, product_packaging, True, context)" domain="[('product_tmpl_id','=',product_tmpl_id)]" groups="product.group_stock_packaging" />
61                    </xpath>
62                    <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='sequence']" position="after">
63                        <field name="delay" invisible="1"/>
64                    </xpath>
65                    <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='th_weight']" position="after">
66                        <field name="product_packaging" invisible="1"/>
67                    </xpath>
68                    <xpath expr="//group[@name='sales_person']" position="before">
69                         <group name="logistics">
70                             <field name="incoterm" widget="selection" groups="base.group_user"/>
71                             <field name="picking_policy" required="True"/>
72                             <field name="order_policy"/>
73                         </group>
74                    </xpath>
75                    <xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
76                         <field name="route_id" groups="sale_stock.group_route_so_lines"/>
77                    </xpath>
78                    <xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
79                        <field name="route_id" groups="sale_stock.group_route_so_lines"/>
80                    </xpath>
81                 </data>
82            </field>
83         </record>
84
85         <record id="view_res_partner_tree_type" model="ir.ui.view">
86             <field name="name">res.partner.tree.inherit.type</field>
87             <field name="model">res.partner</field>
88             <field name="inherit_id" ref="base.view_partner_tree"/>
89             <field name="arch" type="xml">
90                 <field name="parent_id" position="after">
91                     <field name="type" invisible="context.get('hide_type', 1)"/>
92                 </field>
93             </field>
94         </record>
95
96         <!-- On the customer/supplier form if "Allow a different address for
97         delivery and invoicing" is set add "Contact Details" in the more menu
98         showing the list of contact with their types -->
99         <act_window
100             id="res_partner_rule_children"
101             name="Contact Details"
102             context="{'default_parent_id': active_id, 'hide_type': 0}"
103             domain="[('parent_id','=',active_id)]"
104             res_model="res.partner"
105             src_model="res.partner"
106             view_mode="tree,form,kanban"
107             view_type="form"
108             groups="sale.group_delivery_invoice_address"
109             />
110
111         <record id="view_picking_internal_search_inherit" model="ir.ui.view">
112             <field name="name">stock.picking.search.inherit</field>
113             <field name="model">stock.picking</field>
114             <field name="inherit_id" ref="stock.view_picking_internal_search"/>
115             <field name="arch" type="xml">
116                 <xpath expr="//field[@name='partner_id']" position="before">
117                     <filter string="To Invoice" name="to_invoice" icon="terp-dolar" domain="[('invoice_state', '=', '2binvoiced')]"/>
118                 </xpath>
119             </field>
120         </record>
121
122
123         <record id="view_order_form_inherit2" model="ir.ui.view">
124             <field name="name">sale.order.line.form.sale.stock.location</field>
125             <field name="model">sale.order.line</field>
126             <field name="inherit_id" ref="sale.view_order_line_form2"/>
127             <field name="arch" type="xml">
128                 <data>
129                    <xpath expr="//field[@name='price_unit']" position="before">
130                        <field name="route_id" groups="sale_stock.group_route_so_lines" />
131                    </xpath>
132                 </data>
133            </field>
134         </record>
135         
136         <record id="view_order_line_tree_inherit" model="ir.ui.view">
137             <field name="name">sale.order.line.tree.sale.stock.location</field>
138             <field name="inherit_id" ref="sale.view_order_line_tree"/>
139             <field name="model">sale.order.line</field>
140             <field name="arch" type="xml">
141                 <xpath expr="//field[@name='price_subtotal']" position="before">
142                     <field name="route_id" groups="sale_stock.group_route_so_lines"/>
143                 </xpath>
144             </field>
145         </record>
146     </data>
147 </openerp>