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