[FIX] error reporting in _.sprintf
[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="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="1" 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','in',active_ids)]</field>
524             <field name="view_type">tree</field>
525             <field name="view_mode">tree</field>
526             <field name="view_id" ref="mrp_bom_tree_view"/>
527         </record>
528         <record id="ir_BOM_structure" model="ir.values">
529             <field eval="'client_action_multi'" name="key2"/>
530             <field eval="'mrp.bom'" name="model"/>
531             <field name="name">Bill of Materials Structure</field>
532             <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
533         </record>
534
535         <record id="mrp_bom_revision_tree" model="ir.ui.view">
536             <field name="name">mrp.bom.revision</field>
537             <field name="model">mrp.bom.revision</field>
538             <field name="type">tree</field>
539             <field name="arch" type="xml">
540                 <tree string="BoM Revisions">
541                     <field name="indice"/>
542                     <field name="author_id"/>
543                     <field name="date"/>
544                     <field colspan="4" name="name"/>
545                 </tree>
546             </field>
547         </record>
548         <record id="mrp_bom_revision_form" model="ir.ui.view">
549             <field name="name">mrp.bom.revision</field>
550             <field name="model">mrp.bom.revision</field>
551             <field name="type">form</field>
552             <field name="arch" type="xml">
553                 <form string="BoM Revisions">
554                     <field colspan="4" name="name"/>
555                     <field colspan="1" name="indice"/>
556                     <field colspan="1" name="date"/>
557                     <field name="author_id" readonly="1"/>
558                     <separator colspan="4" string="Description"/>
559                     <field colspan="4" name="description" nolabel="1"/>
560                 </form>
561             </field>
562         </record>
563
564         <!--
565         Production Management
566         -->
567         <record id="mrp_production_tree_view" model="ir.ui.view">
568             <field name="name">mrp.production.tree</field>
569             <field name="model">mrp.production</field>
570             <field name="type">tree</field>
571             <field name="arch" type="xml">
572                 <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">
573                     <field name="name"/>
574                     <field name="date_planned"/>
575                     <field name="product_id"/>
576                     <field name="product_qty" sum="Total Qty"/>
577                     <field name="product_uom"/>
578                     <field name="routing_id" groups="base.group_extended"/>
579                     <field name="hour_total" sum="Total Hours" groups="base.group_extended"/>
580                     <field name="cycle_total" sum="Total Cycles" groups="base.group_extended"/>
581                     <field name="origin"/>
582                     <field name="state"/>
583                 </tree>
584             </field>
585         </record>
586
587         <record id="view_production_calendar" model="ir.ui.view">
588             <field name="name">mrp.production.calendar</field>
589             <field name="model">mrp.production</field>
590             <field name="type">calendar</field>
591             <field eval="2" name="priority"/>
592             <field name="arch" type="xml">
593                 <calendar color="routing_id" date_start="date_planned" string="Manufacturing Orders">
594                     <field name="name"/>
595                     <field name="product_id"/>
596                     <field name="product_qty"/>
597                 </calendar>
598             </field>
599         </record>
600
601
602         <record id="view_production_gantt" model="ir.ui.view">
603             <field name="name">mrp.production.gantt</field>
604             <field name="model">mrp.production</field>
605             <field name="type">gantt</field>
606             <field name="arch" type="xml">
607                 <gantt color="product_id" date_stop="date_finished" date_start="date_start" string="Productions">
608                     <level object="mrp.routing" link="routing_id" domain="[]">
609                         <field name="name"/>
610                         <field name="origin"/>
611                     </level>
612                 </gantt>
613             </field>
614         </record>
615
616
617         <record model="ir.ui.view" id="view_production_graph">
618             <field name="name">mrp.production.graph</field>
619             <field name="model">mrp.production</field>
620             <field name="type">graph</field>
621             <field name="arch" type="xml">
622                 <graph string="Manufacturing Orders" type="bar">
623                     <field name="date_planned_date"/>
624                     <field name="hour_total" operator="+"/>
625                     <field name="cycle_total" operator="+"/>
626                 </graph>
627             </field>
628         </record>
629
630         <record id="mrp_production_form_view" model="ir.ui.view">
631             <field name="name">mrp.production.form</field>
632             <field name="model">mrp.production</field>
633             <field name="type">form</field>
634             <field name="arch" type="xml">
635                 <form string="Manufacturing Orders">
636                     <group colspan="4" col="7">
637                         <field name="name" string="Reference"/>
638                         <field name="date_planned"/>
639                         <field name="origin"/>
640                         <newline/>
641                         <field name="product_id" on_change="product_id_change(product_id)"/>
642                         <field name="product_qty"/>
643                         <field name="product_uom"/>
644                         <button type="action"
645                             icon="terp-accessories-archiver+"
646                             name="%(mrp.action_change_production_qty)d"
647                             string="Change Qty" states="ready,confirmed" />
648                         <label string="" colspan="2"/>
649                         <field name="product_uos_qty" groups="product.group_uos"/>
650                         <field name="product_uos" groups="product.group_uos"/>
651                     </group>
652
653                     <notebook colspan="4">
654                         <page string="Consumed Products">
655                             <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
656                             <field name="routing_id" groups="base.group_extended" select="1"/>
657                             <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
658                             <field name="location_dest_id" domain="[('usage','=','internal')]"/>
659                             <separator string="" colspan="4"/>
660
661                             <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
662                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
663                                 <tree colors="blue:state == 'draft';black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
664                                     <field name="product_id" />
665                                     <field name="product_qty"  string="Qty"/>
666                                     <field name="product_uom"  string="UOM"/>
667                                     <field name="location_id"  string="Source Loc."/>
668                                     <field name="state" invisible="1"/>
669                                     <button name="%(stock.move_consume)d"
670                                         string="Consume Products" type="action"
671                                         icon="gtk-go-forward" context="{'consume': True}"
672                                         states="draft,waiting,confirmed,assigned" />
673                                     <button
674                                            name="%(stock.track_line)d"
675                                            string="Split in production lots"
676                                            type="action" icon="gtk-justify-fill"
677                                            states="draft,waiting,confirmed,assigned" />
678                                     <button name="%(stock.move_scrap)d"
679                                         string="Scrap Products" type="action"
680                                         icon="gtk-convert" context="{'scrap': True}"
681                                         states="draft,waiting,confirmed,assigned"/>
682                                 </tree>
683                             </field>
684
685                             <field colspan="2" name="move_lines2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
686                                        widget="one2many_list" mode="tree,form" height="275">
687                                    <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">
688                                        <field name="product_id" readonly="1"/>
689                                        <field name="product_qty" readonly="1" string="Qty"/>
690                                        <field name="product_uom" readonly="1" string="UOM"/>
691                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
692                                        <field name="state" invisible="1"/>
693                                        <field name="scrapped" invisible="1"/>
694                                        <button
695                                            name="%(stock.move_scrap)d"
696                                            string="Scrap Products" type="action"
697                                            icon="gtk-convert"
698                                            states="done,cancel"/>
699                                    </tree>
700                                </field>
701                             <separator colspan="4"/>
702                             <group col="9" colspan="4">
703                                 <field name="state" widget="statusbar" statusbar_visible="draft,ready,in_production,done" statusbar_colors='{"picking_except":"red","confirmed":"blue"}'/>
704                                 <button name="button_cancel" states="draft,ready,in_production,picking_except" string="Cancel" icon="gtk-stop"/>
705                                 <button name="action_cancel" type="object" states="confirmed" string="Cancel" icon="gtk-stop"/>
706                                 <button name="button_confirm" states="draft" string="Confirm Production" icon="gtk-apply"/>
707                                 <button name="button_produce" states="ready" string="Start Production" icon="terp-gtk-jump-to-ltr"/>
708                                 <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" icon="gtk-ok" type="action"/>
709                                 <button name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object" icon="gtk-jump-to"/>
710                                 <button name="button_recreate" states="picking_except" string="Recreate Picking" icon="terp-document-new"/>
711                             </group>
712                         </page>
713                         <page string="Finished Products">
714                             <field colspan="2" name="move_created_ids" nolabel="1" widget="one2many_list"
715                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
716                                 <tree string="Products to Finish">
717                                     <field name="product_id" />
718                                     <field name="product_qty"  string="Qty"/>
719                                     <field name="product_uom"  string="UOM"/>
720                                     <field name="state" invisible="1"/>
721                                     <button name="%(stock.action_partial_move_server)d"
722                                         string="Partial"
723                                         type="action" states="confirmed,assigned"
724                                         icon="gtk-justify-fill"/>
725                                     <button name="%(stock.move_scrap)d"
726                                         string="Scrap Products" type="action"
727                                         icon="gtk-convert" context="{'scrap': True}"
728                                         states="draft,waiting,confirmed,assigned" />
729                                 </tree>
730                             </field>
731
732                             <field colspan="2" name="move_created_ids2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
733                                        widget="one2many_list" mode="tree,form" height="275">
734                                    <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">
735                                        <field name="product_id" readonly="1"/>
736                                        <field name="product_qty" readonly="1" string="Qty"/>
737                                        <field name="product_uom" readonly="1" string="UOM"/>
738                                        <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection"/>
739                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
740                                        <field name="scrapped" invisible="1"/>
741                                        <field name="state" invisible="1"/>
742                                        <button name="%(stock.track_line)d"
743                                             string="Split in production lots" type="action" icon="gtk-justify-fill" states="done,cancel"/>
744                                        <button name="%(stock.move_scrap)d"
745                                            string="Scrap Products" type="action" icon="gtk-convert"
746                                            states="done,cancel" />
747                                    </tree>
748                                </field>
749                         </page>
750                         <page string="Work Orders" groups="base.group_extended">
751                             <button name="action_compute" states="draft"
752                                 string="Compute Data" type="object"
753                                 icon="terp-stock_format-scientific"
754                                 colspan="2" />
755                             <field colspan="4" name="workcenter_lines" nolabel="1">
756                                 <form string="Production Work Centers">
757                                     <field colspan="4" name="name"/>
758                                     <field name="workcenter_id" widget="selection"/>
759                                     <field name="sequence"/>
760                                     <field name="cycle"/>
761                                     <field name="hour"/>
762                                 </form>
763                                 <tree string="Production Work Centers">
764                                     <field name="sequence"/>
765                                     <field name="name"/>
766                                     <field name="workcenter_id" widget="selection"/>
767                                     <field name="cycle"/>
768                                     <field name="hour"/>
769                                 </tree>
770                             </field>
771                         </page>
772                         <page string="Scheduled Products">
773                             <button name="action_compute" states="draft"
774                                 string="Compute Data" type="object"
775                                 icon="terp-stock_format-scientific"
776                                 colspan="2" />
777                             <field colspan="4" name="product_lines" nolabel="1" widget="one2many_list"/>
778                         </page>
779                         <page string="Extra Information">
780                             <field name="user_id"/>
781                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
782                             <field name="priority" groups="base.group_extended"/>
783                             <newline/>
784                             <field name="date_start"/>
785                             <field name="date_finished"/>
786                             <field name="picking_id" groups="base.group_extended"/>
787                             <field name="move_prod_id" groups="base.group_extended"/>
788                         </page>
789                     </notebook>
790                 </form>
791             </field>
792         </record>
793
794         <record id="view_mrp_production_filter" model="ir.ui.view">
795             <field name="name">mrp.production.select</field>
796             <field name="model">mrp.production</field>
797             <field name="type">search</field>
798             <field name="arch" type="xml">
799                 <search string="Search Production">
800                    <group>
801                        <filter icon="terp-gtk-media-pause" string="Pending" name="pending"
802                            domain="[('state','=','confirmed')]"
803                            help="Manufacturing Orders which are waiting for raw materials."/>
804                        <filter icon="terp-camera_test" string="Ready" name="ready"
805                            domain="[('state','=','ready')]"
806                            help="Manufacturing Orders which are ready to start production."/>
807                        <filter icon="terp-check" string="In Production" name="inprogress"
808                            domain="[('state','=','in_production')]"
809                            help="Manufacturing Orders which are currently in production."/>
810                        <separator orientation="vertical"/>
811                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
812                            domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
813                            help="Production started late" />
814                        <separator orientation="vertical"/>
815                        <field name="name"/>
816                        <field name="product_id"/>
817                        <field name="routing_id" groups="base.group_extended"/>
818                        <field name="origin"/>
819                     </group>
820                     <newline/>
821                     <group expand="0" string="Group By..." groups="base.group_extended">
822                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
823                         <separator orientation="vertical"/>
824                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}" groups="base.group_extended"/>
825                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
826                         <separator orientation="vertical"/>
827                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}" help="Scheduled Date"/>
828                     </group>
829                </search>
830             </field>
831         </record>
832
833         <record id="mrp_production_action" model="ir.actions.act_window">
834             <field name="name">Manufacturing Orders</field>
835             <field name="type">ir.actions.act_window</field>
836             <field name="res_model">mrp.production</field>
837             <field name="view_type">form</field>
838             <field name="view_mode">tree,form,calendar,graph,gantt</field>
839             <field name="view_id" eval="False"/>
840             <field name="search_view_id" ref="view_mrp_production_filter"/>
841             <field name="context">{'search_default_ready':1}</field>
842             <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>
843         </record>
844         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
845             parent="menu_mrp_manufacturing" sequence="1"/>
846
847         <record id="mrp_production_action_planning" model="ir.actions.act_window">
848             <field name="name">Manufacturing Orders</field>
849             <field name="type">ir.actions.act_window</field>
850             <field name="res_model">mrp.production</field>
851             <field name="view_type">form</field>
852             <field name="view_mode">calendar,tree,form,graph</field>
853             <field name="domain">[('state','in',('ready','confirmed','in_production'))]</field>
854             <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>
855         </record>
856
857         <record id="mrp_production_action2" model="ir.actions.act_window">
858             <field name="name">Manufacturing Orders To Start</field>
859             <field name="type">ir.actions.act_window</field>
860             <field name="res_model">mrp.production</field>
861             <field name="view_type">form</field>
862             <field name="view_mode">tree,form,calendar,graph,gantt</field>
863             <field name="domain">[('state','=','ready')]</field>
864             <field name="filter" eval="True"/>
865             <field name="search_view_id" ref="view_mrp_production_filter"/>
866         </record>
867
868         <record id="mrp_production_action3" model="ir.actions.act_window">
869             <field name="name">Manufacturing Orders in Progress</field>
870             <field name="type">ir.actions.act_window</field>
871             <field name="res_model">mrp.production</field>
872             <field name="view_type">form</field>
873             <field name="view_mode">tree,form,calendar,graph,gantt</field>
874             <field name="domain">[('state','=','in_production')]</field>
875             <field name="filter" eval="True"/>
876             <field name="search_view_id" ref="view_mrp_production_filter"/>
877         </record>
878
879         <record id="mrp_production_action4" model="ir.actions.act_window">
880             <field name="name">Manufacturing Orders Waiting Products</field>
881             <field name="type">ir.actions.act_window</field>
882             <field name="res_model">mrp.production</field>
883             <field name="view_type">form</field>
884             <field name="view_mode">tree,form,calendar,graph,gantt</field>
885             <field name="domain">[('state','=','confirmed')]</field>
886             <field name="filter" eval="True"/>
887             <field name="search_view_id" ref="view_mrp_production_filter"/>
888         </record>
889
890         <record id="mrp_production_lot_form_view" model="ir.ui.view">
891             <field name="name">mrp.production.lot.line.form</field>
892             <field name="model">mrp.production.lot.line</field>
893             <field name="type">form</field>
894             <field name="arch" type="xml">
895                 <form string="Production Products">
896                     <field colspan="4" name="move_id" on_change="onchange_lot_line_id(lot_id)"/>
897                     <field name="name"/>
898                     <field name="product_id"/>
899                     <field name="product_qty"/>
900                     <field name="product_uom"/>
901                     <field name="product_uos_qty" groups="product.group_uos"/>
902                     <field name="product_uos" groups="product.group_uos"/>
903                     <field name="tracking_id"/>
904                 </form>
905             </field>
906         </record>
907         <record id="mrp_production_lot_tree_view" model="ir.ui.view">
908             <field name="name">mrp.production.lot.line.tree</field>
909             <field name="model">mrp.production.lot.line</field>
910             <field name="type">tree</field>
911             <field name="arch" type="xml">
912                 <tree string="Production Products Consommation">
913                     <field name="product_id"/>
914                     <field name="product_qty"/>
915                     <field name="product_uom"/>
916                     <field name="product_uos_qty" groups="product.group_uos"/>
917                     <field name="product_uos" groups="product.group_uos"/>
918                     <field name="tracking_id"/>
919                 </tree>
920             </field>
921         </record>
922
923         <record id="mrp_production_product_form_view" model="ir.ui.view">
924             <field name="name">mrp.production.product.line.form</field>
925             <field name="model">mrp.production.product.line</field>
926             <field name="type">form</field>
927             <field name="arch" type="xml">
928                 <form string="Scheduled Products">
929                     <field name="name"/>
930                     <field name="product_id"/>
931                     <field name="product_qty"/>
932                     <field name="product_uom"/>
933                     <field name="product_uos_qty" groups="product.group_uos"/>
934                     <field name="product_uos" groups="product.group_uos"/>
935                 </form>
936             </field>
937         </record>
938         <record id="mrp_production_product_tree_view" model="ir.ui.view">
939             <field name="name">mrp.production.product.line.tree</field>
940             <field name="model">mrp.production.product.line</field>
941             <field name="type">tree</field>
942             <field name="arch" type="xml">
943                 <tree string="Scheduled Products">
944                     <field name="product_id"/>
945                     <field name="product_qty"/>
946                     <field name="product_uom"/>
947                     <field name="product_uos_qty" groups="product.group_uos"/>
948                     <field name="product_uos" groups="product.group_uos"/>
949                 </tree>
950             </field>
951         </record>
952
953         <!--
954             Procurements
955         -->
956
957         <record id="view_procurement_form_inherit" model="ir.ui.view">
958             <field name="name">procurement.order.form.inherit</field>
959             <field name="model">procurement.order</field>
960             <field name="inherit_id" ref="procurement.procurement_form_view"/>
961             <field name="type">form</field>
962             <field name="arch" type="xml">
963             <data>
964                 <xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
965                     <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
966                 </xpath>
967                 <xpath expr="/form/notebook/page/field[@name='close_move']" position="after">
968                     <group colspan="4"  groups="base.group_extended">
969                     <separator colspan="4" string="Properties" />
970                     <field colspan="4" name="property_ids" nolabel="1"/>
971                      </group>
972                 </xpath>
973                </data>
974             </field>
975         </record>
976
977         <act_window
978             context="{'search_default_product_id': [active_id]}"
979             id="act_product_manufacturing_open"
980             name="Manufacturing Orders"
981             view_id="mrp_production_tree_view"
982             res_model="mrp.production"
983             src_model="product.product"/>
984
985         <act_window
986             id="action_product_bom_structure"
987             name="Product BoM Structure"
988             domain="[('product_id', 'in', active_ids),('bom_id','=',False)]"
989             context="{'default_product_id': active_id}"
990             view_type="tree"
991             view_mode="tree"
992             view_id="mrp_bom_tree_view"
993             res_model="mrp.bom"
994             src_model="product.product"
995             groups="mrp.group_mrp_user"/>
996
997         <act_window
998             domain="[('bom_id','=',False)]"
999             context="{'search_default_product_id': [active_id],'default_product_id':active_id}"
1000             id="act_product_product_2_mrp_bom"
1001             name="Bill of Materials"
1002             res_model="mrp.bom"
1003             src_model="product.product"
1004             groups="mrp.group_mrp_user"/>
1005
1006         <!-- Menu for Resource for MRP-->
1007
1008         <record id="mrp_workcenter_action" model="ir.actions.act_window">
1009             <field name="name">Work Centers</field>
1010             <field name="type">ir.actions.act_window</field>
1011             <field name="res_model">mrp.workcenter</field>
1012             <field name="view_type">form</field>
1013             <field name="view_id" ref="mrp_workcenter_tree_view"/>
1014             <field name="search_view_id" ref="view_mrp_workcenter_search"/>
1015             <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>
1016         </record>
1017
1018         <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration"/>
1019         <menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
1020         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
1021         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
1022
1023         <!-- Planning -->
1024
1025         <menuitem id="menu_mrp_planning" name="Planning"
1026                 parent="base.menu_mrp_root" sequence="2"
1027                 groups="base.group_extended"/>
1028         <menuitem action="mrp.mrp_production_action_planning"
1029                 id="menu_mrp_production_order_action"
1030                 parent="menu_mrp_planning" sequence="1"/>
1031
1032     </data>
1033 </openerp>