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