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