[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" sequence="8"/>
7
8         <menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
9
10
11         <menuitem name="Master Data"
12                   id="menu_mrp_bom"
13                   parent="base.menu_mrp_root"
14                   groups="mrp.group_mrp_manager"
15                   sequence="5" />
16
17         <!--
18         Property / Property Group
19         -->
20
21         <record id="mrp_property_group_form_view" model="ir.ui.view">
22             <field name="name">mrp.property.group.form</field>
23             <field name="model">mrp.property.group</field>
24             <field name="type">form</field>
25             <field name="arch" type="xml">
26                 <form string="Properties categories">
27                     <separator colspan="4" string="Property Group"/>
28                     <field colspan="4" name="name" select="1" nolabel="1"/>
29                     <separator colspan="4" string="Description"/>
30                     <field colspan="4" name="description" nolabel="1"/>
31                 </form>
32             </field>
33         </record>
34         <record id="mrp_property_group_action" model="ir.actions.act_window">
35             <field name="name">Property Groups</field>
36             <field name="type">ir.actions.act_window</field>
37             <field name="res_model">mrp.property.group</field>
38             <field name="view_type">form</field>
39             <field name="view_mode">tree,form</field>
40             <field name="help">Define specific property groups that can be assigned to the properties of your bills of materials.</field>
41         </record>
42         <menuitem
43             id="menu_mrp_configuration"
44             name="Configuration"
45             parent="base.menu_mrp_root"
46             groups="base.group_extended"
47             sequence="50" />
48
49         <record id="mrp_property_tree_view" model="ir.ui.view">
50             <field name="name">mrp.property.tree</field>
51             <field name="model">mrp.property</field>
52             <field name="type">tree</field>
53             <field name="arch" type="xml">
54                 <tree string="Properties">
55                     <field name="name"/>
56                     <field name="composition"/>
57                     <field name="group_id"/>
58                 </tree>
59             </field>
60         </record>
61         <record id="mrp_property_form_view" model="ir.ui.view">
62             <field name="name">mrp.property.form</field>
63             <field name="model">mrp.property</field>
64             <field name="type">form</field>
65             <field name="arch" type="xml">
66                 <form string="Properties">
67                     <field colspan="4" name="name" select="1"/>
68                     <field name="group_id" select="1"/>
69                     <field name="composition" select="1"/>
70                     <separator colspan="4" string="Description"/>
71                     <field colspan="4" name="description" nolabel="1"/>
72                 </form>
73             </field>
74         </record>
75
76         <record id="view_mrp_property_search" model="ir.ui.view">
77             <field name="name">mrp.property.search</field>
78             <field name="model">mrp.property</field>
79             <field name="type">search</field>
80             <field name="arch" type="xml">
81                 <search string="Search">
82                    <group col='15' colspan='4'>
83                        <field name="name"/>
84                        <field name="composition"/>
85                        <field name="group_id"  widget="selection" />
86                    </group>
87                    <newline/>
88                    <group expand="0" string="Group By..." colspan="4" col="20">
89                         <filter string="Property Group" icon="terp-personal" domain="[]" context="{'group_by':'group_id'}"/>
90                     </group>
91                </search>
92             </field>
93         </record>
94
95
96         <record id="mrp_property_action" model="ir.actions.act_window">
97             <field name="name">Properties</field>
98             <field name="type">ir.actions.act_window</field>
99             <field name="res_model">mrp.property</field>
100             <field name="view_type">form</field>
101             <field name="view_mode">tree,form</field>
102             <field name="search_view_id" ref="view_mrp_property_search"/>
103             <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>
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" />
115         <menuitem
116             action="mrp_property_group_action"
117             id="menu_mrp_property_group_action"
118             parent="menu_mrp_property"/>
119
120         <!--
121         Work Centers
122         -->
123
124         <record id="mrp_workcenter_tree_view" model="ir.ui.view">
125             <field name="name">mrp.workcenter.tree</field>
126             <field name="model">mrp.workcenter</field>
127             <field name="type">tree</field>
128             <field name="arch" type="xml">
129                 <tree string="Work Center">
130                     <field name="code"/>
131                     <field name="name"/>
132                     <field name="resource_type"/>
133                     <field name="company_id" groups="base.group_multi_company"/>
134                 </tree>
135             </field>
136         </record>
137         <record id="mrp_workcenter_view" model="ir.ui.view">
138             <field name="name">mrp.workcenter.form</field>
139             <field name="model">mrp.workcenter</field>
140             <field name="type">form</field>
141             <field name="arch" type="xml">
142                 <form string="Work Center">
143                     <group col="6" colspan="4">
144                         <field name="name" select="1"/>
145                         <field name="code" select="1"/>
146                         <field name="active"/>
147                         <field name="resource_type"/>
148                         <field name="calendar_id" widget="selection"/>
149                         <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
150                     </group>
151                     <notebook colspan="4">
152                         <page string="General Information">
153                             <group col="2" colspan="2">
154                             <separator colspan="2" string="Capacity Information"/>
155                             <field name="time_efficiency"/>
156                             <field name="capacity_per_cycle"/>
157                             <field name="time_cycle" widget="float_time"/>
158                             <field name="time_start" widget="float_time"/>
159                             <field name="time_stop" widget="float_time"/>
160                             </group>
161                             <group col="2" colspan="2">
162                             <separator colspan="2" string="Costing Information"/>
163                             <field name="costs_hour"/>
164                             <field name="costs_hour_account_id" groups="analytic.group_analytic_accounting"/>
165                             <field name="costs_cycle"/>
166                             <field name="costs_cycle_account_id" groups="analytic.group_analytic_accounting"/>
167                             <field name="costs_journal_id" groups="analytic.group_analytic_accounting"/>
168                             <field name="costs_general_account_id" groups="analytic.group_analytic_accounting"/>
169                             </group>
170                             <separator colspan="4" string="Description"/>
171                             <field colspan="4" name="note" nolabel="1"/>
172                         </page>
173                     </notebook>
174                 </form>
175             </field>
176         </record>
177
178         <!-- Search Views -->
179
180         <record id="view_mrp_workcenter_search" model="ir.ui.view">
181             <field name="name">mrp.workcenter.search</field>
182             <field name="model">mrp.workcenter</field>
183             <field name="type">search</field>
184             <field name="arch" type="xml">
185                 <search string="Search for mrp workcenter">
186                    <group col='15' colspan='4'>
187                         <filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
188                         <separator orientation="vertical"/>
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                         <separator orientation="vertical" groups="base.group_multi_company"/>
197                         <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
198                     </group>
199                </search>
200             </field>
201         </record>
202
203         <record id="mrp_workcenter_action" model="ir.actions.act_window">
204             <field name="name">Work Centers</field>
205             <field name="type">ir.actions.act_window</field>
206             <field name="res_model">mrp.workcenter</field>
207             <field name="view_type">form</field>
208             <field name="view_id" ref="mrp_workcenter_tree_view"/>
209             <field name="search_view_id" ref="view_mrp_workcenter_search"/>
210             <field name="help">Work Centers 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>
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="name"/>
225                     <field name="workcenter_id"/>
226                     <field name="cycle_nbr"/>
227                     <field name="hour_nbr"/>
228                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
229                 </tree>
230             </field>
231         </record>
232
233         <record id="mrp_routing_workcenter_form_view" model="ir.ui.view">
234             <field name="name">mrp.routing.workcenter.form</field>
235             <field name="model">mrp.routing.workcenter</field>
236             <field name="type">form</field>
237             <field name="arch" type="xml">
238                 <form string="Routing Work Centers">
239                     <separator colspan="4" string="General Information"/>
240                     <field colspan="4" name="name" select="1"/>
241                     <field name="sequence" select="1"/>
242                     <field name="workcenter_id" select="1" widget="selection"/>
243                     <field name="cycle_nbr"/>
244                     <field name="hour_nbr" widget="float_time"/>
245                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
246                     <separator colspan="4" string="Description"/>
247                     <field colspan="4" name="note" nolabel="1"/>
248                 </form>
249             </field>
250         </record>
251
252         <record id="mrp_routing_form_view" model="ir.ui.view">
253             <field name="name">mrp.routing.form</field>
254             <field name="model">mrp.routing</field>
255             <field name="type">form</field>
256             <field name="arch" type="xml">
257                 <form string="Routing">
258                     <group colspan="4" col="6">
259                         <field name="name"/>
260                         <field name="code"/>
261                         <field name="active" groups="base.group_extended"/>
262                         <field name="location_id"/>
263                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
264                     </group>
265                     <notebook colspan="4">
266                         <page string="Work Center Operations">
267                            <field colspan="4" name="workcenter_lines" nolabel="1" widget="one2many_list"/>
268                         </page>
269                         <page string="Notes">
270                            <field colspan="4" name="note" nolabel="1"/>
271                         </page>
272                     </notebook>
273                 </form>
274             </field>
275         </record>
276         <record id="mrp_routing_tree_view" model="ir.ui.view">
277             <field name="name">mrp.routing.tree</field>
278             <field name="model">mrp.routing</field>
279             <field name="type">tree</field>
280             <field name="arch" type="xml">
281                 <tree string="Routing">
282                     <field name="code"/>
283                     <field name="name"/>
284                     <field name="location_id"/>
285                     <field name="company_id" groups="base.group_multi_company"/>
286                 </tree>
287             </field>
288         </record>
289         <record id="mrp_routing_search_view" model="ir.ui.view">
290             <field name="name">mrp.routing.search</field>
291             <field name="model">mrp.routing</field>
292             <field name="type">search</field>
293             <field name="arch" type="xml">
294                 <search string="Routing">
295                     <filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
296                     <separator orientation="vertical"/>
297                     <field name="code"/>
298                     <field name="name"/>
299                     <field name="location_id"/>
300                     <field name="company_id" groups="base.group_multi_company"/>
301                     <newline/>
302                     <group expand="0" string="Group By..." colspan="4" col="8" groups="base.group_extended">
303                         <filter string="Production Location" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'location_id'}"/>
304                     </group>
305                 </search>
306             </field>
307         </record>
308         <record id="mrp_routing_action" model="ir.actions.act_window">
309             <field name="name">Routings</field>
310             <field name="type">ir.actions.act_window</field>
311             <field name="res_model">mrp.routing</field>
312             <field name="view_type">form</field>
313             <field name="view_id" ref="mrp_routing_tree_view"/>
314             <field name="search_view_id" ref="mrp_routing_search_view"/>
315             <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>
316         </record>
317         <menuitem action="mrp_workcenter_action" id="menu_mrp_workcenter_action" parent="mrp.menu_mrp_property" groups="base.group_extended" sequence="40" />
318         <menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_property" groups="base.group_extended" sequence="30"/>
319
320         <!--
321           Bill of Materials
322         -->
323
324         <record id="mrp_bom_form_view" model="ir.ui.view">
325             <field name="name">mrp.bom.form</field>
326             <field name="model">mrp.bom</field>
327             <field name="type">form</field>
328             <field name="arch" type="xml">
329                 <form string="Bill of Material">
330                     <group colspan="4" col="6">
331                         <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
332                         <field name="name" select="1"/>
333                         <field name="code" select="1" string="Reference" groups="base.group_extended"/>
334                         <newline/>
335                         <field name="product_qty"/>
336                         <field name="product_uom" widget="selection"/>
337                         <field name="routing_id" widget="selection" groups="base.group_extended"/>
338                         <newline/>
339                         <field name="product_uos_qty" groups="product.group_uos" />
340                         <field name="product_uos" widget="selection" groups="product.group_uos"/>
341                         <newline/>
342                         <field name="type" groups="base.group_extended"/>
343                         <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
344                     </group>
345                     <notebook colspan="4" >
346                         <page string="Components">
347                             <field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list">
348                                 <tree string="Components" editable="bottom">
349                                     <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
350                                     <field name="product_qty"/>
351                                     <field name="product_uom"/>
352                                     <field name="name" invisible="1"/>
353                                     <field name="date_start"/>
354                                     <field name="date_stop"/>
355                                 </tree>
356                             </field>
357                         </page>
358                         <page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False)]}">
359                             <field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
360                         </page>
361                         <page string="Properties" groups="base.group_extended">
362                             <field name="position"/>
363                             <field name="active"/>
364                             <field name="sequence"/>
365                             <field name="bom_id"/>
366
367                             <field name="date_start"/>
368                             <field name="date_stop"/>
369                             <field name="product_rounding"/>
370                             <field name="product_efficiency" groups="base.group_extended"/>
371                             <field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
372                         </page>
373                     </notebook>
374                 </form>
375             </field>
376         </record>
377
378         <record id="view_mrp_bom_filter" model="ir.ui.view">
379             <field name="name">mrp.bom.select</field>
380             <field name="model">mrp.bom</field>
381            <field name="type">search</field>
382             <field name="arch" type="xml">
383                 <search string="Search Bill Of Material">
384                     <group col='4' colspan='4'>
385                          <field name="name"/>
386                          <field name="code" string="Reference"/>
387                          <field name="product_id"/>
388                          <field name="company_id" groups="base.group_multi_company"/>
389                     </group>
390                     <newline/>
391                     <group expand="0" string="Group By..." colspan="4" col="8" groups="base.group_extended">
392                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
393                         <filter string='Default UOM' icon="terp-mrp" domain="[]" context="{'group_by' : 'product_uom'}" />
394                         <separator orientation="vertical"/>
395                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}"/>
396                         <filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}" />
397                         <separator orientation="vertical"/>
398                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}" help="Starting Date"/>
399                    </group>
400                 </search>
401             </field>
402         </record>
403
404        <record id="mrp_bom_tree_view" model="ir.ui.view">
405             <field name="name">mrp.bom.tree</field>
406             <field name="model">mrp.bom</field>
407             <field name="type">tree</field>
408             <field name="field_parent">child_complete_ids</field>
409             <field name="arch" type="xml">
410                 <tree string="BoM Structure" colors="blue:method">
411                     <field name="sequence" invisible="1"/>
412                     <field name="name"/>
413                     <field name="code"/>
414                     <field name="product_id"/>
415                     <field name="product_qty"/>
416                     <field name="product_uom"/>
417                     <field name="type"/>
418                     <field name="method" groups="base.group_extended"/>
419                     <field name="routing_id" groups="base.group_extended"/>
420                     <field name="date_start" groups="base.group_extended"/>
421                     <field name="date_stop" groups="base.group_extended"/>
422                 </tree>
423             </field>
424         </record>
425         <record id="mrp_bom_form_action" model="ir.actions.act_window">
426             <field name="name">Bill of Materials</field>
427             <field name="type">ir.actions.act_window</field>
428             <field name="res_model">mrp.bom</field>
429             <field name="view_type">form</field>
430             <field name="domain">[('bom_id','=',False)]</field>
431             <field name="search_view_id" ref="view_mrp_bom_filter"/>
432             <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>
433         </record>
434         <record id="mrp_bom_form_action2" model="ir.actions.act_window">
435             <field name="name">Bill of Material Components</field>
436             <field name="type">ir.actions.act_window</field>
437             <field name="res_model">mrp.bom</field>
438             <field name="view_type">form</field>
439             <field name="domain">[('bom_id','!=',False)]</field>
440             <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>
441         </record>
442
443         <!-- BOM menus -->
444
445         <menuitem
446             action="mrp_bom_form_action"
447             id="menu_mrp_bom_form_action"
448             parent="menu_mrp_bom"
449             groups="mrp.group_mrp_user,mrp.group_mrp_manager"
450             sequence="10"/>
451         <menuitem
452             action="mrp_bom_form_action2"
453             id="menu_mrp_bom_form_action2"
454             groups="base.group_extended"
455             parent="menu_mrp_bom"
456             sequence="20"/>
457
458         <record id="action2" model="ir.actions.act_window">
459             <field name="name">Bill of Materials Structure</field>
460             <field name="type">ir.actions.act_window</field>
461             <field name="res_model">mrp.bom</field>
462             <field name="domain">[('id','=',active_id)]</field>
463             <field name="view_type">tree</field>
464             <field name="view_id" ref="mrp_bom_tree_view"/>
465         </record>
466         <record id="ir_BOM_structure" model="ir.values">
467             <field eval="'client_action_multi'" name="key2"/>
468             <field eval="'mrp.bom'" name="model"/>
469             <field name="name">Bill of Materials Structure</field>
470             <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
471             <field eval="True" name="object"/>
472         </record>
473
474         <record id="mrp_bom_revision_tree" model="ir.ui.view">
475             <field name="name">mrp.bom.revision</field>
476             <field name="model">mrp.bom.revision</field>
477             <field name="type">tree</field>
478             <field name="arch" type="xml">
479                 <tree string="BoM Revisions">
480                     <field name="indice"/>
481                     <field name="author_id"/>
482                     <field name="date"/>
483                     <field colspan="4" name="name"/>
484                 </tree>
485             </field>
486         </record>
487         <record id="mrp_bom_revision_form" model="ir.ui.view">
488             <field name="name">mrp.bom.revision</field>
489             <field name="model">mrp.bom.revision</field>
490             <field name="type">form</field>
491             <field name="arch" type="xml">
492                 <form string="BoM Revisions">
493                     <field colspan="4" name="name"/>
494                     <field colspan="1" name="indice"/>
495                     <field colspan="1" name="date"/>
496                     <field name="author_id" readonly="1"/>
497                     <separator colspan="4" string="Description"/>
498                     <field colspan="4" name="description" nolabel="1"/>
499                 </form>
500             </field>
501         </record>
502
503         <!--
504         Production Management
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="date_planned"/>
514                     <field name="product_id"/>
515                     <field name="product_qty" sum="Total Qty"/>
516                     <field name="product_uom"/>
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_finished" 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" widget="selection"/>
583                         <button type="action"
584                             icon="terp-accessories-archiver+"
585                             name="%(mrp.action_change_production_qty)d"
586                             string="Change Qty" states="ready,confirmed" />
587                         </group>
588                         <label string="" colspan="2"/>
589                         <field name="product_uos_qty" groups="product.group_uos"/>
590                         <field name="product_uos" groups="product.group_uos"/>
591                     </group>
592
593                     <notebook colspan="4">
594                         <page string="Consumed Products">
595                             <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)" widget="selection"/>
596                             <field name="routing_id" groups="base.group_extended" select="1" widget="selection"/>
597                             <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)" widget="selection"/>
598                             <field name="location_dest_id" domain="[('usage','=','internal')]" widget="selection"/>
599                             <separator string="" colspan="4"/>
600
601                             <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
602                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
603                                 <tree colors="blue:state in ('draft');black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
604                                     <field name="product_id" />
605                                     <field name="product_qty"  string="Qty"/>
606                                     <field name="product_uom"  string="UOM" widget="selection"/>
607                                     <field name="location_id"  string="Source Loc." widget="selection"/>
608                                     <field name="state" invisible="1"/>
609                                     <button name="%(stock.move_consume)d"
610                                         string="Consume Products" type="action"
611                                         icon="gtk-go-forward" context="{'consume': True}"
612                                         states="draft,waiting,confirmed,assigned" />
613                                     <button name="%(stock.move_scrap)d"
614                                         string="Scrap Products" type="action"
615                                         icon="gtk-convert" context="{'scrap': True}"
616                                         states="draft,waiting,confirmed,assigned"/>
617                                 </tree>
618                             </field>
619
620                             <field colspan="2" name="move_lines2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
621                                        widget="one2many_list" mode="tree,form" height="275">
622                                    <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">
623                                        <field name="product_id" readonly="1"/>
624                                        <field name="product_qty" readonly="1" string="Qty"/>
625                                        <field name="product_uom" readonly="1" string="UOM" widget="selection"/>
626                                        <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection"/>
627                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
628                                        <field name="state" invisible="1"/>
629                                        <field name="scrapped" invisible="1"/>
630                                        <button
631                                            name="%(stock.track_line)d"
632                                            string="Split in production lots"
633                                            type="action" icon="gtk-justify-fill"
634                                            states="done,cancel" />
635                                        <button
636                                            name="%(stock.move_scrap)d"
637                                            string="Scrap Products" type="action"
638                                            icon="gtk-convert"
639                                            states="done,cancel"/>
640                                    </tree>
641                                </field>
642                             <separator colspan="4"/>
643                             <group col="9" colspan="4">
644                                 <field name="state"/>
645                                 <button name="button_cancel" states="draft,ready,confirmed,in_production,picking_except" string="Cancel" icon="gtk-stop"/>
646                                 <button name="action_compute" states="draft" string="Compute Data" type="object" icon="terp-stock_format-scientific"/>
647                                 <button name="button_confirm" states="draft" string="Confirm Production" icon="gtk-apply"/>
648                                 <button name="button_produce" states="ready" string="Start Production" icon="terp-gtk-jump-to-ltr"/>
649                                 <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" icon="gtk-ok" type="action"/>
650                                 <button name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object" icon="gtk-jump-to"/>
651                                 <button name="button_recreate" states="picking_except" string="Recreate Picking" icon="terp-document-new"/>
652                             </group>
653                         </page>
654                         <page string="Finished Products">
655                             <field colspan="2" name="move_created_ids" nolabel="1" widget="one2many_list"
656                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
657                                 <tree string="Products to Finish">
658                                     <field name="product_id" />
659                                     <field name="product_qty"  string="Qty"/>
660                                     <field name="product_uom"  string="UOM" widget="selection"/>
661                                     <field name="location_id"  string="Source Loc." widget="selection"/>
662                                     <field name="state" invisible="1"/>
663                                     <button name="%(stock.action_partial_move)d" 
664                                         string="Partial" 
665                                         type="action" states="confirmed,assigned" 
666                                         icon="gtk-justify-fill"/>
667                                     <button name="%(stock.move_scrap)d"
668                                         string="Scrap Products" type="action"
669                                         icon="gtk-convert" context="{'scrap': True}"
670                                         states="draft,waiting,confirmed,assigned" />
671                                 </tree>
672                             </field>
673
674                             <field colspan="2" name="move_created_ids2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
675                                        widget="one2many_list" mode="tree,form" height="275">
676                                    <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">
677                                        <field name="product_id" readonly="1"/>
678                                        <field name="product_qty" readonly="1" string="Qty"/>
679                                        <field name="product_uom" readonly="1" string="UOM" widget="selection"/>
680                                        <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection"/>
681                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
682                                        <field name="scrapped" invisible="1"/>
683                                        <field name="state" invisible="1"/>
684                                        <button name="%(stock.track_line)d"
685                                             string="Split in production lots" type="action" icon="gtk-justify-fill" states="done,cancel"/>
686                                        <button name="%(stock.move_scrap)d"
687                                            string="Scrap Products" type="action" icon="gtk-convert"
688                                            states="done,cancel" />
689                                    </tree>
690                                </field>
691                         </page>
692                         <page string="Work Orders" groups="base.group_extended">
693                             <field colspan="4" name="workcenter_lines" nolabel="1">
694                                 <form string="Production Work Centers">
695                                     <field colspan="4" name="name"/>
696                                     <field name="workcenter_id" widget="selection"/>
697                                     <field name="sequence"/>
698                                     <field name="cycle"/>
699                                     <field name="hour"/>
700                                 </form>
701                                 <tree string="Production Work Centers">
702                                     <field name="sequence"/>
703                                     <field name="name"/>
704                                     <field name="workcenter_id" widget="selection"/>
705                                     <field name="cycle"/>
706                                     <field name="hour"/>
707                                 </tree>
708                             </field>
709                         </page>
710                         <page string="Scheduled Products">
711                             <field colspan="4" name="product_lines" nolabel="1" widget="one2many_list"/>
712                         </page>
713                         <page string="Extra Information">
714                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
715                             <field name="priority" groups="base.group_extended"/>
716                             <newline/>
717                             <field name="date_start"/>
718                             <field name="date_finished"/>
719                             <field name="picking_id" groups="base.group_extended"/>
720                             <field name="move_prod_id" groups="base.group_extended"/>
721                         </page>
722                     </notebook>
723                 </form>
724             </field>
725         </record>
726
727         <record id="view_mrp_production_filter" model="ir.ui.view">
728             <field name="name">mrp.production.select</field>
729             <field name="model">mrp.production</field>
730             <field name="type">search</field>
731             <field name="arch" type="xml">
732                 <search string="Search Production">
733                    <group col='9' colspan='4'>
734                        <filter icon="terp-document-new" string="Draft"
735                            domain="[('state','=','draft')]"
736                            help="Non confirmed manufacturing orders"/>
737                        <filter icon="terp-check" string="Current" name="current"
738                            default="1"
739                            domain="[('state','in',('confirmed','ready','exception','in_production'))]"
740                            help="Manufacturing Orders which are waiting for raw materials, confirmed, ready to start or currently 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                         <separator orientation="vertical"/>
755                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}" groups="base.group_extended"/>
756                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
757                         <separator orientation="vertical"/>
758                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}" help="Scheduled Date"/>
759                     </group>
760                </search>
761             </field>
762         </record>
763
764         <record id="mrp_production_action" model="ir.actions.act_window">
765             <field name="name">Manufacturing Orders</field>
766             <field name="type">ir.actions.act_window</field>
767             <field name="res_model">mrp.production</field>
768             <field name="view_type">form</field>
769             <field name="view_mode">tree,form,calendar,graph,gantt</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 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>
774         </record>
775         <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"/>
776
777         <record id="mrp_production_action_planning" model="ir.actions.act_window">
778             <field name="name">Manufacturing Orders</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">calendar,tree,form,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="[('bom_id','=',False)]"
918             context="{'search_default_product_id': [active_id]}"
919             id="act_product_product_2_mrp_bom"
920             name="Bill of Materials"
921             res_model="mrp.bom"
922             src_model="product.product"/>
923
924         <!-- Menu for Resource for MRP-->
925
926         <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration"/>
927         <menuitem action="resource.action_resource_resource_tree" id="menu_view_resource_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
928         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
929         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
930         
931         <!-- Planning -->
932         
933         <menuitem id="menu_mrp_planning" name="Planning"
934                         parent="base.menu_mrp_root" sequence="2"
935                         groups="base.group_extended"/>
936                 <menuitem action="mrp.mrp_production_action_planning"
937                         id="menu_mrp_production_order_action"
938                         parent="menu_mrp_planning" sequence="1"
939                         groups="base.group_extended"/>
940
941     </data>
942 </openerp>