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