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