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