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