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