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