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