[IMP] website theme: update themes to fix CSS glitches, add Yeti theme, fix Default...
[odoo/odoo.git] / addons / procurement / procurement_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <!--
5         Procurement
6         -->
7
8
9         <record id="procurement_tree_view" model="ir.ui.view">
10             <field name="name">procurement.order.tree</field>
11             <field name="model">procurement.order</field>
12             <field name="arch" type="xml">
13                 <tree string="Procurement Lines" colors="red:date_planned&lt;current_date and state == 'exception';black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state == 'ready'">
14                     <field name="date_planned" widget="date"/>
15                     <field name="origin"/>
16                     <field name="product_id"/>
17                     <field name="product_qty"/>
18                     <field name="product_uom" string="Unit of Measure"/>
19                     <field name="procure_method"/>
20                     <field name="state"/>
21                     <field name="name" invisible="1"/>
22                     <field name="message"/>
23                 </tree>
24             </field>
25         </record>
26          <record id="procurement_tree_view_board" model="ir.ui.view">
27             <field name="name">procurement.order.tree.board</field>
28             <field name="model">procurement.order</field>
29             <field eval="20" name="priority"/>
30             <field name="arch" type="xml">
31                 <tree string="Procurement Lines" colors="red:date_planned&lt;current_date and state == 'exception';black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state == 'ready'">
32                     <field name="date_planned" widget="date"/>
33                     <field name="origin"/>
34                     <field name="product_id"/>
35                     <field name="product_qty"/>
36                     <field name="product_uom" string="Unit of Measure"/>
37                     <field name="state" invisible = "1"/>
38                     <field name="message"/>
39                 </tree>
40             </field>
41         </record>
42         <record id="procurement_form_view" model="ir.ui.view">
43             <field name="name">procurement.order.form</field>
44             <field name="model">procurement.order</field>
45             <field name="arch" type="xml">
46                 <form string="Procurement" version="7.0">
47                     <header>
48                         <button name="button_confirm" states="draft" string="Confirm" class="oe_highlight"/>
49                         <button name="button_check" states="confirmed" string="Run Procurement" class="oe_highlight"/>
50                         <button name="button_restart" states="exception" string="Retry" class="oe_highlight"/>
51                         <button name="button_cancel" states="draft,exception,waiting" string="Cancel Procurement"/>
52                         <field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed" />
53                     </header>
54                     <sheet>
55                     <label for="product_id" class="oe_edit_only"/>
56                     <h1>
57                         <field name="product_id" on_change="onchange_product_id(product_id)"/>
58                     </h1>
59                     <label for="product_qty" class="oe_edit_only"/>
60                     <h2>
61                         <div>
62                             <field name="product_qty" class="oe_inline"/>
63                             <field name="product_uom" class="oe_inline" groups="product.group_uom"/>
64                         </div>
65                     </h2>
66                     <field name="name" placeholder="External note..."/>
67                     <group>
68                         <group>
69                             <field name="date_planned"/>
70                             <field name="procure_method"/>
71                             <field name="priority"/>
72                         </group>
73                         <group>
74                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
75                             <field name="origin" class="oe_inline" placeholder="e.g. SO005"/>
76                             <field name="message"/>
77                         </group>
78                     </group>
79                     <notebook>
80                         <page string="Extra Information">
81                             <group>
82                                 <label for="product_uos_qty" groups="product.group_uos"/>
83                                 <div groups="product.group_uos">
84                                     <field name="product_uos_qty" class="oe_inline"/>
85                                     <field name="product_uos" class="oe_inline"/>
86                                 </div>
87                                 <field name="location_id" domain="[('usage','=','internal')]"/>
88                             </group>
89                             <group>
90                                 <field name="move_id"/>
91                                 <field name="date_close"/>
92                                 <field name="close_move"/>
93                             </group>
94                             <field name="note" placeholder="Internal note..."/>
95                         </page>
96                     </notebook>
97                     </sheet>
98                     <div class="oe_chatter">
99                         <field name="message_follower_ids" widget="mail_followers"/>
100                         <field name="message_ids" widget="mail_thread"/>
101                     </div>
102                 </form>
103             </field>
104         </record>
105         <record id="view_procurement_filter" model="ir.ui.view">
106             <field name="name">procurement.order.select</field>
107             <field name="model">procurement.order</field>
108             <field name="arch" type="xml">
109                 <search string="Search Procurement">
110                     <field name="origin" string="Procurement"/>
111                     <field name="date_planned"/>
112                     <filter icon="terp-emblem-important" string="Exceptions" name="exceptions" domain="[('state','=','exception')]" help="Procurement Exceptions"/>
113                     <separator/>
114                     <filter icon="terp-emblem-important" string="To Fix" name="perm_exceptions" domain="[('state','=','exception'),('message', '!=', '')]" help="Permanent Procurement Exceptions"/>
115                     <filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
116                     <separator/>
117                     <filter icon="terp-gnome-cpu-frequency-applet+" string="Late" domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]" help="Procurement started late" />
118                     <field name="product_id" />
119                     <field name="state" />
120                     <group expand="0" string="Group By">
121                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
122                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
123                         <filter string="Scheduled Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
124                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
125                     </group>
126                 </search>
127             </field>
128         </record>
129
130         <record id="procurement_action" model="ir.actions.act_window">
131             <field name="name">Procurement Orders</field>
132             <field name="type">ir.actions.act_window</field>
133             <field name="res_model">procurement.order</field>
134             <field name="view_type">form</field>
135             <field name="view_id" eval="False"/>
136             <field name="search_view_id" ref="view_procurement_filter"/>
137             <field name="context">{'search_default_current':1}</field>
138             <field name="help" type="html">
139               <p class="oe_view_nocontent_create">
140                 Click to create a procurement order. 
141               </p><p>
142                 A procurement order is used to record a need for a specific
143                 product at a specific location.  Procurement orders are usually
144                 created automatically from sales orders, pull logistic rules or
145                 minimum stock rules.
146               </p><p>
147                 When the procurement order is confirmed, it automatically
148                 creates the necessary operations to fullfil the need: purchase
149                 order proposition, manufacturing order, etc.
150               </p>
151             </field>
152         </record>
153
154         <record id="procurement_exceptions" model="ir.actions.act_window">
155             <field name="name">Procurement Exceptions</field>
156             <field name="type">ir.actions.act_window</field>
157             <field name="res_model">procurement.order</field>
158             <field name="view_type">form</field>
159             <field name="view_mode">tree,form</field>
160             <field name="context">{'search_default_perm_exceptions':1}</field>
161             <field name="search_view_id" ref="view_procurement_filter"/>
162             <field name="help" type="html">
163                 <p>
164                 Procurement Orders represent the need for a certain quantity of products, at a given time, in a given location. Sales Orders are one typical source of Procurement Orders (but these are distinct documents). Depending on the procurement parameters and the product configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, ordering products from a supplier, or passing a manufacturing order, etc. A Procurement Exception occurs when the system cannot find a way to fulfill a procurement. Some exceptions will resolve themselves automatically, but others require manual intervention (those are identified by a specific error message).
165                 </p>
166             </field>
167         </record>
168
169         <record id="procurement_action5" model="ir.actions.act_window">
170             <field name="name">Procurement Exceptions</field>
171             <field name="type">ir.actions.act_window</field>
172             <field name="res_model">procurement.order</field>
173             <field name="view_type">form</field>
174             <field name="view_mode">tree,form</field>
175             <field name="domain">[('state','=','exception')]</field>
176         </record>
177
178         <!-- Order Point -->
179         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
180             <field name="name">stock.warehouse.orderpoint.tree</field>
181             <field name="model">stock.warehouse.orderpoint</field>
182             <field name="arch" type="xml">
183                 <tree string="Reordering Rules">
184                     <field name="name"/>
185                     <field name="warehouse_id" groups="stock.group_locations"/>
186                     <field name="location_id" groups="stock.group_locations"/>
187                     <field name="product_id"/>
188                     <field name="product_uom" groups="product.group_uom"/>
189                     <field name="product_min_qty"/>
190                     <field name="product_max_qty"/>
191                 </tree>
192             </field>
193         </record>
194
195         <record model="ir.ui.view" id="warehouse_orderpoint_search">
196             <field name="name">stock.warehouse.orderpoint.search</field>
197             <field name="model">stock.warehouse.orderpoint</field>
198             <field name="arch" type="xml">
199                 <search string="Reordering Rules Search">
200                     <field name="name" string="Reordering Rules"/>
201                     <field name="warehouse_id"/>
202                     <field name="location_id" groups="stock.group_locations"/>
203                     <field name="company_id" groups="base.group_multi_company"/>
204                     <field name="product_id"/>
205                     <group expand="0" string="Group By...">
206                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
207                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
208                     </group>
209                 </search>
210             </field>
211         </record>
212
213         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
214             <field name="name">stock.warehouse.orderpoint.form</field>
215             <field name="model">stock.warehouse.orderpoint</field>
216             <field name="arch" type="xml">
217                 <form string="Reordering Rules" version="7.0">
218                     <sheet>
219                         <group>
220                             <group>
221                                 <field name="name" />
222                                 <field name="product_id" on_change="onchange_product_id(product_id)"/>
223                             </group>
224                             <group>
225                                 <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
226                                 <field name="product_uom" groups="product.group_uom"/>
227                                 <field name="location_id" groups="stock.group_locations"/>
228                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
229                             </group>
230                         </group>
231                         <group>
232                             <group string="Rules">
233                                 <field name="product_min_qty" />
234                                 <field name="product_max_qty" />
235                                 <field name="qty_multiple" string="Quantity Multiple"/>
236                             </group>
237                             <group string="Misc">
238                                 <field name="procurement_id" readonly="1"/>
239                                 <field name="active" />
240                             </group>
241                         </group>
242                         <group string="Procurement Orders to Process">
243                             <field name="procurement_draft_ids" nolabel="1"/>
244                         </group>
245                     </sheet>
246                 </form>
247             </field>
248         </record>
249
250         <record id="action_orderpoint_form" model="ir.actions.act_window">
251             <field name="name">Reordering Rules</field>
252             <field name="res_model">stock.warehouse.orderpoint</field>
253             <field name="type">ir.actions.act_window</field>
254             <field name="view_type">form</field>
255             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
256             <field name="search_view_id" ref="warehouse_orderpoint_search" />
257             <field name="help" type="html">
258               <p class="oe_view_nocontent_create">
259                 Click to add a reordering rule.
260               </p><p>You can define your minimum stock rules, so that OpenERP will automatically create draft manufacturing orders or request for quotations according to the stock level. Once the virtual stock of a product (= stock on hand minus all confirmed orders and reservations) is below the minimum quantity, OpenERP will generate a procurement request to increase the stock up to the maximum quantity.</p>
261             </field>
262         </record>
263
264         <act_window
265             context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
266             id="act_stock_warehouse_2_stock_warehouse_orderpoint"
267             name="Reordering Rules"
268             res_model="stock.warehouse.orderpoint"
269             src_model="stock.warehouse"
270             groups="stock.group_stock_user"/>
271
272         <act_window
273             context="{'product_uom': locals().has_key('uom_id') and uom_id, 'default_procurement_id': active_id}"
274             id="act_procurement_2_stock_warehouse_orderpoint"
275             name="Reordering Rules"
276             res_model="stock.warehouse.orderpoint"
277             src_model="procurement.order"
278             groups="stock.group_stock_user"/>
279
280         <!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it.  -->
281         <menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4" groups="stock.group_stock_manager"/>
282             <menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
283             <menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
284         <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
285             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="stock.menu_stock_configuration" sequence="10"/>
286
287
288         <record model="ir.actions.act_window" id="product_open_orderpoint">
289             <field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
290             <field name="name">Orderpoints</field>
291             <field name="res_model">stock.warehouse.orderpoint</field>
292         </record>
293
294         <record id="product_template_search_view_procurment" model="ir.ui.view">
295             <field name="name">product.template.search.procurement</field>
296             <field name="model">product.template</field>
297             <field name="inherit_id" ref="product.product_template_search_view"/>
298             <field name="arch" type="xml">
299                 <filter name="consumable" position="before">
300                     <filter string="Products" icon="terp-accessories-archiver" domain="[('type','=','product')]" help="Stockable products"/>
301                 </filter>
302             </field>
303         </record>
304
305         <record model="ir.ui.view" id="product_template_form_view_procurement">
306             <field name="name">product.template.procurement</field>
307             <field name="model">product.template</field>
308             <field name="inherit_id" ref="product.product_template_form_view"/>
309             <field name="arch" type="xml">
310                 <xpath expr="//field[@name='cost_method']" position="before">
311                     <field name="procure_method"/>
312                     <field name="supply_method"/>
313                 </xpath>
314                 <xpath expr="//group[@name='general']" position="after" >
315                     <group name="procurement_help" class="oe_grey" col="1" groups="base.group_user">
316                         <p attrs="{'invisible': ['|', '|', ('type', '!=', 'service'), ('procure_method', '!=', 'make_to_stock')]}">
317                             When you sell this service, nothing special will be triggered
318                             to deliver the customer, as you set the procurement method as
319                             'Make to Stock'.
320                         </p>
321                         <p attrs="{'invisible': ['|', '|', ('type', '!=', 'product'), ('procure_method', '!=', 'make_to_stock')]}">
322                             When you sell this product, OpenERP will <b>use the available
323                             inventory</b> for the delivery order.
324                             <br/><br/>
325                             If there are not enough quantities available, the delivery order
326                             will wait for new products. To fulfill the inventory, you should
327                             create others rules like orderpoints.
328                         </p>
329                         <p attrs="{'invisible': ['|', '|', ('type', '!=', 'consu'), ('procure_method', '!=', 'make_to_stock')]}">
330                             When you sell this product, a delivery order will be created.
331                             OpenERP will consider that the <b>required quantities are always
332                             available</b> as it's a consumable (as a result of this, the quantity
333                             on hand may become negative).
334                         </p>
335                     </group>
336                 </xpath>
337             </field>
338         </record>
339
340         <record id="product_search_form_view_procurment" model="ir.ui.view">
341             <field name="name">product.search.procurment.form</field>
342             <field name="model">product.product</field>
343             <field name="inherit_id" ref="product.product_search_form_view"/>
344             <field name="arch" type="xml">
345                 <filter name="consumable" position="before">
346                    <filter string="Products" icon="terp-accessories-archiver" domain="[('type','=','product')]" help="Stockable products"/>
347                 </filter>
348             </field>
349         </record>
350
351         <record model="ir.ui.view" id="product_form_view_procurement_button">
352             <field name="name">product.product.procurement</field>
353             <field name="model">product.product</field>
354             <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
355             <field name="arch" type="xml">
356                 <xpath expr="//field[@name='incoming_qty']" position="after">
357                     <button string="⇒ Request Procurement" name="%(act_make_procurement)d" type="action" class="oe_link"/>
358                 </xpath>
359                 <xpath expr="//div[@name='buttons']" position="inside">
360                     <button string="Orderpoints" name="%(product_open_orderpoint)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}"/>
361                 </xpath>
362                 <xpath expr="//field[@name='cost_method']" position="before">
363                     <field name="procure_method" groups="base.group_user"
364                         attrs="{'readonly': [('is_only_child', '=', False)]}"/>
365                     <field name="supply_method" groups="base.group_user"
366                         attrs="{'readonly': [('is_only_child', '=', False)]}"/> 
367                 </xpath>
368                 <xpath expr="//group[@name='general']" position="after" >
369                    <group name="procurement_help" class="oe_grey" col="1" groups="base.group_user">
370                        <p attrs="{'invisible': ['|','|',('type','&lt;&gt;','service'),('procure_method','&lt;&gt;','make_to_stock')]}">
371                            When you sell this service, nothing special will be triggered
372                            to deliver the customer, as you set the procurement method as
373                            'Make to Stock'.
374                        </p>
375                        <p attrs="{'invisible': ['|','|',('type','&lt;&gt;','product'),('procure_method','&lt;&gt;','make_to_stock')]}">
376                            When you sell this product, OpenERP will <b>use the available
377                            inventory</b> for the delivery order.
378                            <br/><br/>
379                            If there are not enough quantities available, the delivery order
380                            will wait for new products. To fulfill the inventory, you should
381                            create others rules like orderpoints.
382                        </p>
383                        <p attrs="{'invisible': ['|','|',('type','&lt;&gt;','consu'),('procure_method','&lt;&gt;','make_to_stock')]}">
384                            When you sell this product, a delivery order will be created.
385                            OpenERP will consider that the <b>required quantities are always
386                            available</b> as it's a consumable (as a result of this, the quantity
387                            on hand may become negative).
388                        </p>
389                    </group>
390                 </xpath>
391             </field>
392         </record>
393
394     </data>
395 </openerp>