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