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