[IMP]: stock, mrp: Changed logic of track lots, Improvement in functions of split...
[odoo/odoo.git] / addons / mrp / mrp_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <menuitem icon="terp-mrp" id="menu_mrp_root" name="Manufacturing"
6             groups="group_mrp_user,group_mrp_manager" sequence="3"/>
7         <menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="4"/>
8                 <menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="menu_mrp_root" sequence="1"/>
9
10         <menuitem name="Control" id="menu_mrp_control" parent="menu_mrp_root"  sequence="3" />
11         <menuitem name="Master Data"
12                   id="menu_mrp_bom"
13                   parent="menu_mrp_root"
14                   sequence="5" />
15         <!--
16         Property / Property Group
17         -->
18
19         <record id="mrp_property_group_form_view" model="ir.ui.view">
20             <field name="name">mrp.property.group.form</field>
21             <field name="model">mrp.property.group</field>
22             <field name="type">form</field>
23             <field name="arch" type="xml">
24                 <form string="Properties categories">
25                     <separator colspan="4" string="General Information"/>
26                     <field colspan="4" name="name" select="1"/>
27                     <field colspan="4" name="description"/>
28                 </form>
29             </field>
30         </record>
31         <record id="mrp_property_group_action" model="ir.actions.act_window">
32             <field name="name">Property Categories</field>
33             <field name="type">ir.actions.act_window</field>
34             <field name="res_model">mrp.property.group</field>
35             <field name="view_type">form</field>
36             <field name="view_mode">tree,form</field>
37         </record>
38         <menuitem
39             id="menu_mrp_configuration"
40             name="Configuration"
41             parent="menu_mrp_root"
42             groups="group_mrp_manager"
43             sequence="50" />
44
45         <record id="mrp_property_tree_view" model="ir.ui.view">
46             <field name="name">mrp.property.tree</field>
47             <field name="model">mrp.property</field>
48             <field name="type">tree</field>
49             <field name="arch" type="xml">
50                 <tree string="Properties">
51                     <field name="name"/>
52                     <field name="composition"/>
53                     <field name="group_id"/>
54                 </tree>
55             </field>
56         </record>
57         <record id="mrp_property_form_view" model="ir.ui.view">
58             <field name="name">mrp.property.form</field>
59             <field name="model">mrp.property</field>
60             <field name="type">form</field>
61             <field name="arch" type="xml">
62                 <form string="Properties">
63                     <separator colspan="4" string="General Information"/>
64                     <field colspan="4" name="name" select="1"/>
65                     <field name="group_id" select="1"/>
66                     <field name="composition" select="1"/>
67                     <separator colspan="4" string="Description"/>
68                     <field colspan="4" name="description"/>
69                 </form>
70             </field>
71         </record>
72         <record id="mrp_property_action" model="ir.actions.act_window">
73             <field name="name">Properties</field>
74             <field name="type">ir.actions.act_window</field>
75             <field name="res_model">mrp.property</field>
76             <field name="view_type">form</field>
77             <field name="view_mode">tree,form</field>
78         </record>
79         <menuitem name="Properties"
80             id="menu_mrp_property"
81             parent="menu_mrp_configuration"
82             groups="base.group_extended"
83             sequence="20" />
84         <menuitem
85             action="mrp_property_action"
86             id="menu_mrp_property_action"
87             parent="menu_mrp_property"
88             groups="base.group_extended" />
89         <menuitem
90             action="mrp_property_group_action"
91             id="menu_mrp_property_group_action"
92             parent="menu_mrp_property"/>
93
94         <!--
95         Work Centers
96         -->
97
98         <record id="mrp_workcenter_tree_view" model="ir.ui.view">
99             <field name="name">mrp.workcenter.tree</field>
100             <field name="model">mrp.workcenter</field>
101             <field name="type">tree</field>
102             <field name="arch" type="xml">
103                 <tree string="Work Center">
104                     <field name="code"/>
105                     <field name="name"/>
106                 </tree>
107             </field>
108         </record>
109         <record id="mrp_workcenter_view" model="ir.ui.view">
110             <field name="name">mrp.workcenter.form</field>
111             <field name="model">mrp.workcenter</field>
112             <field name="type">form</field>
113             <field name="arch" type="xml">
114                 <form string="Work Center">
115                     <group col="6" colspan="4">
116                         <field name="name" select="1"/>
117                         <field name="code" select="1"/>
118                         <field name="active" select="2"/>
119                         <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
120                     </group>
121                     <notebook colspan="4">
122                         <page string="Work Center">
123                             <field name="resource_type"/>
124                             <field name="calendar_id"/>
125                             <separator colspan="4" string="Description"/>
126                             <field colspan="4" name="note" nolabel="1"/>
127                             <separator colspan="4" string="Capacity Information"/>
128                             <group col="4" colspan="4">
129                                 <field name="capacity_per_cycle"/>
130                                 <newline/>
131                                 <field name="time_cycle"/>
132                                 <field name="time_efficiency"/>
133                                 <field name="time_start"/>
134                                 <field name="time_stop"/>
135                             </group>
136                         </page>
137                         <page string="Analytic Accounting">
138                             <field name="costs_hour"/>
139                             <field name="costs_hour_account_id"/>
140                             <field name="costs_cycle"/>
141                             <field name="costs_cycle_account_id"/>
142                             <field name="costs_journal_id"/>
143                             <field name="costs_general_account_id"/>
144                         </page>
145                     </notebook>
146                 </form>
147             </field>
148         </record>
149         <record id="mrp_workcenter_action" model="ir.actions.act_window">
150             <field name="name">Work Centers</field>
151             <field name="type">ir.actions.act_window</field>
152             <field name="res_model">mrp.workcenter</field>
153             <field name="view_type">form</field>
154             <field name="view_id" ref="mrp_workcenter_tree_view"/>
155         </record>
156
157         <!--
158         Routings
159         -->
160
161         <record id="mrp_routing_workcenter_tree_view" model="ir.ui.view">
162             <field name="name">mrp.routing.workcenter.tree</field>
163             <field name="model">mrp.routing.workcenter</field>
164             <field name="type">tree</field>
165             <field name="arch" type="xml">
166                 <tree string="Routing Work Centers">
167                     <field name="sequence"/>
168                     <field name="workcenter_id" select="1"/>
169                     <field name="cycle_nbr"/>
170                     <field name="hour_nbr"/>
171                 </tree>
172             </field>
173         </record>
174
175         <record id="mrp_routing_workcenter_form_view" model="ir.ui.view">
176             <field name="name">mrp.routing.workcenter.form</field>
177             <field name="model">mrp.routing.workcenter</field>
178             <field name="type">form</field>
179             <field name="arch" type="xml">
180                 <form string="Routing Work Centers">
181                     <separator colspan="4" string="General Information"/>
182                     <field colspan="4" name="name" select="1"/>
183                     <field name="sequence" select="1"/>
184                     <field name="workcenter_id" select="1"/>
185                     <field name="cycle_nbr"/>
186                     <field name="hour_nbr"/>
187                     <field colspan="4" name="note"/>
188                 </form>
189             </field>
190         </record>
191
192         <record id="mrp_routing_form_view" model="ir.ui.view">
193             <field name="name">mrp.routing.form</field>
194             <field name="model">mrp.routing</field>
195             <field name="type">form</field>
196             <field name="arch" type="xml">
197                 <form string="Routing">
198                     <separator colspan="4" string="General Information"/>
199                     <field name="name" select="1"/>
200                     <field name="active" select="1"/>
201                     <field name="code" select="1"/>
202                     <field name="location_id"/>
203                     <separator colspan="4" string="Description"/>
204                     <field colspan="4" name="note" nolabel="1"/>
205                     <separator colspan="4" string="Work Center Operations"/>
206                     <field colspan="4" name="workcenter_lines" nolabel="1" widget="one2many_list"/>
207                 </form>
208             </field>
209         </record>
210         <record id="mrp_routing_tree_view" model="ir.ui.view">
211             <field name="name">mrp.routing.tree</field>
212             <field name="model">mrp.routing</field>
213             <field name="type">tree</field>
214             <field name="arch" type="xml">
215                 <tree string="Routing">
216                     <field name="code"/>
217                     <field name="name"/>
218                     <field name="location_id"/>
219                 </tree>
220             </field>
221         </record>
222         <record id="mrp_routing_action" model="ir.actions.act_window">
223             <field name="name">Routings</field>
224             <field name="type">ir.actions.act_window</field>
225             <field name="res_model">mrp.routing</field>
226             <field name="view_type">form</field>
227             <field name="view_id" ref="mrp_routing_tree_view"/>
228         </record>
229  <!--       <menuitem name="Routings" id="menu_mrp_routing_and_workcenters" parent="mrp.menu_mrp_bom" groups="base.group_extended"
230                   sequence="100" />-->
231         <menuitem action="mrp_workcenter_action" id="menu_mrp_workcenter_action" parent="mrp.menu_mrp_bom" groups="base.group_extended" sequence="40" />
232         <menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_bom" groups="base.group_extended" sequence="30"/>
233
234         <!--
235           Bill of Materials
236         -->
237
238         <record id="mrp_bom_form_view" model="ir.ui.view">
239             <field name="name">mrp.bom.form</field>
240             <field name="model">mrp.bom</field>
241             <field name="type">form</field>
242             <field name="arch" type="xml">
243                 <form string="Bill of Material">
244                     <group colspan="4" col="6">
245                       <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
246                       <field name="name" select="1"/>
247                       <field name="code" select="1"/>
248                       <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
249                     </group>
250                     <newline/>
251                     <field name="product_uom"/>
252                     <field name="product_qty"/>
253                     <newline/>
254                     <field name="product_uos" groups="product.group_uos"/>
255                     <field name="product_uos_qty" groups="product.group_uos"/>
256                     <field name="routing_id" select="2" groups="base.group_extended"/>
257                     <field name="type" groups="base.group_extended"/>
258                     <notebook colspan="4">
259                         <page string="General Information">
260                             <field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list"/>
261                         </page>
262                         <page string="Revisions" groups="base.group_extended">
263                             <field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
264                         </page>
265                         <page string="Properties">
266                             <field name="position" select="2"/>
267                             <field name="active" select="2"/>
268                             <field name="sequence"/>
269                             <field name="bom_id"/>
270
271                             <field name="date_start" select="2"/>
272                             <field name="date_stop" select="2"/>
273                             <field name="product_rounding"/>
274                             <field name="product_efficiency"/>
275                             <field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
276                         </page>
277                     </notebook>
278                 </form>
279             </field>
280         </record>
281
282        <record id="mrp_bom_tree_view" model="ir.ui.view">
283             <field name="name">mrp.bom.tree</field>
284             <field name="model">mrp.bom</field>
285             <field name="type">tree</field>
286             <field name="field_parent">child_complete_ids</field>
287             <field name="arch" type="xml">
288                 <tree string="BoM Structure" colors="blue:method">
289                     <field name="name"/>
290                     <field name="code"/>
291                     <field name="product_id"/>
292                     <field name="product_qty"/>
293                     <field name="product_uom"/>
294                     <field name="method"/>
295                     <field name="routing_id" groups="base.group_extended"/>
296                     <field name="date_start"/>
297                     <field name="date_stop"/>
298                 </tree>
299             </field>
300         </record>
301         <record id="mrp_bom_form_action" model="ir.actions.act_window">
302             <field name="name">Master Bill of Materials</field>
303             <field name="type">ir.actions.act_window</field>
304             <field name="res_model">mrp.bom</field>
305             <field name="view_type">form</field>
306             <field name="domain">[('bom_id','=',False)]</field>
307             <field name="view_id" ref="mrp_bom_tree_view"/>
308         </record>
309         <record id="mrp_bom_form_action2" model="ir.actions.act_window">
310             <field name="name">Bill of Material Components</field>
311             <field name="type">ir.actions.act_window</field>
312             <field name="res_model">mrp.bom</field>
313             <field name="view_type">form</field>
314             <field name="domain">[('bom_id','!=',False)]</field>
315         </record>
316
317         <!-- BOM menus -->
318
319   <!--      <menuitem name="Bill of Materials"
320                   id="menu_mrp_bom"
321                   parent="menu_mrp_bom"
322                   sequence="50" />-->
323         <menuitem action="mrp_bom_form_action"
324                   id="menu_mrp_bom_form_action"
325                   parent="menu_mrp_bom"
326                   sequence="10"/>
327         <menuitem action="mrp_bom_form_action2"
328                   id="menu_mrp_bom_form_action2"
329                   parent="menu_mrp_bom"
330                   sequence="20"/>
331
332         <record id="action2" model="ir.actions.act_window">
333             <field name="name">Bill of Materials Structure</field>
334             <field name="type">ir.actions.act_window</field>
335             <field name="res_model">mrp.bom</field>
336             <field name="domain">[('id','=',active_id)]</field>
337             <field name="view_type">tree</field>
338             <field name="view_id" ref="mrp_bom_tree_view"/>
339         </record>
340         <record id="ir_BOM_structure" model="ir.values">
341             <field eval="'client_action_multi'" name="key2"/>
342             <field eval="'mrp.bom'" name="model"/>
343             <field name="name">Bill of Materials Structure</field>
344             <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
345             <field eval="True" name="object"/>
346         </record>
347
348         <record id="mrp_bom_revision_tree" model="ir.ui.view">
349             <field name="name">mrp.bom.revision</field>
350             <field name="model">mrp.bom.revision</field>
351             <field name="type">tree</field>
352             <field name="arch" type="xml">
353                 <tree string="BoM Revisions">
354                     <field name="indice"/>
355                     <field name="author_id"/>
356                     <field name="date"/>
357                     <field colspan="4" name="name"/>
358                 </tree>
359             </field>
360         </record>
361         <record id="mrp_bom_revision_form" model="ir.ui.view">
362             <field name="name">mrp.bom.revision</field>
363             <field name="model">mrp.bom.revision</field>
364             <field name="type">form</field>
365             <field name="arch" type="xml">
366                 <form string="BoM Revisions">
367                     <field colspan="4" name="name"/>
368                     <field colspan="1" name="indice"/>
369                     <field colspan="1" name="date"/>
370                     <field name="author_id" readonly="1"/>
371                     <field colspan="4" name="description"/>
372                 </form>
373             </field>
374         </record>
375
376         <!--
377     Production Management
378     -->
379
380         <record id="mrp_production_tree_view" model="ir.ui.view">
381             <field name="name">mrp.production.tree</field>
382             <field name="model">mrp.production</field>
383             <field name="type">tree</field>
384             <field name="arch" type="xml">
385                 <tree colors="red:date_planned&lt;current_date and state not in ('done','cancel');black:date_planned&gt;=current_date and state in ('done','cancel') " string="Manufacturing Orders">
386                     <field name="name"/>
387                     <field name="product_id"/>
388                     <field name="product_qty" sum="Total Qty"/>
389                     <field name="date_planned"/>
390                     <field name="routing_id" groups="base.group_extended"/>
391                     <field name="hour_total" sum="Total Hours" groups="base.group_extended"/>
392                     <field name="cycle_total" sum="Total Cycles" groups="base.group_extended"/>
393                     <field name="origin"/>
394                     <field name="state"/>
395                 </tree>
396             </field>
397         </record>
398
399         <record id="view_production_calendar" model="ir.ui.view">
400             <field name="name">mrp.production.calendar</field>
401             <field name="model">mrp.production</field>
402             <field name="type">calendar</field>
403             <field eval="2" name="priority"/>
404             <field name="arch" type="xml">
405                 <calendar color="routing_id" date_start="date_planned" string="Manufacturing Orders">
406                     <field name="origin"/>
407                     <field name="product_id"/>
408                     <field name="product_qty"/>
409                 </calendar>
410             </field>
411         </record>
412
413
414         <record id="view_production_gantt" model="ir.ui.view">
415             <field name="name">mrp.production.gantt</field>
416             <field name="model">mrp.production</field>
417             <field name="type">gantt</field>
418             <field name="arch" type="xml">
419                 <gantt color="product_id" date_stop="date_finnished" date_start="date_start" string="Productions">
420                     <level object="mrp.routing" link="routing_id" domain="[]">
421                         <field name="name"/>
422                         <field name="origin"/>
423                     </level>
424                 </gantt>
425             </field>
426         </record>
427
428
429         <record model="ir.ui.view" id="view_production_graph">
430             <field name="name">mrp.production.graph</field>
431             <field name="model">mrp.production</field>
432             <field name="type">graph</field>
433             <field name="arch" type="xml">
434                 <graph string="Manufacturing Orders" type="bar">
435                     <field name="date_planned_date"/>
436                     <field name="hour_total" operator="+"/>
437                     <field name="cycle_total" operator="+"/>
438                 </graph>
439             </field>
440         </record>
441
442         <wizard
443             string="Change Product Qty."
444             model="mrp.production"
445             name="change_production_qty"
446             id="mrp.wizard_change_production_qty"
447             keyword="client_action_multi"
448             multi="True"/>
449         
450         <record id="mrp_production_form_view" model="ir.ui.view">
451             <field name="name">mrp.production.form</field>
452             <field name="model">mrp.production</field>
453             <field name="type">form</field>
454             <field name="arch" type="xml">
455                 <form string="Manufacturing Orders">
456                     <group colspan="4" col="6">
457                         <field name="name" select="1" string="Reference"/>
458                         <field name="date_planned" select="1"/>
459                         <field name="origin" select="1"/>
460                         <field name="product_id" on_change="product_id_change(product_id)" select="1"/>                        
461                         <field name="product_qty"/>
462                         <group colspan="2" col="3">
463                             <field name="product_uom"/>
464                             <!-- TODO Fix change qty accroding to move_lines and move_lines2 -->
465 <!--                            <button type="action" name="%(mrp.wizard_change_production_qty)d" string="Change Qty" states="ready,confirmed,in_production" icon="gtk-ok"/>-->
466                         </group>
467                         <label string="" colspan="2"/>                          
468                         <field name="product_uos_qty" groups="product.group_uos"/>                        
469                         <group colspan="2" col="3" groups="product.group_uos">
470                             <field name="product_uos"/>
471                             <label string=""/> 
472                         </group>                        
473                     </group>
474
475                     <notebook colspan="4">
476                         <page string="Consumed Products">
477                             <field name="bom_id" select="2" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
478                             <field name="routing_id" groups="base.group_extended" select="1"/>
479                             <field name="location_src_id" select="2" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
480                             <field name="location_dest_id" domain="[('usage','=','internal')]"/>
481                             <separator string="" colspan="4"/>
482
483                             <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
484                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
485                                 <tree string="Products to Consume">
486                                         <field name="product_id" />
487                                         <field name="product_qty" />
488                                         <field name="product_uom" />
489                                         <field name="state" invisible="1" />
490                                         <button
491                                                 name="%(stock.move_consume)d"
492                                                 string=">" type="action"
493                                                 icon="gtk-go-forward" context="{'consume': True}"
494                                                 states="draft,waiting,confirmed,assigned"/>
495                                         <button name="%(stock.move_scrap)d"
496                                                 string="D" type="action"
497                                                 icon="gtk-justify-fill" context="{'scrap': True}"
498                                                 states="draft,waiting,confirmed,assigned" />
499                                 </tree>
500                                 <form string="Products to Consume">
501                                         <field name="product_id" />
502                                         <field name="product_qty" />
503                                         <field name="product_uom" />
504                                 </form>
505                             </field>
506
507                             <field colspan="2" name="move_lines2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
508                                                 widget="one2many_list" mode="tree,form" height="275">
509                                         <tree string="Consumed Products" editable="bottom">
510                                                 <field name="product_id" readonly="1"/>
511                                                 <field name="product_qty" readonly="1"/>
512                                                 <field name="product_uom" readonly="1" />
513                                                 <field name="state" invisible="1" />
514                                                 <field name="location_id" readonly="1"/>
515                                                 <field name="prodlot_id" />                                             
516                                                 <button
517                                                         name="%(stock.track_line)d"
518                                                         string="Split in production lots"
519                                                         type="action" icon="gtk-justify-fill"
520                                                         states="done,cancel" />
521                                                 <button
522                                                         name="%(stock.move_scrap)d"
523                                                         string="D" type="action"
524                                                         icon="gtk-convert"
525                                                         states="done,cancel" />
526                                         </tree>
527                                         <form string="Consumed Products">
528                                                 <field name="product_id" />
529                                                 <field name="product_qty" />
530                                                 <field name="product_uom" />
531                                         </form>
532                                 </field>                                                
533
534                             <group col="9" colspan="4">
535                                 <field name="state" select="2"/>
536                                 <button name="action_compute" states="draft" string="Compute Data" type="object" icon="gtk-execute"/>
537                                 <button name="button_confirm" states="draft" string="Confirm Production" icon="gtk-apply"/>
538 <!--                                <button name="action_start" states="ready" string="Mark as Start" icon="gtk-media-play" type="object"/>-->
539                                 <button name="button_produce" states="ready" string="Produce" icon="gtk-execute"/>
540                                 <button name="button_produce_done" states="in_production" string="Production done" icon="gtk-ok"/>
541                                 <button name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object" icon="gtk-jump-to"/>
542                                 <button name="button_cancel" states="draft,ready,confirmed,in_production,picking_except" string="Cancel" icon="gtk-cancel"/>
543                                 <button name="button_recreate" states="picking_except" string="Recreate Picking" icon="gtk-convert"/>
544                             </group>
545                         </page>
546                         <page string="Scheduled Products">
547                             <field colspan="4" name="product_lines" nolabel="1" widget="one2many_list"/>
548                         </page>
549                         <page string="Finished Products">
550                             <field colspan="2" name="move_created_ids" nolabel="1" widget="one2many_list"
551                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
552                                 <tree string="Products to Consume">
553                                         <field name="product_id" />
554                                         <field name="product_qty" />
555                                         <field name="product_uom" />
556                                         <field name="state" invisible="1" />
557                                         <button
558                                                 name="%(stock.move_consume)d"
559                                                 string=">" type="action"
560                                                 icon="gtk-go-forward"
561                                                 states="draft,waiting,confirmed,assigned"/>
562                                         <button name="%(stock.move_scrap)d"
563                                                 string="D" type="action"
564                                                 icon="gtk-justify-fill" context="{'scrap': True}"
565                                                 states="draft,waiting,confirmed,assigned" />
566                                 </tree>
567                                 <form string="Products to Consume">
568                                         <field name="product_id" />
569                                         <field name="product_qty" />
570                                         <field name="product_uom" />
571                                 </form>
572                             </field>
573
574                             <field colspan="2" name="move_created_ids2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
575                                                 widget="one2many_list" mode="tree,form" height="275">
576                                         <tree string="Consumed Products" editable="bottom">
577                                                 <field name="product_id" readonly="1"/>
578                                                 <field name="product_qty" readonly="1"/>
579                                                 <field name="product_uom" readonly="1" />
580                                                 <field name="state" invisible="1" />
581                                                 <field name="location_id" readonly="1"/>
582                                                 <field name="prodlot_id" />                                             
583                                                 <button name="%(stock.track_line)d" 
584                                             string="Split in production lots" type="action" icon="gtk-justify-fill" states="done,cancel"/>
585                                                 <button name="%(stock.move_scrap)d"
586                                                         string="D" type="action" icon="gtk-go-forward" 
587                                                         states="done,cancel" />
588                                         </tree>
589                                         <form string="Consumed Products">
590                                                 <field name="product_id" />
591                                                 <field name="product_qty" />
592                                                 <field name="product_uom" />
593                                         </form>
594                                 </field>
595                         </page>
596                         <page string="Work Orders">
597                             <field colspan="4" name="workcenter_lines" nolabel="1">
598                                 <form string="Production Work Centers">
599                                     <field colspan="4" name="name" select="1"/>
600                                     <field colspan="4" name="workcenter_id" select="1"/>
601                                     <field name="sequence"/>
602                                     <field name="cycle"/>
603                                     <field name="hour"/>
604                                 </form>
605                                 <tree string="Production Work Centers">
606                                     <field name="sequence"/>
607                                     <field name="name"/>
608                                     <field name="workcenter_id"/>
609                                     <field name="cycle"/>
610                                     <field name="hour"/>
611                                 </tree>
612                             </field>
613
614                         </page>
615                         <page string="Extra Information">
616                             <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
617                             <field name="priority" groups="base.group_extended"/>
618                             <newline/>
619                             <field name="date_start" select="2"/>
620                             <field name="date_finnished"/>
621                             <field name="picking_id"/>
622                             <field name="move_prod_id"/>
623                             <field name="sale_name"/>
624                             <field name="sale_ref"/>
625                         </page>
626                     </notebook>
627                 </form>
628             </field>
629         </record>
630
631         <record id="view_mrp_production_filter" model="ir.ui.view">
632             <field name="name">mrp.production.select</field>
633             <field name="model">mrp.production</field>
634             <field name="type">search</field>
635             <field name="arch" type="xml">
636                 <search string="Search Production">
637                    <group col='9' colspan='4'>
638                        <filter icon="terp-mrp" string="Ready"
639                         domain="[('state','=','ready')]"
640                         help="Manufacturing Orders which are ready to produce" />
641                        <filter icon="terp-mrp" string="In Production"
642                         domain="[('state','=','in_production')]"
643                         help="Manufacturing Orders which are in production" />
644                        <filter icon="terp-mrp" string="Late"
645                         domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
646                         help="Production started late" />
647
648                        <separator orientation="vertical"/>
649                        <field name="name" select='1'/>
650                        <field name="product_id" select='1'/>
651                        <field name="routing_id" select='1'/>
652                        <field name="origin" select='1'/>
653                     </group>
654                     <group expand="1" string="Group By" colspan="4" col="8">
655                         <filter string="Product" icon="terp-mrp" domain="[]" context="{'group_by':'product_id'}"/>
656                         <filter string="State" icon="terp-mrp" domain="[]" context="{'group_by':'state'}"/>
657                         <filter string="Date" icon="terp-mrp" domain="[]" context="{'group_by':'date_planned'}"/>
658                         <filter string="Routing" icon="terp-mrp" domain="[]" context="{'group_by':'routing_id'}"/>
659                     </group>
660                </search>
661             </field>
662         </record>
663
664         <record id="mrp_production_action" model="ir.actions.act_window">
665             <field name="name">Manufacturing Orders</field>
666             <field name="type">ir.actions.act_window</field>
667             <field name="res_model">mrp.production</field>
668             <field name="view_type">form</field>
669             <field name="view_mode">tree,form,calendar,graph,gantt</field>
670             <field name="view_id" eval="False"/>
671             <field name="search_view_id" ref="view_mrp_production_filter"/>
672         </record>
673         <menuitem action="mrp_production_action" id="menu_mrp_production_action" parent="menu_mrp_manufacturing" sequence="1"/>
674
675         <record id="mrp_production_action2_gantt" model="ir.actions.act_window">
676             <field name="name">Manufacturing Orders Planning</field>
677             <field name="type">ir.actions.act_window</field>
678             <field name="res_model">mrp.production</field>
679             <field name="view_type">form</field>
680             <field name="view_mode">gantt,tree,form,calendar,graph</field>
681             <field name="domain">[('state','in',('ready','confirmed','in_production'))]</field>
682         </record>
683
684         <record id="mrp_production_action2" model="ir.actions.act_window">
685             <field name="name">Manufacturing Orders To Start</field>
686             <field name="type">ir.actions.act_window</field>
687             <field name="res_model">mrp.production</field>
688             <field name="view_type">form</field>
689             <field name="view_mode">tree,form,calendar,graph,gantt</field>
690             <field name="domain">[('state','=','ready')]</field>
691             <field name="filter" eval="True"/>
692             <field name="search_view_id" ref="view_mrp_production_filter"/>
693         </record>
694
695         <record id="mrp_production_action3" model="ir.actions.act_window">
696             <field name="name">Manufacturing Orders in Progress</field>
697             <field name="type">ir.actions.act_window</field>
698             <field name="res_model">mrp.production</field>
699             <field name="view_type">form</field>
700             <field name="view_mode">tree,form,calendar,graph,gantt</field>
701             <field name="domain">[('state','=','in_production')]</field>
702             <field name="filter" eval="True"/>
703             <field name="search_view_id" ref="view_mrp_production_filter"/>
704         </record>
705
706         <record id="mrp_production_action4" model="ir.actions.act_window">
707             <field name="name">Manufacturing Orders Waiting Products</field>
708             <field name="type">ir.actions.act_window</field>
709             <field name="res_model">mrp.production</field>
710             <field name="view_type">form</field>
711             <field name="view_mode">tree,form,calendar,graph,gantt</field>
712             <field name="domain">[('state','=','confirmed')]</field>
713             <field name="filter" eval="True"/>
714             <field name="search_view_id" ref="view_mrp_production_filter"/>
715         </record>
716
717         <record id="mrp_production_lot_form_view" model="ir.ui.view">
718             <field name="name">mrp.production.lot.line.form</field>
719             <field name="model">mrp.production.lot.line</field>
720             <field name="type">form</field>
721             <field name="arch" type="xml">
722                 <form string="Production Products">
723                     <field colspan="4" name="move_id" on_change="onchange_lot_line_id(lot_id)"/>
724                     <field name="name"/>
725                     <field name="product_id"/>
726                     <field name="product_qty"/>
727                     <field name="product_uom"/>
728                     <field name="product_uos_qty"/>
729                     <field name="product_uos"/>
730                     <field name="tracking_id"/>
731                 </form>
732             </field>
733         </record>
734         <record id="mrp_production_lot_tree_view" model="ir.ui.view">
735             <field name="name">mrp.production.lot.line.tree</field>
736             <field name="model">mrp.production.lot.line</field>
737             <field name="type">tree</field>
738             <field name="arch" type="xml">
739                 <tree string="Production Products Consommation">
740                     <field name="product_id"/>
741                     <field name="product_qty"/>
742                     <field name="product_uom"/>
743                     <field name="product_uos_qty"/>
744                     <field name="product_uos"/>
745                     <field name="tracking_id"/>
746                 </tree>
747             </field>
748         </record>
749
750         <record id="mrp_production_product_form_view" model="ir.ui.view">
751             <field name="name">mrp.production.product.line.form</field>
752             <field name="model">mrp.production.product.line</field>
753             <field name="type">form</field>
754             <field name="arch" type="xml">
755                 <form string="Scheduled Products">
756                     <field name="name"/>
757                     <field name="product_id"/>
758                     <field name="product_qty"/>
759                     <field name="product_uom"/>
760                     <field name="product_uos_qty"/>
761                     <field name="product_uos"/>
762                 </form>
763             </field>
764         </record>
765         <record id="mrp_production_product_tree_view" model="ir.ui.view">
766             <field name="name">mrp.production.product.line.tree</field>
767             <field name="model">mrp.production.product.line</field>
768             <field name="type">tree</field>
769             <field name="arch" type="xml">
770                 <tree string="Scheduled Products">
771                     <field name="product_id"/>
772                     <field name="product_qty"/>
773                     <field name="product_uom"/>
774                     <field name="product_uos_qty"/>
775                     <field name="product_uos"/>
776                 </tree>
777             </field>
778         </record>
779
780         <!--
781         Procurement
782         -->
783
784         <record id="mrp_procurement_tree_view" model="ir.ui.view">
785             <field name="name">mrp.procurement.tree</field>
786             <field name="model">mrp.procurement</field>
787             <field name="type">tree</field>
788             <field name="arch" type="xml">
789                 <tree string="Procurement Lines" colors="red:state=='draft';black:state=='running';green:state=='confirmed';gray:state in ['done','cancel']">
790                     <field name="date_planned" widget="date"/>
791                     <field name="origin"/>
792                     <field name="product_id"/>
793                     <field name="product_qty"/>
794                     <field name="product_uom" string="UOM"/>
795                     <field name="procure_method"/>
796                     <field name="state"/>
797                 </tree>
798             </field>
799         </record>
800         <record id="mrp_procurement_form_view" model="ir.ui.view">
801             <field name="name">mrp.procurement.form</field>
802             <field name="model">mrp.procurement</field>
803             <field name="type">form</field>
804             <field name="arch" type="xml">
805                 <form string="Procurement">
806                     <group col="2" colspan="2">
807                         <separator colspan="2" string="References"/>
808                         <field name="name" select="1" string="Procurement Reason"/>
809                         <field name="origin" select="2"/>
810                         <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
811                     </group>
812                     <group col="2" colspan="2">
813                         <separator colspan="2" string="Planification"/>
814                         <field name="date_planned" select="1" widget="date"/>
815                         <field name="procure_method" select="2"/>
816                         <field name="priority" groups="base.group_extended"/>
817                     </group>
818                     <notebook colspan="4">
819                     <page string="Procurement Details">
820                         <separator colspan="4" string="Product &amp; Location"/>
821                         <field name="product_id" select="1" on_change="onchange_product_id(product_id)"/>
822                         <field name="location_id" select="2"/>
823                         <field name="product_qty"/>
824                         <field name="product_uom"/>
825
826                         <field name="product_uos_qty" groups="product.group_uos"/>
827                         <field name="product_uos" groups="product.group_uos"/>
828
829                         <separator colspan="4" string="Status"/>
830                         <field colspan="4" name="message" readonly="1"/>
831                         <field name="state" readonly="1" select="2"/>
832                         <group col="7" colspan="2">
833                             <button name="button_confirm" states="draft" string="Confirm" icon="gtk-apply"/>
834                             <button name="button_restart" states="exception" string="Retry" icon="gtk-convert"/>
835                             <button name="button_cancel" states="draft,exception,waiting" string="Cancel" icon="gtk-cancel"/>
836                             <button name="button_check" states="confirmed" string="Run  Procurement" icon="gtk-media-play"/>
837                         </group>
838                     </page>
839                     <page string="Extra Information">
840                         <separator colspan="4" string="Details"/>
841                         <field name="bom_id" select="2" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
842                         <field name="move_id" groups="base.group_extended"/>
843                         <field name="date_close" select="2"/>
844                         <field name="close_move" groups="base.group_extended"/>
845                         <field name="purchase_id"/>
846                         <group colspan="4"  groups="base.group_extended">
847                             <separator colspan="4" string="Properties" />
848                             <field colspan="4" name="property_ids" nolabel="1"/>
849                         </group>
850                     </page>
851                     <page string="Notes">
852                         <separator colspan="4" string="Note" />
853                         <field name="note" colspan="4" nolabel="1"/>
854                     </page>
855                     </notebook>
856                 </form>
857             </field>
858         </record>
859         <record id="view_mrp_procurement_filter" model="ir.ui.view">
860             <field name="name">mrp.procurement.select</field>
861             <field name="model">mrp.procurement</field>
862             <field name="type">search</field>
863             <field name="arch" type="xml">
864                 <search string="Search Procurement">
865                     <group col='10' colspan='4'>
866                        <filter icon="terp-mrp" string="Current" domain="[('state','in',('draft','confirmed'))]" default="1" help="Procurement Orders in draft or open state."/>
867                        <filter icon="terp-mrp" string="Exceptions" domain="[('state','=','exception')]" help="Procurement Orders with exceptions"/>
868                        <filter icon="terp-mrp" string="Late"
869                         domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]"
870                         help="Procurement started late" />
871                        <separator orientation="vertical"/>
872                        <field name="name"/>
873                        <field name="origin"/> 
874                        <field name="product_id" />
875                        <field name="date_planned" widget="date"/>
876                        <field name="state" />
877                     </group>
878                     <group expand="1" string="Group By" colspan="4" col="8">
879                         <filter string="Product" icon="terp-mrp" domain="[]" context="{'group_by':'product_id'}"/>
880                         <filter string="Reason" icon="terp-mrp" domain="[]" context="{'group_by':'name'}"/>
881                         <filter string="Scheduled Date" icon="terp-mrp" domain="[]" context="{'group_by':'date_planned'}"/>
882                                         </group>
883                 </search>
884             </field>
885         </record>
886         <record id="mrp_procurement_action" model="ir.actions.act_window">
887             <field name="name">Procurement Orders</field>
888             <field name="type">ir.actions.act_window</field>
889             <field name="res_model">mrp.procurement</field>
890             <field name="view_type">form</field>
891             <field name="view_id" eval="False"/>
892             <field name="search_view_id" ref="view_mrp_procurement_filter"/>
893         </record>
894         <menuitem action="mrp_procurement_action" id="menu_mrp_procurement_action" parent="mrp.menu_mrp_manufacturing"
895                   sequence="2" />
896
897         <record id="mrp_procurement_action3" model="ir.actions.act_window">
898             <field name="name">Requisitions</field>
899             <field name="type">ir.actions.act_window</field>
900             <field name="res_model">mrp.procurement</field>
901             <field name="view_type">form</field>
902             <field name="view_mode">tree,form</field>
903             <field name="search_view_id" ref="view_mrp_procurement_filter"/>
904             <field name="domain">[]</field> 
905             <field name="context">{}</field>            
906         </record>
907
908       <menuitem action="mrp_procurement_action3" id="menu_procurement_requisitions" parent="purchase.menu_procurement_management"
909                   name="Requisitions" sequence="5" />   
910
911
912
913         <record id="mrp_procurement_action5" model="ir.actions.act_window">
914             <field name="name">Procurement Exceptions</field>
915             <field name="type">ir.actions.act_window</field>
916             <field name="res_model">mrp.procurement</field>
917             <field name="view_type">form</field>
918             <field name="view_mode">tree,form</field>
919             <field name="domain">[('state','=','exception')]</field>
920         </record>
921
922                 <menuitem action="mrp_procurement_action5" id="menu_mrp_procurement_exception_action" parent="mrp.menu_mrp_control"
923                   sequence="1" />
924         <record id="mrp_procurement_action4" model="ir.actions.act_window">
925             <field name="name">Procurement Exceptions to Fix</field>
926             <field name="type">ir.actions.act_window</field>
927             <field name="res_model">mrp.procurement</field>
928             <field name="view_type">form</field>
929             <field name="view_mode">tree,form</field>
930             <field name="domain">[('state','=','exception'), ('message', '&lt;&gt;', '')]</field>
931             <field name="filter" eval="True"/>
932         </record>
933
934         <record id="mrp_procurement_action11" model="ir.actions.act_window">
935             <field name="name">Temporary Procurement Exceptions</field>
936             <field name="type">ir.actions.act_window</field>
937             <field name="res_model">mrp.procurement</field>
938             <field name="view_type">form</field>
939             <field name="view_mode">tree,form</field>
940             <field name="domain">[('state','=','exception'), ('message', '=', '')]</field>
941         </record>
942
943         <!-- Order Point -->
944         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
945             <field name="name">stock.warehouse.orderpoint.tree</field>
946             <field name="model">stock.warehouse.orderpoint</field>
947             <field name="type">tree</field>
948             <field name="arch" type="xml">
949                 <tree string="Minimum Stock Rules">
950                     <field name="name"/>
951                     <field name="warehouse_id"/>
952                     <field name="product_id"/>
953                     <field name="product_uom"/>
954                     <field name="product_min_qty"/>
955                     <field name="product_max_qty"/>
956                 </tree>
957             </field>
958         </record>
959         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
960             <field name="name">stock.warehouse.orderpoint.form</field>
961             <field name="model">stock.warehouse.orderpoint</field>
962             <field name="type">form</field>
963             <field name="arch" type="xml">
964                 <form string="Minimum Stock Rules">
965                     <field name="name" select="1"/>
966                     <field name="active" select="1"/>
967                     <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" select="1" widget="selection"/>
968                     <field name="location_id" select="2"/>
969                     <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
970                     <field name="product_id" on_change="onchange_product_id(product_id)" select="1"/>
971                     <field name="product_uom"/>
972                     <field name="product_min_qty"/>
973                     <field name="product_max_qty"/>
974                     <field name="qty_multiple"/>
975                     <field name="procurement_id" readonly="1"/>
976                 </form>
977             </field>
978         </record>
979         <record id="action_orderpoint_form" model="ir.actions.act_window">
980             <field name="name">Minimum Stock Rules</field>
981             <field name="res_model">stock.warehouse.orderpoint</field>
982             <field name="type">ir.actions.act_window</field>
983             <field name="view_type">form</field>
984             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
985         </record>
986         <menuitem action="action_orderpoint_form" id="menu_action_orderpoint_form" parent="menu_mrp_reordering"/>
987
988         <act_window domain="[('warehouse_id', '=', active_id)]" id="act_stock_warehouse_2_stock_warehouse_orderpoint" name="Minimum Stock Rules" res_model="stock.warehouse.orderpoint" src_model="stock.warehouse"/>
989
990         <!-- add product_uom to context to be the default value when adding new orderpoints -->
991         <act_window
992             context="{'product_uom': locals().has_key('uom_id') and uom_id}"
993             domain="[('product_id', '=', active_id)]"
994             id="act_product_product_2_stock_warehouse_orderpoint"
995             name="Minimum Stock Rules"
996             res_model="stock.warehouse.orderpoint"
997             src_model="product.product"/>
998
999         <act_window
1000             id="action_product_bom_structure"
1001             name="Product BoM Structure"
1002             domain="[('product_id', '=', active_id),('bom_id','=',False)]"
1003             view_type="tree"
1004             view_id="mrp_bom_tree_view"
1005             res_model="mrp.bom"
1006             src_model="product.product"/>
1007
1008         <act_window
1009             domain="[('product_id', '=', active_id),('bom_id','=',False)]"
1010             id="act_product_product_2_mrp_bom"
1011             name="Bill of Materials"
1012             res_model="mrp.bom"
1013             src_model="product.product"/>
1014     </data>
1015 </openerp>