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