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