e3612010a805e9f6335c92a76d074f82272e0cf2
[odoo/odoo.git] / addons / stock / product_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <record id="view_stock_product_tree" model="ir.ui.view">
6             <field name="name">product.stock.tree.inherit</field>
7             <field name="model">product.product</field>
8             <field name="inherit_id" ref="product.product_product_tree_view"/>
9             <field name="arch" type="xml">
10                 <tree position="attributes">
11                     <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>
12                 </tree>
13                 <field name="price" position="after">
14                     <field name="qty_available"/>
15                     <field name="virtual_available"/>
16                 </field>
17             </field>
18         </record>
19
20         <record id="view_stock_product_template_tree" model="ir.ui.view">
21             <field name="name">product.template.stock.tree.inherit</field>
22             <field name="model">product.template</field>
23             <field name="inherit_id" ref="product.product_template_tree_view"/>
24             <field name="arch" type="xml">
25                 <tree position="attributes">
26                     <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>
27                 </tree>
28                 <field name="uom_id" position="after">
29                     <field name="qty_available"/>
30                     <field name="virtual_available"/>
31                 </field>
32             </field>
33         </record>
34
35
36         <record id="action_receive_move" model="ir.actions.act_window">
37             <field name="name">Receipts</field>
38             <field name="res_model">stock.move</field>
39             <field name="type">ir.actions.act_window</field>
40             <field name="view_type">form</field>
41             <field name="view_mode">tree,form</field>
42             <field name="domain" eval="[('picking_id.picking_type_id.code','=','incoming'), ('location_id.usage','!=','internal'), ('location_dest_id.usage', '=', 'internal')]"/>
43             <field name="view_id" ref="view_move_tree_receipt_picking"/>
44             <field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
45             <field name="help" type="html">
46               <p class="oe_view_nocontent_create">
47                 Click to register a receipt for this product.
48               </p><p>
49                 Here you will find the history of all receipts related to
50                 this product, as well as all future receipts you are waiting
51                 from your suppliers.
52               </p>
53             </field>
54         </record>
55
56         <record id="action_deliver_move" model="ir.actions.act_window">
57             <field name="name">Deliveries</field>
58             <field name="res_model">stock.move</field>
59             <field name="type">ir.actions.act_window</field>
60             <field name="view_type">form</field>
61             <field name="view_mode">tree,form</field>
62             <field name="view_id" ref="view_move_tree_receipt_picking"/>
63             <field name="domain" eval="[('picking_type_id.code','=','outgoing'), ('location_id.usage','=','internal'), ('location_dest_id.usage', '!=', 'internal')]"/>
64             <field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
65             <field name="help" type="html">
66               <p class="oe_view_nocontent_create">
67                 Click to add a delivery order for this product.
68               </p><p>
69                 Here you will find the history of all past deliveries related to
70                 this product, as well as all the products you must deliver to
71                 customers.
72               </p>
73             </field>
74         </record>
75
76         <!-- Product Template -->
77
78         <record id="product_template_search_form_view_stock" model="ir.ui.view">
79             <field name="name">product.template.search.stock.form</field>
80             <field name="model">product.template</field>
81             <field name="inherit_id" ref="product.product_template_search_view"/>
82             <field name="arch" type="xml">
83                 <field name="product_variant_ids" position="before">
84                     <separator/>
85                     <filter name="real_stock_available" string="Available Products" domain="[('qty_available','&gt;',0)]"/>
86                     <filter name="virtual_stock_available" string="Forecast Available Products" domain="[('virtual_available','&gt;',0)]"/>
87                     <filter name="real_stock_exhausted" string="Exhausted Stock" domain="[('qty_available','&lt;=',0)]"/>
88                     <filter name="virtual_stock_exhausted" string="Forecast Exhausted Stock" domain="[('virtual_available','&lt;=',0)]"/>
89                     <filter name="real_stock_negative" string="Negative Stock" domain="[('qty_available','&lt;',0)]"/>
90                     <filter name="virtual_stock_negative" string="Forecast Negative Stock" domain="[('virtual_available','&lt;',0)]"/>
91                 </field>
92                 <filter name="consumable" position="before">
93                    <filter string="Products" icon="terp-accessories-archiver" domain="[('type','=','product')]" help="Stockable products"/>
94                 </filter>
95             </field>
96         </record>
97
98         <record id="view_template_property_form" model="ir.ui.view">
99             <field name="name">product.template.stock.property.form.inherit</field>
100             <field name="model">product.template</field>
101             <field name="inherit_id" ref="product.product_template_form_view"/>
102             <field name="arch" type="xml">
103                 <group name="sale_condition" position="inside">
104                     <label for="sale_delay"/>
105                     <div>
106                         <field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
107                     </div>
108                 </group>
109                 <group name="status" position="before">
110                     <group string="Stock and Expected Variations" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
111                         <label for="qty_available"/>
112                             <div>
113                                 <field name="qty_available" class="oe_inline"/>
114                                 <button name="%(action_view_change_product_quantity)d" string="⇒ Update"
115                                     type="action"
116                                     class="oe_link"/>
117                             </div>
118                         <label for="incoming_qty"/>
119                             <div>
120                                 <field name="incoming_qty" class="oe_inline"/>
121                                 <button string="⇒ Request Procurement" name="%(stock.act_make_procurement)d" type="action" class="oe_link"/>
122                             </div>
123                         <field name="virtual_available"/>
124                     </group>
125                 </group>
126                 <group name="status" position="after">
127                     <group name="store" string="Storage Location" attrs="{'invisible':[('type','=','service')]}">
128                         <field name="loc_rack"/>
129                         <field name="loc_row"/>
130                         <field name="loc_case"/>
131                     </group>
132                 </group>
133                 <group name="status" position="before">
134                     <group name="lot" groups="stock.group_production_lot" string="Lots" attrs="{'invisible':[('type','=','service')]}">
135                         <field name="track_all" groups="stock.group_production_lot"/>
136                         <field name="track_incoming" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
137                         <field name="track_outgoing" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
138                     </group>
139                 </group>
140                 <group name="weight" position="before">
141                     <group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties" attrs="{'invisible':[('type','=','service')]}">
142                         <field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
143                         <field name="property_stock_production" domain="[('usage','=','production')]"/>
144                         <field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
145                     </group>
146                 </group>
147                 <field name="product_manager" position="attributes">
148                     <attribute name="context">{'default_groups_ref': ['base.group_user', 'base.group_sale_manager', 'stock.group_stock_manager']}</attribute>
149                 </field>
150                 <group name="procurement_uom" position="after" >
151                    <group string="Supply Chain Information" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
152                        <field name="route_ids" widget="many2many_checkboxes"/>
153                    </group>
154                 </group>
155             </field>
156         </record>
157
158
159
160         <record model="ir.ui.view" id="product_template_kanban_stock_view">
161             <field name="name">Product Template Kanban Stock</field>
162             <field name="model">product.template</field>
163             <field name="inherit_id" ref="product.product_template_kanban_view"/>
164             <field name="arch" type="xml">
165                 <field name="lst_price" position="after">
166                     <field name="type"/>
167                 </field>
168                 <ul position="inside">
169                     <li t-if="record.type.raw_value != 'service'">On hand: <field name="qty_available"/> <field name="uom_id"/></li>
170                     <li t-if="record.type.raw_value != 'service'">Forecasted: <field name="virtual_available"/> <field name="uom_id"/></li>
171                 </ul>
172             </field>
173         </record>
174
175         <!-- Product Variant -->
176
177         <record id="product_search_form_view_stock" model="ir.ui.view">
178             <field name="name">product.search.stock.form</field>
179             <field name="model">product.product</field>
180             <field name="inherit_id" ref="product.product_search_form_view"/>
181             <field name="arch" type="xml">
182                 <field name="pricelist_id" position="before">
183                     <field name="location_id" widget="selection" context="{'location': self}"/>
184                     <field name="warehouse_id" widget="selection" context="{'warehouse': self}"/>
185                 </field>
186             </field>
187         </record>
188
189         <record model="ir.ui.view" id="product_kanban_stock_view">
190             <field name="name">Product Kanban Stock</field>
191             <field name="model">product.product</field>
192             <field name="inherit_id" ref="product.product_kanban_view"/>
193             <field name="arch" type="xml">
194                 <field name="lst_price" position="after">
195                     <field name="reception_count"/>
196                     <field name="delivery_count"/>
197                 </field>
198                 <xpath expr="//div[@name='tags']" position="inside">
199                     <a name="%(action_receive_move)d" type="action" t-if="record.reception_count.raw_value&gt;1">
200                         <t t-esc="record.reception_count.value"/> Receipts
201                     </a>
202                     <a name="%(action_receive_move)d" type="action" t-if="record.reception_count.raw_value==1">
203                         <t t-esc="record.reception_count.value"/> Receipt
204                     </a>
205                     <a name="%(action_deliver_move)d" type="action" t-if="record.delivery_count.raw_value&gt;1">
206                         <t t-esc="record.delivery_count.value"/> Deliveries
207                     </a>
208                     <a name="%(action_deliver_move)d" type="action" t-if="record.delivery_count.raw_value==1">
209                         <t t-esc="record.delivery_count.value"/> Delivery
210                     </a>
211                 </xpath>
212             </field>
213         </record>
214
215         <record model="ir.ui.view" id="product_form_view_procurement_button">
216             <field name="name">product.product.procurement</field>
217             <field name="model">product.product</field>
218             <field name="inherit_id" ref="product.product_normal_form_view"/>
219             <field name="arch" type="xml">
220                 <xpath expr="//div[@name='buttons']" position="inside">
221                    <button class="oe_stat_button"
222                            name="%(product_open_quants)d"
223                            icon="fa-building-o"
224                            type="action"  attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations">
225                     <div><field name="qty_available_text"/></div>
226                     </button>
227                    <button class="oe_inline oe_stat_button" string="Moves" name= "%(act_product_stock_move_open)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_stock_user" icon="fa-arrows-v"/>
228                    <button class="oe_inline oe_stat_button" name="%(product_open_orderpoint)d" type="action" 
229                         attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-refresh" string="Reordering Rules"/>
230                    <button class="oe_inline oe_stat_button" name="action_view_routes" string="Routes" type="object" icon="fa-cogs" attrs="{'invisible':[('type', '=', 'service')]}" />
231                 </xpath>
232             </field>
233         </record>
234         
235         <record model="ir.ui.view" id="product_template_form_view_procurement_button">
236             <field name="name">product.template_procurement</field>
237             <field name="model">product.template</field>
238             <field name="inherit_id" ref="product.product_template_only_form_view"/>
239             <field name="arch" type="xml">
240                 <xpath expr="//div[@name='buttons']" position="inside">
241                    <button class="oe_stat_button"
242                            name="action_open_quants"
243                            icon="fa-building-o"
244                            type="object"  attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations">
245                    <div><field name="qty_available_text"/></div>
246                    </button>
247                    <button class="oe_inline oe_stat_button" string="Moves" name= "action_view_stock_moves" type="object" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_stock_user" icon="fa-arrows-v"/>
248                    <button class="oe_inline oe_stat_button" name="action_view_orderpoints" type="object" 
249                         attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-refresh" string="Reordering Rules"/>
250                    <button class="oe_inline oe_stat_button" name="action_view_routes" string="Routes" type="object" icon="fa-cogs" attrs="{'invisible':[('type', '=', 'service')]}" />
251                 </xpath>
252             </field>
253         </record>
254     </data>
255 </openerp>