[REF] stock: refactoring of recompute stock operation links
[odoo/odoo.git] / addons / stock / product_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <record id="product_search_form_view_stock" model="ir.ui.view">
6             <field name="name">product.search.stock.form</field>
7             <field name="model">product.product</field>
8             <field name="inherit_id" ref="product.product_search_form_view"/>
9             <field name="arch" type="xml">
10                 <field name="pricelist_id" position="before">
11                     <field name="location_id" widget="selection" context="{'location': self}"/>
12                     <field name="warehouse_id" widget="selection" context="{'warehouse': self}"/>
13                 </field>
14                 <field name="categ_id" position="before">
15                     <separator/>
16                     <filter name="real_stock_available" string="Available Products" domain="[('qty_available','&gt;',0)]"/>
17                     <filter name="virtual_stock_available" string="Forecast Available Products" domain="[('virtual_available','&gt;',0)]"/>
18                     <filter name="real_stock_negative" string="Exhausted Stock" domain="[('qty_available','&lt;=',0)]"/>
19                     <filter name="virtual_stock_negative" string="Forecast Exhausted Stock" domain="[('virtual_available','&lt;=',0)]"/>
20                     
21                 </field>
22             </field>
23         </record>
24
25         <record id="view_stock_product_tree" model="ir.ui.view">
26             <field name="name">product.stock.tree.inherit</field>
27             <field name="model">product.product</field>
28             <field name="inherit_id" ref="product.product_product_tree_view"/>
29             <field name="arch" type="xml">
30
31                 <field name="uom_id" position="after">
32                     <field name="qty_available"/>
33                     <field name="virtual_available"/>
34                 </field>
35                 <tree position="attributes">
36                     <attribute name="colors">{'red':virtual_available&lt;0, 'blue':virtual_available&gt;=0 and state in ('draft', 'end', 'obsolete'), 'black':virtual_available&gt;=0 and state not in ('draft', 'end', 'obsolete')}</attribute>
37                 </tree>
38             </field>
39         </record>
40
41         <record id="view_template_property_form" model="ir.ui.view">
42             <field name="name">product.template.stock.property.form.inherit</field>
43             <field name="model">product.template</field>
44             <field name="inherit_id" ref="product.product_template_form_view"/>
45             <field name="arch" type="xml">
46                 <xpath expr="//group[@name='sale_condition']" position="inside">
47                     <label for="sale_delay"/>
48                     <div>
49                         <field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
50                     </div>
51                 </xpath>
52                 <xpath expr="//group[@name='status']" position="after">
53                     <group name="store" string="Storage Location">
54                         <field name="loc_rack"/>
55                         <field name="loc_row"/>
56                         <field name="loc_case"/>
57                     </group>
58                 </xpath>
59                 <xpath expr="//group[@name='weight']" position="after">
60                     <group string="Counter-Part Locations Properties" groups="stock.group_locations">
61                         <field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
62                         <field name="property_stock_production" domain="[('usage','=','production')]"/>
63                         <field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
64                     </group>
65                 </xpath>
66                 <field name="product_manager" position="attributes" version="7.0">
67                     <attribute name="context">{'default_groups_ref': ['base.group_user', 'base.group_sale_manager', 'stock.group_stock_manager']}</attribute>
68                 </field>
69             </field>
70         </record>
71
72         <record id="action_receive_move" model="ir.actions.act_window">
73             <field name="name">Receptions</field>
74             <field name="res_model">stock.move</field>
75             <field name="type">ir.actions.act_window</field>
76             <field name="view_type">form</field>
77             <field name="view_mode">tree,form</field>
78             <field name="domain" eval="[('picking_id.picking_type_id.code','=','outgoing'), ('location_id.usage','!=','internal'), ('location_dest_id.usage', '=', 'internal')]"/>
79             <field name="view_id" ref="view_move_tree_reception_picking"/>
80             <field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
81             <field name="help" type="html">
82               <p class="oe_view_nocontent_create">
83                 Click to register a reception for this product.
84               </p><p>
85                 Here you will find the history of all receptions related to
86                 this product, as well as all future receptions you are waiting
87                 from your suppliers.
88               </p>
89             </field>
90         </record>
91
92         <record id="action_deliver_move" model="ir.actions.act_window">
93             <field name="name">Deliveries</field>
94             <field name="res_model">stock.move</field>
95             <field name="type">ir.actions.act_window</field>
96             <field name="view_type">form</field>
97             <field name="view_mode">tree,form</field>
98             <field name="view_id" ref="view_move_tree_reception_picking"/>
99             <field name="domain" eval="[('picking_type_id.code','=','outgoing'), ('location_id.usage','=','internal'), ('location_dest_id.usage', '!=', 'internal')]"/>
100             <field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
101             <field name="help" type="html">
102               <p class="oe_view_nocontent_create">
103                 Click to add a delivery order for this product.
104               </p><p>
105                 Here you will find the history of all past deliveries related to
106                 this product, as well as all the products you must deliver to
107                 customers.
108               </p>
109             </field>
110         </record>
111
112         <record model="ir.ui.view" id="product_kanban_stock_view">
113             <field name="name">Product Kanban Stock</field>
114             <field name="model">product.product</field>
115             <field name="inherit_id" ref="product.product_kanban_view"/>
116             <field name="arch" type="xml">
117                 <field name="list_price" position="after">
118                     <field name="reception_count"/>
119                     <field name="delivery_count"/>
120                 </field>
121                 <xpath expr="//div[@name='tags']" position="inside">
122                     <a name="%(action_receive_move)d" type="action" t-if="record.reception_count.raw_value&gt;1">
123                         <t t-esc="record.reception_count.value"/> Receptions
124                     </a>
125                     <a name="%(action_receive_move)d" type="action" t-if="record.reception_count.raw_value==1">
126                         <t t-esc="record.reception_count.value"/> Reception
127                     </a>
128                     <a name="%(action_deliver_move)d" type="action" t-if="record.delivery_count.raw_value&gt;1">
129                         <t t-esc="record.delivery_count.value"/> Deliveries
130                     </a>
131                     <a name="%(action_deliver_move)d" type="action" t-if="record.delivery_count.raw_value==1">
132                         <t t-esc="record.delivery_count.value"/> Delivery
133                     </a>
134                 </xpath>
135                 <ul position="inside">
136                     <li t-if="record.type.raw_value != 'service'">On hand: <field name="qty_available"/> <field name="uom_id"/></li>
137                     <li t-if="record.type.raw_value != 'service'">Forecasted: <field name="virtual_available"/> <field name="uom_id"/></li>
138                 </ul>
139             </field>
140         </record>
141
142     </data>
143 </openerp>