[IMP]mrp: improve view
[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="base.menu_mrp_root" parent="" name="Manufacturing"
6             groups="group_mrp_user,group_mrp_manager" sequence="8"
7             web_icon="images/manufacturing.png"
8             web_icon_hover="images/manufacturing-hover.png"/>
9
10         <menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
11
12         <menuitem name="Master Data"
13             id="menu_mrp_bom"
14             parent="base.menu_mrp_root"
15             sequence="5" />
16
17         <!--
18         Property / Property Group
19         -->
20
21         <record id="mrp_property_group_form_view" model="ir.ui.view">
22             <field name="name">mrp.property.group.form</field>
23             <field name="model">mrp.property.group</field>
24             <field name="type">form</field>
25             <field name="arch" type="xml">
26                 <form string="Properties categories" version="7.0">
27                     <label for="name"/>
28                     <field name="name"/>
29                     <label name="description"/>
30                     <field name="description"/>
31                 </form>
32             </field>
33         </record>
34         <record id="mrp_property_group_action" model="ir.actions.act_window">
35             <field name="name">Property Groups</field>
36             <field name="type">ir.actions.act_window</field>
37             <field name="res_model">mrp.property.group</field>
38             <field name="view_type">form</field>
39             <field name="view_mode">tree,form</field>
40             <field name="help">Define specific property groups that can be assigned to the properties of your bill of materials.</field>
41         </record>
42         <menuitem
43             id="menu_mrp_configuration"
44             name="Configuration"
45             parent="base.menu_mrp_root"
46             groups="group_mrp_manager"
47             sequence="50" />
48
49         <record id="mrp_property_tree_view" model="ir.ui.view">
50             <field name="name">mrp.property.tree</field>
51             <field name="model">mrp.property</field>
52             <field name="type">tree</field>
53             <field name="arch" type="xml">
54                 <tree string="Properties">
55                     <field name="name"/>
56                     <field name="composition"/>
57                     <field name="group_id"/>
58                 </tree>
59             </field>
60         </record>
61         <record id="mrp_property_form_view" model="ir.ui.view">
62             <field name="name">mrp.property.form</field>
63             <field name="model">mrp.property</field>
64             <field name="type">form</field>
65             <field name="arch" type="xml">
66                 <form string="Properties" version="7.0">
67                     <group col="4">
68                         <field colspan="4" name="name"/>
69                         <field name="group_id"/>
70                         <field name="composition"/>
71                     </group>
72                     <label for="description"/>
73                     <field name="description"/>
74                 </form>
75             </field>
76         </record>
77
78         <record id="view_mrp_property_search" model="ir.ui.view">
79             <field name="name">mrp.property.search</field>
80             <field name="model">mrp.property</field>
81             <field name="type">search</field>
82             <field name="arch" type="xml">
83                 <search string="Search">
84                    <group>
85                        <field name="name"/>
86                        <field name="composition"/>
87                        <field name="group_id"  widget="selection" />
88                    </group>
89                    <newline/>
90                    <group expand="0" string="Group By...">
91                         <filter string="Property Group" icon="terp-personal" domain="[]" context="{'group_by':'group_id'}"/>
92                     </group>
93                </search>
94             </field>
95         </record>
96
97
98         <record id="mrp_property_action" model="ir.actions.act_window">
99             <field name="name">Properties</field>
100             <field name="type">ir.actions.act_window</field>
101             <field name="res_model">mrp.property</field>
102             <field name="view_type">form</field>
103             <field name="view_mode">tree,form</field>
104             <field name="search_view_id" ref="view_mrp_property_search"/>
105             <field name="help">The Properties in OpenERP are used to select the right bill of materials for manufacturing a product when you have different ways of building the same product. You can assign several properties to each Bill of Materials. When a sales person creates a sales order, he can relate it to several properties and OpenERP will automatically select the BoM to use according the needs.</field>
106         </record>
107         <menuitem name="Master Bill of Materials"
108             id="menu_mrp_property"
109             parent="menu_mrp_configuration"
110             groups="mrp.group_mrp_routings,product.group_mrp_properties"
111             sequence="20" />
112         <menuitem
113             action="mrp_property_action"
114             id="menu_mrp_property_action"
115             groups="product.group_mrp_properties"
116             parent="menu_mrp_property"/>
117         <menuitem
118             action="mrp_property_group_action"
119             parent="menu_mrp_property"
120             groups="product.group_mrp_properties"
121             id="menu_mrp_property_group_action"/>
122
123         <!--
124         Work Centers
125         -->
126
127         <record id="mrp_workcenter_tree_view" model="ir.ui.view">
128             <field name="name">mrp.workcenter.tree</field>
129             <field name="model">mrp.workcenter</field>
130             <field name="type">tree</field>
131             <field name="arch" type="xml">
132                 <tree string="Work Center">
133                     <field name="code"/>
134                     <field name="name"/>
135                     <field name="resource_type"/>
136                     <field name="company_id" groups="base.group_multi_company"/>
137                 </tree>
138             </field>
139         </record>
140         <record id="mrp_workcenter_view" model="ir.ui.view">
141             <field name="name">mrp.workcenter.form</field>
142             <field name="model">mrp.workcenter</field>
143             <field name="type">form</field>
144             <field name="arch" type="xml">
145                 <form string="Work Center" version="7.0">
146                     <group col="4">
147                         <field name="name"/>
148                         <field name="code"/>
149                         <field name="active"/>
150                         <field name="resource_type"/>
151                         <field name="calendar_id" widget="selection"/>
152                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
153                     </group>
154                     <notebook>
155                         <page string="General Information">
156                             <group>
157                                 <group string="Capacity Information">
158                                     <field name="time_efficiency"/>
159                                     <field name="capacity_per_cycle"/>
160                                     <field name="time_cycle" widget="float_time"/>
161                                     <field name="time_start" widget="float_time"/>
162                                     <field name="time_stop" widget="float_time"/>
163                                 </group>
164                                 <group string="Costing Information">
165                                     <field name="product_id" on_change="on_change_product_cost(product_id)"/>
166                                     <field name="costs_hour"/>
167                                     <field name="costs_hour_account_id" groups="analytic.group_analytic_accounting"/>
168                                     <field name="costs_cycle"/>
169                                     <field name="costs_cycle_account_id" groups="analytic.group_analytic_accounting"/>
170                                     <field name="costs_journal_id" attrs="{'required':['|',('costs_hour_account_id', '=', True),('costs_cycle_account_id', '=', True)]}" groups="analytic.group_analytic_accounting"/>
171                                     <field name="costs_general_account_id" attrs="{ 'required':['|',('costs_cycle_account_id', '=', True),('costs_hour_account_id', '=', True)]}" groups="analytic.group_analytic_accounting"/>
172                                 </group>
173                             </group>
174                             <label for="note"/>
175                             <field name="note"/>
176                         </page>
177                     </notebook>
178                 </form>
179             </field>
180         </record>
181
182         <!-- Search Views -->
183
184         <record id="view_mrp_workcenter_search" model="ir.ui.view">
185             <field name="name">mrp.workcenter.search</field>
186             <field name="model">mrp.workcenter</field>
187             <field name="type">search</field>
188             <field name="arch" type="xml">
189                 <search string="Search for mrp workcenter">
190                    <group>
191                         <filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
192                         <separator orientation="vertical"/>
193                         <field name="code"/>
194                         <field name="name"/>
195                         <field name="resource_type"/>
196                    </group>
197                    <newline/>
198                    <group expand="0" string="Group By...">
199                         <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'resource_type'}"/>
200                         <separator orientation="vertical" groups="base.group_multi_company"/>
201                         <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
202                     </group>
203                </search>
204             </field>
205         </record>
206
207         <!--
208         Routings
209         -->
210
211         <record id="mrp_routing_workcenter_tree_view" model="ir.ui.view">
212             <field name="name">mrp.routing.workcenter.tree</field>
213             <field name="model">mrp.routing.workcenter</field>
214             <field name="type">tree</field>
215             <field name="arch" type="xml">
216                 <tree string="Routing Work Centers">
217                     <field name="sequence"/>
218                     <field name="name"/>
219                     <field name="workcenter_id"/>
220                     <field name="cycle_nbr"/>
221                     <field name="hour_nbr"/>
222                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
223                 </tree>
224             </field>
225         </record>
226
227         <record id="mrp_routing_workcenter_form_view" model="ir.ui.view">
228             <field name="name">mrp.routing.workcenter.form</field>
229             <field name="model">mrp.routing.workcenter</field>
230             <field name="type">form</field>
231             <field name="arch" type="xml">
232                 <form string="Routing Work Centers" version="7.0">
233                     <group col="4" string="General Information">
234                         <field colspan="4" name="name"/>
235                         <field name="sequence"/>
236                         <field name="workcenter_id"/>
237                         <field name="cycle_nbr"/>
238                         <field name="hour_nbr" widget="float_time"/>
239                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
240                     </group>
241                     <label for="note"/>
242                     <field name="note"/>
243                 </form>
244             </field>
245         </record>
246
247         <record id="mrp_routing_form_view" model="ir.ui.view">
248             <field name="name">mrp.routing.form</field>
249             <field name="model">mrp.routing</field>
250             <field name="type">form</field>
251             <field name="arch" type="xml">
252                 <form string="Routing" version="7.0">
253                     <group col="4">
254                         <field name="name"/>
255                         <field name="code"/>
256                         <field name="active"/>
257                         <field name="location_id"/>
258                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
259                     </group>
260                     <notebook>
261                         <page string="Work Center Operations">
262                            <field name="workcenter_lines"/>
263                         </page>
264                         <page string="Notes">
265                            <field name="note"/>
266                         </page>
267                     </notebook>
268                 </form>
269             </field>
270         </record>
271         <record id="mrp_routing_tree_view" model="ir.ui.view">
272             <field name="name">mrp.routing.tree</field>
273             <field name="model">mrp.routing</field>
274             <field name="type">tree</field>
275             <field name="arch" type="xml">
276                 <tree string="Routing">
277                     <field name="code"/>
278                     <field name="name"/>
279                     <field name="location_id"/>
280                     <field name="company_id" groups="base.group_multi_company"/>
281                 </tree>
282             </field>
283         </record>
284         <record id="mrp_routing_search_view" model="ir.ui.view">
285             <field name="name">mrp.routing.search</field>
286             <field name="model">mrp.routing</field>
287             <field name="type">search</field>
288             <field name="arch" type="xml">
289                 <search string="Routing">
290                     <filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
291                     <separator orientation="vertical"/>
292                     <field name="code"/>
293                     <field name="name"/>
294                     <field name="location_id"/>
295                     <field name="company_id" groups="base.group_multi_company"/>
296                     <newline/>
297                     <group expand="0" string="Group By...">
298                         <filter string="Production Location" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'location_id'}"/>
299                     </group>
300                 </search>
301             </field>
302         </record>
303         <record id="mrp_routing_action" model="ir.actions.act_window">
304             <field name="name">Routings</field>
305             <field name="type">ir.actions.act_window</field>
306             <field name="res_model">mrp.routing</field>
307             <field name="view_type">form</field>
308             <field name="view_id" ref="mrp_routing_tree_view"/>
309             <field name="search_view_id" ref="mrp_routing_search_view"/>
310             <field name="help">Routings allow you to create and manage the manufacturing operations that should be followed within your work centers in order to produce a product. They are attached to bills of materials that will define the required raw materials.</field>
311         </record>
312         <menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_bom" groups="mrp.group_mrp_routings" sequence="15"/>
313
314         <!--
315           Bill of Materials
316         -->
317
318         <record id="mrp_bom_form_view" model="ir.ui.view">
319             <field name="name">mrp.bom.form</field>
320             <field name="model">mrp.bom</field>
321             <field name="type">form</field>
322             <field name="arch" type="xml">
323                 <form string="Bill of Material" version="7.0">
324                     <label for="product_id" class="oe_form_readonly_hidden"/>
325                     <h1>
326                         <field name="product_id" on_change="onchange_product_id(product_id, name, context)" class="oe_form_inline"/>: 
327                         <field name="product_qty" class="oe_form_inline"/>
328                         <field name="product_uom" class="oe_form_inline" groups="product.group_uom"/>
329                     </h1>
330                     <label for="routing_id" class="oe_form_readonly_hidden"/>
331                     <h2>
332                         <field name="routing_id"  groups="mrp.group_mrp_routings"/>
333                     </h2>
334                     <group>
335                         <group>
336                             <field name="name"/>
337                             <field name="code" string="Reference"/>
338                         </group>
339                         <group>
340                             <field name="type"/>
341                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
342                             <field name="product_uos_qty" groups="product.group_uos" />
343                             <field name="product_uos"  groups="product.group_uos"/>
344                         </group>
345                     </group>
346                     <notebook>
347                         <page string="Components">
348                             <field name="bom_lines" widget="one2many_list">
349                                 <tree string="Components" editable="bottom">
350                                     <field name="product_id" on_change="onchange_product_id(product_id, name)"/>
351                                     <field name="product_qty"/>
352                                     <field name="product_uom" groups="product.group_uom"/>
353                                     <field name="name" invisible="1"/>
354                                     <field name="date_start"/>
355                                     <field name="date_stop"/>
356                                 </tree>
357                             </field>
358                         </page>
359                         <page string="Revisions" attrs="{'invisible': [('bom_id','!=',False)]}">
360                             <field name="revision_ids"/>
361                         </page>
362                         <page string="Properties" groups="product.group_mrp_properties">
363                             <group col="4">
364                                 <field name="position"/>
365                                 <field name="active"/>
366                                 <field name="sequence"/>
367                                 <field name="bom_id"/>
368
369                                 <field name="date_start"/>
370                                 <field name="date_stop"/>
371                                 <field name="product_rounding"/>
372                                 <field name="product_efficiency"/>
373                             </group>
374                             <separator string="Properties"/>
375                             <field name="property_ids"/>
376                         </page>
377                     </notebook>
378                     <newline/>
379                 </form>
380             </field>
381         </record>
382
383         <record id="view_mrp_bom_filter" model="ir.ui.view">
384             <field name="name">mrp.bom.select</field>
385             <field name="model">mrp.bom</field>
386            <field name="type">search</field>
387             <field name="arch" type="xml">
388                 <search string="Search Bill Of Material">
389                     <group>
390                          <field name="name"/>
391                          <field name="code" string="Reference"/>
392                          <field name="product_id"/>
393                          <field name="company_id" groups="base.group_multi_company"/>
394                     </group>
395                     <newline/>
396                     <group expand="0" string="Group By...">
397                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
398                         <filter string='Default Unit of Measure' icon="terp-mrp" domain="[]" context="{'group_by' : 'product_uom'}" />
399                         <separator orientation="vertical"/>
400                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}"/>
401                         <filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}" />
402                         <separator orientation="vertical"/>
403                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}" help="Starting Date"/>
404                    </group>
405                 </search>
406             </field>
407         </record>
408
409        <record id="mrp_bom_tree_view" model="ir.ui.view">
410             <field name="name">mrp.bom.tree</field>
411             <field name="model">mrp.bom</field>
412             <field name="type">tree</field>
413             <field name="field_parent">child_complete_ids</field>
414             <field name="arch" type="xml">
415                 <tree string="Bill of Materials" colors="blue:method">
416                     <field name="sequence" invisible="1"/>
417                     <field name="name"/>
418                     <field name="code"/>
419                     <field name="product_id"/>
420                     <field name="product_qty"/>
421                     <field name="product_uom" groups="product.group_uom"/>
422                     <field name="type"/>
423                     <field name="method"/>
424                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
425                     <field name="date_start"/>
426                     <field name="date_stop"/>
427                 </tree>
428             </field>
429         </record>
430        <record id="mrp_bom_component_tree_view" model="ir.ui.view">
431             <field name="name">mrp.bom.component.tree</field>
432             <field name="model">mrp.bom</field>
433             <field name="type">tree</field>
434             <field name="field_parent">child_complete_ids</field>
435             <field name="arch" type="xml">
436                 <tree string="BoM Structure" colors="blue:method">
437                     <field name="sequence" invisible="1"/>
438                     <field name="name" string="Component Name"/>
439                     <field name="code"/>
440                     <field name="product_id" string="Component Product"/>
441                     <field name="bom_id"/>
442                     <field name="product_qty"/>
443                     <field name="product_uom" groups="product.group_uom"/>
444                     <field name="type"/>
445                     <field name="method"/>
446                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
447                     <field name="date_start"/>
448                     <field name="date_stop"/>
449                 </tree>
450             </field>
451         </record>
452         <record id="mrp_bom_form_action" model="ir.actions.act_window">
453             <field name="name">Bill of Materials</field>
454             <field name="type">ir.actions.act_window</field>
455             <field name="res_model">mrp.bom</field>
456             <field name="view_type">form</field>
457             <field name="domain">[('bom_id','=',False)]</field>
458             <field name="search_view_id" ref="view_mrp_bom_filter"/>
459             <field name="help">Master Bills of Materials allow you to create and manage the list of necessary raw materials used to make a finished product. OpenERP will use these BoMs to automatically propose manufacturing orders according to product needs. You can either create a bill of materials to define specific production steps or define a single multi-level bill of materials.</field>
460         </record>
461         <record id="mrp_bom_form_action2" model="ir.actions.act_window">
462             <field name="name">Bill of Material Components</field>
463             <field name="type">ir.actions.act_window</field>
464             <field name="res_model">mrp.bom</field>
465             <field name="view_type">form</field>
466             <field name="view_id" ref="mrp_bom_component_tree_view"/>
467             <field name="domain">[('bom_id','!=',False)]</field>
468             <field name="help">Bills of materials components are components and sub-products used to create master bills of materials. Use this menu to search in which BoM a specific component is used.</field>
469         </record>
470
471         <!-- BOM menus -->
472
473         <menuitem
474             action="mrp_bom_form_action"
475             id="menu_mrp_bom_form_action"
476             parent="menu_mrp_bom"
477             sequence="10"/>
478         <menuitem
479             action="mrp_bom_form_action2"
480             id="menu_mrp_bom_form_action2"
481             parent="menu_mrp_bom"
482             sequence="20"/>
483
484         <record id="action2" model="ir.actions.act_window">
485             <field name="name">Bill of Materials Structure</field>
486             <field name="type">ir.actions.act_window</field>
487             <field name="res_model">mrp.bom</field>
488             <field name="domain">[('id','in',active_ids)]</field>
489             <field name="view_type">tree</field>
490             <field name="view_mode">tree</field>
491             <field name="view_id" ref="mrp_bom_tree_view"/>
492         </record>
493         <record id="ir_BOM_structure" model="ir.values">
494             <field eval="'client_action_multi'" name="key2"/>
495             <field eval="'mrp.bom'" name="model"/>
496             <field name="name">Bill of Materials Structure</field>
497             <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
498         </record>
499
500         <record id="mrp_bom_revision_tree" model="ir.ui.view">
501             <field name="name">mrp.bom.revision</field>
502             <field name="model">mrp.bom.revision</field>
503             <field name="type">tree</field>
504             <field name="arch" type="xml">
505                 <tree string="BoM Revisions">
506                     <field name="indice"/>
507                     <field name="author_id"/>
508                     <field name="date"/>
509                     <field colspan="4" name="name"/>
510                 </tree>
511             </field>
512         </record>
513         <record id="mrp_bom_revision_form" model="ir.ui.view">
514             <field name="name">mrp.bom.revision</field>
515             <field name="model">mrp.bom.revision</field>
516             <field name="type">form</field>
517             <field name="arch" type="xml">
518                 <form string="BoM Revisions" version="7.0">
519                     <group col="4">
520                         <field name="name"/>
521                         <field name="indice"/>
522                         <field name="date"/>
523                         <field name="author_id" readonly="1"/>
524                     </group>
525                     <separator string="Description"/>
526                     <field name="description"/>
527                 </form>
528             </field>
529         </record>
530
531         <!--
532         Production Management
533         -->
534         <record id="mrp_production_tree_view" model="ir.ui.view">
535             <field name="name">mrp.production.tree</field>
536             <field name="model">mrp.production</field>
537             <field name="type">tree</field>
538             <field name="arch" type="xml">
539                 <tree fonts="bold:needaction_pending==True" colors="blue:state in ('draft','confirmed');red:date_planned&lt;current_date and state not in ('done','cancel');black:date_planned&gt;=current_date and state not in ('done','cancel');gray:state in ('done','cancel')" string="Manufacturing Orders">
540                     <field name="needaction_pending" invisible="1"/>
541                     <field name="name"/>
542                     <field name="date_planned"/>
543                     <field name="product_id"/>
544                     <field name="product_qty" sum="Total Qty"/>
545                     <field name="product_uom" groups="product.group_uom"/>
546                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
547                     <field name="hour_total" sum="Total Hours"/>
548                     <field name="cycle_total" sum="Total Cycles"/>
549                     <field name="origin"/>
550                     <field name="state"/>
551                 </tree>
552             </field>
553         </record>
554
555         <record id="view_production_calendar" model="ir.ui.view">
556             <field name="name">mrp.production.calendar</field>
557             <field name="model">mrp.production</field>
558             <field name="type">calendar</field>
559             <field eval="2" name="priority"/>
560             <field name="arch" type="xml">
561                 <calendar color="routing_id" date_start="date_planned" string="Manufacturing Orders">
562                     <field name="name"/>
563                     <field name="product_id"/>
564                     <field name="product_qty"/>
565                 </calendar>
566             </field>
567         </record>
568
569
570         <record id="view_production_gantt" model="ir.ui.view">
571             <field name="name">mrp.production.gantt</field>
572             <field name="model">mrp.production</field>
573             <field name="type">gantt</field>
574             <field name="arch" type="xml">
575                 <gantt date_stop="date_finished" date_start="date_start" string="Productions" default_group_by="routing_id">
576                 </gantt>
577             </field>
578         </record>
579
580
581         <record model="ir.ui.view" id="view_production_graph">
582             <field name="name">mrp.production.graph</field>
583             <field name="model">mrp.production</field>
584             <field name="type">graph</field>
585             <field name="arch" type="xml">
586                 <graph string="Manufacturing Orders" type="bar">
587                     <field name="date_planned_date"/>
588                     <field name="hour_total" operator="+"/>
589                     <field name="cycle_total" operator="+"/>
590                 </graph>
591             </field>
592         </record>
593
594         <record id="mrp_production_form_view" model="ir.ui.view">
595             <field name="name">mrp.production.form</field>
596             <field name="model">mrp.production</field>
597             <field name="type">form</field>
598             <field name="arch" type="xml">
599                 <form string="Manufacturing Orders" version="7.0">
600                 <header>
601                     <button name="button_confirm" states="draft" string="Confirm Production" class="oe_form_button_hi"/>
602                     <button name="button_produce" states="ready" string="Start Production" class="oe_form_button_hi"/>
603                     <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" type="action" class="oe_form_button_hi"/>
604                     <button name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object"/>
605                     <button name="button_recreate" states="picking_except" string="Recreate Picking"/>
606                     <button name="button_cancel" states="draft,ready,in_production,picking_except" string="Cancel"/>
607                     <button name="action_cancel" type="object" states="confirmed" string="Cancel"/>
608                     <field name="state" widget="statusbar" statusbar_visible="draft,ready,in_production,done" statusbar_colors='{"picking_except":"red","confirmed":"blue"}'/>
609                 </header>
610                 <sheet>
611                     <label for="product_id" class="oe_form_readonly_hidden"/>
612                     <h1>
613                         <field name="product_id" on_change="product_id_change(product_id)" domain="[('supply_method','=','produce')]" class="oe_form_inline"/>
614                         <field name="product_qty" class="oe_form_inline"/>
615                         <field name="product_uom" class="oe_form_inline" groups="product.group_uom"/>
616                         <button type="action"
617                             icon="terp-accessories-archiver+" class="oe_form_inline"
618                             name="%(mrp.action_change_production_qty)d"
619                             string="Change Quantity" states="ready,confirmed" />
620                     </h1>
621                     <label for="routing_id"  groups="mrp.group_mrp_routings"  class="oe_form_readonly_hidden"/>
622                     <h2>
623                         <field name="routing_id" groups="mrp.group_mrp_routings"/>
624                     </h2>
625                     <group>
626                         <group>
627                             <field name="name"/>
628                             <field name="date_planned"/>
629                             <field name="origin"/>
630                         </group>
631                         <group>
632                             <field name="user_id"/>
633                             <field name="product_uos_qty" groups="product.group_uos"/>
634                             <field name="product_uos" groups="product.group_uos"/>
635                         </group>
636                     </group>
637                     <notebook>
638                         <page string="Consumed Products">
639                             <group col="4">
640                                 <group>
641                                     <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)" groups="stock.group_locations"/>
642                                     <field name="location_dest_id" domain="[('usage','=','internal')]" groups="stock.group_locations"/>
643                                 </group>
644                                 <group>
645                                     <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
646                                 </group>
647                              </group>
648                              <newline/>
649                              <group>
650                                 <field name="move_lines" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
651                                     <tree colors="blue:state == 'draft';black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
652                                         <field name="product_id"/>
653                                         <field name="product_qty"/>
654                                         <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
655                                         <field name="location_id" string="Source Loc." groups="stock.group_locations"/>
656                                         <field name="state" invisible="1"/>
657                                         <button name="%(stock.move_consume)d"
658                                             string="Consume Products" type="action"
659                                             icon="gtk-go-forward" context="{'consume': True}"
660                                             states="draft,waiting,confirmed,assigned" />
661                                         <button
662                                                name="%(stock.track_line)d"
663                                                string="Split in Serial Numbers"
664                                                type="action" icon="gtk-justify-fill"
665                                                states="draft,waiting,confirmed,assigned" />
666                                         <button name="%(stock.move_scrap)d"
667                                             string="Scrap Products" type="action"
668                                             icon="gtk-convert" context="{'scrap': True}"
669                                             states="draft,waiting,confirmed,assigned"/>
670                                     </tree>
671                                 </field>
672                                 <field name="move_lines2" domain="[('state','in', ('done', 'cancel'))]">
673                                    <tree colors="red:scrapped==True;blue:state == 'draft';black:state in('picking_except','confirmed','ready','in_production');gray:state == 'cancel' " string="Consumed Products" editable="bottom">
674                                        <field name="product_id" readonly="1"/>
675                                        <field name="product_qty" readonly="1"/>
676                                        <field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
677                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
678                                        <field name="state" invisible="1"/>
679                                        <field name="scrapped" invisible="1"/>
680                                        <button
681                                            name="%(stock.move_scrap)d"
682                                            string="Scrap Products" type="action"
683                                            icon="gtk-convert"
684                                            states="done,cancel"/>
685                                    </tree>
686                                 </field>
687                                </group>
688                         </page>
689                         <page string="Finished Products">
690                             <group>
691                             <field name="move_created_ids" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
692                                 <tree string="Products to Finish">
693                                     <field name="product_id"/>
694                                     <field name="product_qty"/>
695                                     <field name="product_uom"  string="Unit of Measure" groups="product.group_uom"/>
696                                     <field name="state" invisible="1"/>
697                                     <button name="%(stock.action_partial_move_server)d"
698                                         string="Partial"
699                                         type="action" states="confirmed,assigned"
700                                         icon="gtk-justify-fill"/>
701                                     <button name="%(stock.move_scrap)d"
702                                         string="Scrap Products" type="action"
703                                         icon="gtk-convert" context="{'scrap': True}"
704                                         states="draft,waiting,confirmed,assigned" />
705                                 </tree>
706                             </field>
707                             <field name="move_created_ids2" domain="[('state','in', ('done', 'cancel'))]">
708                                 <tree colors="red:scrapped==True;blue:state == 'draft';black:state in('picking_except','confirmed','ready','in_production');gray:state in('cancel','done') " string="Finished Products">
709                                     <field name="product_id" readonly="1"/>
710                                     <field name="product_qty" readonly="1"/>
711                                     <field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
712                                     <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection" groups="stock.group_locations"/>
713                                     <field name="prodlot_id" context="{'product_id': product_id}"/>
714                                     <field name="scrapped" invisible="1"/>
715                                     <field name="state" invisible="1"/>
716                                     <button name="%(stock.track_line)d"
717                                          string="Split in Serial Numbers" type="action" icon="gtk-justify-fill" states="done,cancel"/>
718                                     <button name="%(stock.move_scrap)d"
719                                         string="Scrap Products" type="action" icon="gtk-convert"
720                                         states="done,cancel" />
721                                 </tree>
722                             </field>
723                             </group>
724                         </page>
725                         <page string="Work Orders">
726                             <button name="action_compute" states="draft"
727                                 string="Compute Data" type="object"
728                                 icon="terp-stock_format-scientific"/>
729                             <field name="workcenter_lines">
730                                 <form string="Production Work Centers" version="7.0">
731                                     <group col="4">
732                                         <field colspan="4" name="name"/>
733                                         <field name="workcenter_id" widget="selection"/>
734                                         <field name="sequence"/>
735                                         <field name="cycle"/>
736                                         <field name="hour"/>
737                                     </group>
738                                 </form>
739                                 <tree string="Production Work Centers">
740                                     <field name="sequence"/>
741                                     <field name="name"/>
742                                     <field name="workcenter_id" widget="selection"/>
743                                     <field name="cycle"/>
744                                     <field name="hour"/>
745                                 </tree>
746                             </field>
747                         </page>
748                         <page string="Scheduled Products">
749                             <button name="action_compute" states="draft"
750                                 string="Compute Data" type="object"
751                                 icon="terp-stock_format-scientific"/>
752                             <field name="product_lines"/>
753                         </page>
754                         <page string="Extra Information">
755                             <group col="4">
756                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
757                                 <field name="priority"/>
758                                 <field name="date_start"/>
759                                 <field name="date_finished"/>
760                                 <field name="picking_id"/>
761                                 <field name="move_prod_id" groups="stock.group_locations"/>
762                             </group>
763                         </page>
764                     </notebook>
765                 </sheet>
766                 <footer>
767                     <field name="message_ids" widget="ThreadView"/>
768                 </footer>
769                 </form>
770             </field>
771         </record>
772
773         <record id="view_mrp_production_filter" model="ir.ui.view">
774             <field name="name">mrp.production.select</field>
775             <field name="model">mrp.production</field>
776             <field name="type">search</field>
777             <field name="arch" type="xml">
778                 <search string="Search Production">
779                    <group>
780                        <filter icon="terp-gtk-media-pause" string="Pending" name="pending"
781                            domain="[('state','=','confirmed')]"
782                            help="Manufacturing Orders which are waiting for raw materials."/>
783                        <filter icon="terp-camera_test" string="Ready" name="ready"
784                            domain="[('state','=','ready')]"
785                            help="Manufacturing Orders which are ready to start production."/>
786                        <filter icon="terp-check" string="In Production" name="inprogress"
787                            domain="[('state','=','in_production')]"
788                            help="Manufacturing Orders which are currently in production."/>
789                        <separator orientation="vertical"/>
790                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
791                            domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
792                            help="Production started late" />
793                        <separator orientation="vertical"/>
794                        <field name="name"/>
795                        <field name="product_id"/>
796                        <field name="routing_id" groups="mrp.group_mrp_routings"/>
797                        <field name="origin"/>
798                     </group>
799                     <newline/>
800                     <group expand="0" string="Group By...">
801                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
802                         <separator orientation="vertical"/>
803                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}"/>
804                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
805                         <separator orientation="vertical"/>
806                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}" help="Scheduled Date"/>
807                     </group>
808                </search>
809             </field>
810         </record>
811
812         <record id="mrp_production_action" model="ir.actions.act_window">
813             <field name="name">Manufacturing Orders</field>
814             <field name="type">ir.actions.act_window</field>
815             <field name="res_model">mrp.production</field>
816             <field name="view_type">form</field>
817             <field name="view_mode">tree,form,calendar,graph,gantt</field>
818             <field name="view_id" eval="False"/>
819             <field name="search_view_id" ref="view_mrp_production_filter"/>
820             <field name="context">{}</field>
821             <field name="help">Click here to create a new Manufacturing Order
822                 &lt;p&gt;
823                 To process the production, don't forget to create a Bill of Material. Manufacturing Order can be automatically generated based on procurement rules specified on the product.</field>
824         </record>
825         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
826             parent="menu_mrp_manufacturing" sequence="1"/>
827
828         <record id="mrp_production_action_planning" model="ir.actions.act_window">
829             <field name="name">Manufacturing Orders</field>
830             <field name="type">ir.actions.act_window</field>
831             <field name="res_model">mrp.production</field>
832             <field name="view_type">form</field>
833             <field name="view_mode">calendar,tree,form,graph</field>
834             <field name="domain">[('state','in',('ready','confirmed','in_production'))]</field>
835             <field name="help">Manufacturing Orders describe the operations that need to be carried out and the raw materials usage for each production stage. You use specifications (bills of materials or BoM) to work out the raw material requirements and the manufacturing orders needed for the finished products. Once the bills of materials have been defined, OpenERP is capable of automatically deciding on the manufacturing route depending on the needs of the company.</field>
836         </record>
837
838         <record id="mrp_production_action2" model="ir.actions.act_window">
839             <field name="name">Manufacturing Orders To Start</field>
840             <field name="type">ir.actions.act_window</field>
841             <field name="res_model">mrp.production</field>
842             <field name="view_type">form</field>
843             <field name="view_mode">tree,form,calendar,graph,gantt</field>
844             <field name="domain">[('state','=','ready')]</field>
845             <field name="filter" eval="True"/>
846             <field name="search_view_id" ref="view_mrp_production_filter"/>
847         </record>
848
849         <record id="mrp_production_action3" model="ir.actions.act_window">
850             <field name="name">Manufacturing Orders in Progress</field>
851             <field name="type">ir.actions.act_window</field>
852             <field name="res_model">mrp.production</field>
853             <field name="view_type">form</field>
854             <field name="view_mode">tree,form,calendar,graph,gantt</field>
855             <field name="domain">[('state','=','in_production')]</field>
856             <field name="filter" eval="True"/>
857             <field name="search_view_id" ref="view_mrp_production_filter"/>
858         </record>
859
860         <record id="mrp_production_action4" model="ir.actions.act_window">
861             <field name="name">Manufacturing Orders Waiting Products</field>
862             <field name="type">ir.actions.act_window</field>
863             <field name="res_model">mrp.production</field>
864             <field name="view_type">form</field>
865             <field name="view_mode">tree,form,calendar,graph,gantt</field>
866             <field name="domain">[('state','=','confirmed')]</field>
867             <field name="filter" eval="True"/>
868             <field name="search_view_id" ref="view_mrp_production_filter"/>
869         </record>
870
871         <record id="mrp_production_product_form_view" model="ir.ui.view">
872             <field name="name">mrp.production.product.line.form</field>
873             <field name="model">mrp.production.product.line</field>
874             <field name="type">form</field>
875             <field name="arch" type="xml">
876                 <form string="Scheduled Products" version="7.0">
877                     <group col="4">
878                         <field name="name"/>
879                         <field name="product_id"/>
880                         <field name="product_qty"/>
881                         <field name="product_uom" groups="product.group_uom"/>
882                         <field name="product_uos_qty" groups="product.group_uos"/>
883                         <field name="product_uos" groups="product.group_uos"/>
884                     </group>
885                 </form>
886             </field>
887         </record>
888         <record id="mrp_production_product_tree_view" model="ir.ui.view">
889             <field name="name">mrp.production.product.line.tree</field>
890             <field name="model">mrp.production.product.line</field>
891             <field name="type">tree</field>
892             <field name="arch" type="xml">
893                 <tree string="Scheduled Products">
894                     <field name="product_id"/>
895                     <field name="product_qty"/>
896                     <field name="product_uom" groups="product.group_uom"/>
897                     <field name="product_uos_qty" groups="product.group_uos"/>
898                     <field name="product_uos" groups="product.group_uos"/>
899                 </tree>
900             </field>
901         </record>
902
903         <!--
904             Procurements
905         -->
906
907         <record id="view_procurement_form_inherit" model="ir.ui.view">
908             <field name="name">procurement.order.form.inherit</field>
909             <field name="model">procurement.order</field>
910             <field name="inherit_id" ref="procurement.procurement_form_view"/>
911             <field name="type">form</field>
912             <field name="arch" type="xml">
913             <data>
914                 <xpath expr="//field[@name='move_id']" position="before">
915                     <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
916                 </xpath>
917                 <xpath expr="//field[@name='close_move']" position="after">
918                     <group colspan="4"  groups="product.group_mrp_properties">
919                     <separator colspan="4" string="Properties" />
920                     <field colspan="4" name="property_ids" nolabel="1"/>
921                      </group>
922                 </xpath>
923                </data>
924             </field>
925         </record>
926
927         <record id="product_normal_form_view" model="ir.ui.view">
928             <field name="name">product.normal.form.mrp.inherit</field>
929             <field name="model">product.product</field>
930             <field name="type">form</field>
931             <field name="inherit_id" ref="product.product_normal_form_view"/>
932             <field name="arch" type="xml">
933                 <group name="misc" position="after">
934                     <separator string="Bill of Materials" colspan="4"/>
935                     <field name="bom_ids" nolabel="1" colspan="4" context="{'default_product_id': active_id}"  widget="one2many_list" 
936                             mode="tree,form">
937                                 <tree string="Bill of Materials">
938                                      <field name="name" string="Component Name"/>
939                                     <field name="bom_id"/>
940                                     <field name="product_qty" string="Quantity of Product"/>
941                                     <field name="type"/>
942                                     <field name="date_start"/>
943                                     <field name="date_stop"/>
944                                 </tree>
945                             </field>
946                 </group>
947             </field>
948         </record>
949
950         <act_window
951             context="{'search_default_product_id': [active_id]}"
952             id="act_product_manufacturing_open"
953             name="Manufacturing Orders"
954             view_id="mrp_production_tree_view"
955             res_model="mrp.production"
956             src_model="product.product"/>
957
958         <act_window
959             id="action_product_bom_structure"
960             name="Product BoM Structure"
961             domain="[('product_id', 'in', active_ids),('bom_id','=',False)]"
962             context="{'default_product_id': active_id}"
963             view_type="tree"
964             view_mode="tree"
965             view_id="mrp_bom_tree_view"
966             res_model="mrp.bom"
967             src_model="product.product"
968             groups="mrp.group_mrp_user"/>
969
970         <!-- Menu for Resource for MRP-->
971
972         <record id="mrp_workcenter_action" model="ir.actions.act_window">
973             <field name="name">Work Centers</field>
974             <field name="type">ir.actions.act_window</field>
975             <field name="res_model">mrp.workcenter</field>
976             <field name="view_type">form</field>
977             <field name="view_id" ref="mrp_workcenter_tree_view"/>
978             <field name="search_view_id" ref="view_mrp_workcenter_search"/>
979             <field name="help">Work Centers allow you to create and manage manufacturing units.  They consist of workers and/or machines, which are considered as units for capacity and planning forecast.  Keep in mind that the working time and resource leave are not taken into account in the time computation of the work center.</field>
980         </record>
981
982         <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration"/>
983         <menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" groups="mrp.group_mrp_routings" parent="mrp.menu_mrp_bom" sequence="25"/>
984         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1" groups="base.group_no_one"/>
985         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1" groups="base.group_no_one"/>
986
987         <!-- Planning -->
988
989         <menuitem id="menu_mrp_planning" name="Planning"
990                 parent="base.menu_mrp_root" sequence="2"/>
991         <menuitem action="mrp.mrp_production_action_planning"
992                 id="menu_mrp_production_order_action" name="Orders Planning"
993                 parent="menu_mrp_planning" sequence="1"/>
994
995     </data>
996 </openerp>