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