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