[MERGE] forward port of branch 8.0 up to 591e329
[odoo/odoo.git] / addons / mrp / mrp_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!-- Top menu item -->
6         <menuitem name="Manufacturing"
7             id="base.menu_mrp_root"
8             groups="group_mrp_user,group_mrp_manager"
9             sequence="80"/>
10
11         <menuitem name="Manufacturing"
12             id="menu_mrp_manufacturing"
13             parent="base.menu_mrp_root"
14             sequence="1"/>
15
16         <menuitem name="Products"
17             id="menu_mrp_bom"
18             parent="base.menu_mrp_root"
19             sequence="5"/>
20
21         <!--
22         Property / Property Group
23         -->
24
25         <record id="mrp_property_group_form_view" model="ir.ui.view">
26             <field name="name">mrp.property.group.form</field>
27             <field name="model">mrp.property.group</field>
28             <field name="arch" type="xml">
29                 <form string="Properties categories">
30                     <group>
31                         <field name="name"/>
32                     </group>
33                     <separator string="Description"/>
34                     <field name="description" nolabel="1"/>
35                 </form>
36             </field>
37         </record>
38         <record id="mrp_property_group_action" model="ir.actions.act_window">
39             <field name="name">Property Groups</field>
40             <field name="type">ir.actions.act_window</field>
41             <field name="res_model">mrp.property.group</field>
42             <field name="view_type">form</field>
43             <field name="view_mode">tree,form</field>
44             <field name="help" type="html">
45               <p class="oe_view_nocontent_create">
46                 Click to create a group of properties.
47               </p><p>
48                 Define specific property groups that can be assigned to your
49                 bill of materials and sales orders. Properties allows Odoo
50                 to automatically select the right bill of materials according
51                 to properties selected in the sales order by salesperson.
52               </p><p>
53                 For instance, in the property group "Warranty", you an have
54                 two properties: 1 year warranty, 3 years warranty. Depending
55                 on the propoerties selected in the sales order, Odoo will
56                 schedule a production using the matching bill of materials.
57               </p>
58             </field>
59         </record>
60         <menuitem
61             id="menu_mrp_configuration"
62             name="Configuration"
63             parent="base.menu_mrp_root"
64             groups="group_mrp_manager"
65             sequence="50"/>
66         <menuitem
67             id="menu_mrp_configuration_manufacturing"
68             name="Manufacturing"
69             parent="menu_mrp_configuration"
70             groups="group_mrp_manager"
71             sequence="1"/>
72         <menuitem
73             id="menu_mrp_configuration_products"
74             name="Products"
75             parent="menu_mrp_configuration"
76             groups="group_mrp_manager"
77             sequence="2"/>
78
79
80
81         <record id="mrp_property_tree_view" model="ir.ui.view">
82             <field name="name">mrp.property.tree</field>
83             <field name="model">mrp.property</field>
84             <field name="arch" type="xml">
85                 <tree string="Properties">
86                     <field name="name"/>
87                     <field name="composition"/>
88                     <field name="group_id"/>
89                 </tree>
90             </field>
91         </record>
92         <record id="mrp_property_form_view" model="ir.ui.view">
93             <field name="name">mrp.property.form</field>
94             <field name="model">mrp.property</field>
95             <field name="arch" type="xml">
96                 <form string="Properties">
97                     <group col="4">
98                         <field colspan="4" name="name"/>
99                         <field name="group_id"/>
100                         <field name="composition"/>
101                     </group>
102                     <separator string="Description"/>
103                     <field name="description" nolabel="1"/>
104                 </form>
105             </field>
106         </record>
107
108         <record id="view_mrp_property_search" model="ir.ui.view">
109             <field name="name">mrp.property.search</field>
110             <field name="model">mrp.property</field>
111             <field name="arch" type="xml">
112                 <search string="Search">
113                     <field name="name" string="Name"/>
114                     <field name="composition"/>
115                     <field name="group_id" />
116                     <group expand="0" string="Group By">
117                         <filter string="Property Group" icon="terp-personal" domain="[]" context="{'group_by':'group_id'}"/>
118                     </group>
119                </search>
120             </field>
121         </record>
122
123
124         <record id="mrp_property_action" model="ir.actions.act_window">
125             <field name="name">Properties</field>
126             <field name="type">ir.actions.act_window</field>
127             <field name="res_model">mrp.property</field>
128             <field name="view_type">form</field>
129             <field name="view_mode">tree,form</field>
130             <field name="search_view_id" ref="view_mrp_property_search"/>
131             <field name="help" type="html">
132               <p class="oe_view_nocontent_create">
133                 Click to create a new property.
134               </p><p>
135                 The Properties in Odoo are used to select the right bill of
136                 materials for manufacturing a product when you have different
137                 ways of building the same product.  You can assign several
138                 properties to each bill of materials.  When a salesperson
139                 creates a sales order, they can relate it to several properties
140                 and Odoo will automatically select the BoM to use according
141                 the needs.
142               </p>
143             </field>
144         </record>
145         <menuitem name="Master Bill of Materials"
146             id="menu_mrp_property"
147             parent="menu_mrp_configuration"
148             groups="mrp.group_mrp_routings,product.group_mrp_properties"
149             sequence="20"/>
150         <menuitem
151             action="mrp_property_action"
152             id="menu_mrp_property_action"
153             groups="product.group_mrp_properties"
154             parent="menu_mrp_configuration_products"
155             sequence="30"/>
156         <menuitem
157             action="mrp_property_group_action"
158             parent="menu_mrp_configuration_products"
159             groups="base.group_no_one,product.group_mrp_properties"
160             id="menu_mrp_property_group_action"
161             sequence="35"/>
162
163         <!--
164         Work Centers
165         -->
166
167         <record id="mrp_workcenter_tree_view" model="ir.ui.view">
168             <field name="name">mrp.workcenter.tree</field>
169             <field name="model">mrp.workcenter</field>
170             <field name="arch" type="xml">
171                 <tree string="Work Center">
172                     <field name="code"/>
173                     <field name="name"/>
174                     <field name="resource_type"/>
175                     <field name="company_id" groups="base.group_multi_company"/>
176                 </tree>
177             </field>
178         </record>
179         <record id="mrp_workcenter_view" model="ir.ui.view">
180             <field name="name">mrp.workcenter.form</field>
181             <field name="model">mrp.workcenter</field>
182             <field name="arch" type="xml">
183                 <form string="Work Center">
184                     <group col="4">
185                         <group>
186                             <field name="name"/>
187                             <field name="resource_type"/>
188                             <field name="calendar_id" widget="selection"/>
189                         </group>
190                         <group>
191                             <field name="code"/>
192                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
193                             <field name="active"/>
194                         </group>
195                     </group>
196                     <notebook>
197                         <page string="General Information">
198                             <group>
199                                 <group string="Capacity Information">
200                                     <field name="time_efficiency"/>
201                                     <field name="capacity_per_cycle"/>
202                                     <field name="time_cycle" widget="float_time"/>
203                                     <field name="time_start" widget="float_time"/>
204                                     <field name="time_stop" widget="float_time"/>
205                                 </group>
206                                 <group string="Costing Information">
207                                     <field name="product_id" on_change="on_change_product_cost(product_id)"/>
208                                     <field name="costs_hour"/>
209                                     <field name="costs_hour_account_id" groups="analytic.group_analytic_accounting"/>
210                                     <field name="costs_cycle"/>
211                                     <field name="costs_cycle_account_id" groups="analytic.group_analytic_accounting"/>
212                                     <field name="costs_journal_id" attrs="{'required':['|',('costs_hour_account_id', '=', True),('costs_cycle_account_id', '=', True)]}" groups="analytic.group_analytic_accounting"/>
213                                     <field name="costs_general_account_id" attrs="{ 'required':['|',('costs_cycle_account_id', '=', True),('costs_hour_account_id', '=', True)]}" groups="analytic.group_analytic_accounting"/>
214                                 </group>
215                             </group>
216                             <separator string="Description"/>
217                             <field name="note" nolabel="1"/>
218                         </page>
219                     </notebook>
220                 </form>
221             </field>
222         </record>
223
224         <!-- Search Views -->
225
226         <record id="view_mrp_workcenter_search" model="ir.ui.view">
227             <field name="name">mrp.workcenter.search</field>
228             <field name="model">mrp.workcenter</field>
229             <field name="arch" type="xml">
230                 <search string="Search for mrp workcenter">
231                     <field name="name" string="Mrp Workcenter" filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/>
232                     <field name="resource_type"/>
233                     <filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
234                     <group expand="0" string="Group By...">
235                         <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'resource_type'}"/>
236                         <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
237                     </group>
238                 </search>
239             </field>
240         </record>
241
242         <!--
243         Routings
244         -->
245
246         <record id="mrp_routing_workcenter_tree_view" model="ir.ui.view">
247             <field name="name">mrp.routing.workcenter.tree</field>
248             <field name="model">mrp.routing.workcenter</field>
249             <field name="arch" type="xml">
250                 <tree string="Routing Work Centers">
251                     <field name="sequence"/>
252                     <field name="name"/>
253                     <field name="workcenter_id"/>
254                     <field name="cycle_nbr"/>
255                     <field name="hour_nbr"/>
256                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
257                 </tree>
258             </field>
259         </record>
260
261         <record id="mrp_routing_workcenter_form_view" model="ir.ui.view">
262             <field name="name">mrp.routing.workcenter.form</field>
263             <field name="model">mrp.routing.workcenter</field>
264             <field name="arch" type="xml">
265                 <form string="Routing Work Centers">
266                     <group col="4">
267                         <field colspan="4" name="name"/>
268                         <field name="sequence"/>
269                         <field name="workcenter_id"/>
270                         <field name="cycle_nbr"/>
271                         <field name="hour_nbr" widget="float_time"/>
272                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
273                     </group>
274                     <label for="note"/>
275                     <field name="note"/>
276                 </form>
277             </field>
278         </record>
279
280         <record id="mrp_routing_form_view" model="ir.ui.view">
281             <field name="name">mrp.routing.form</field>
282             <field name="model">mrp.routing</field>
283             <field name="arch" type="xml">
284                 <form string="Routing">
285                     <group col="4">
286                         <group>
287                             <field name="name"/>
288                             <field name="code"/>
289                         </group>
290                         <group>
291                             <field name="location_id"/>
292                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
293                             <field name="active"/>
294                        </group>
295                     </group>
296                     <notebook>
297                         <page string="Work Center Operations">
298                             <field name="workcenter_lines" string="Operation"/>
299                         </page>
300                         <page string="Notes">
301                             <field name="note"/>
302                         </page>
303                     </notebook>
304                 </form>
305             </field>
306         </record>
307         <record id="mrp_routing_tree_view" model="ir.ui.view">
308             <field name="name">mrp.routing.tree</field>
309             <field name="model">mrp.routing</field>
310             <field name="arch" type="xml">
311                 <tree string="Routing">
312                     <field name="code"/>
313                     <field name="name"/>
314                     <field name="location_id"/>
315                     <field name="company_id" groups="base.group_multi_company"/>
316                 </tree>
317             </field>
318         </record>
319         <record id="mrp_routing_search_view" model="ir.ui.view">
320             <field name="name">mrp.routing.search</field>
321             <field name="model">mrp.routing</field>
322             <field name="arch" type="xml">
323                 <search string="Routing">
324                     <field name="name" string="Routing" filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/>
325                     <filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
326                     <field name="location_id"/>
327                     <field name="company_id" groups="base.group_multi_company"/>
328                     <group expand="0" string="Group By...">
329                         <filter string="Production Location" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'location_id'}"/>
330                     </group>
331                 </search>
332             </field>
333         </record>
334         <record id="mrp_routing_action" model="ir.actions.act_window">
335             <field name="name">Routings</field>
336             <field name="type">ir.actions.act_window</field>
337             <field name="res_model">mrp.routing</field>
338             <field name="view_type">form</field>
339             <field name="view_id" ref="mrp_routing_tree_view"/>
340             <field name="search_view_id" ref="mrp_routing_search_view"/>
341             <field name="help" type="html">
342               <p class="oe_view_nocontent_create">
343                 Click to create a routing.
344               </p><p>
345                 Routings allow you to create and manage the manufacturing
346                 operations that should be followed within your work centers in
347                 order to produce a product.  They are attached to bills of
348                 materials that will define the required raw materials.
349               </p>
350             </field>
351         </record>
352         <menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_bom" groups="mrp.group_mrp_routings" sequence="15"/>
353
354         <!--
355           Bill of Materials
356         -->
357
358         <record id="mrp_bom_form_view" model="ir.ui.view">
359             <field name="name">mrp.bom.form</field>
360             <field name="model">mrp.bom</field>
361             <field name="arch" type="xml">
362                 <form string="Bill of Material">
363                     <group>
364                         <group>
365                             <field name="product_tmpl_id" on_change="onchange_product_tmpl_id(product_tmpl_id, product_qty, context)"/>
366                             <field name="product_id"/>
367                             <label for="product_qty" string="Quantity"/>
368                             <div>
369                                 <field name="product_qty" class="oe_inline" on_change="onchange_product_tmpl_id(product_tmpl_id, product_qty, context)"/>
370                                 <field name="product_uom" class="oe_inline" on_change="onchange_uom(product_tmpl_id, product_uom)" groups="product.group_uom"/>
371                             </div>
372                             <label for="routing_id" class="oe_inline" groups="mrp.group_mrp_routings"/>
373                             <div groups="mrp.group_mrp_routings">
374                                 <field name="routing_id" class="oe_inline"/>
375                             </div>
376                         </group>
377                         <group>
378                             <field name="name" groups="mrp.group_route_line_type"/>
379                             <field name="code" string="Reference"/>
380                             <field name="type" widget="radio"/>
381                             <p colspan="2" class="oe_grey" attrs="{'invisible': [('type','=','normal')]}">
382                                 When processing a sales order for this product, the delivery order
383                                 will contain the raw materials, instead of the finished product.
384                             </p>
385                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
386                         </group>
387                     </group>
388                     <notebook>
389                         <page string="Components">
390                             <field name="bom_line_ids" widget="one2many_list">
391                                 <tree string="Components" editable="bottom">
392                                     <field name="sequence" widget="handle"/>
393                                     <field name="product_id" on_change="onchange_product_id(product_id, product_qty)"/>
394                                     <field name="type" groups="mrp.group_route_line_type"/>
395                                     <field name="product_qty"/>
396                                     <field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
397                                     <field name="product_rounding" groups="mrp.group_rounding_efficiency"/>
398                                     <field name="product_efficiency" groups="mrp.group_rounding_efficiency"/>
399                                     <field name="date_start"/>
400                                     <field name="date_stop"/>
401                                     <field name="attribute_value_ids" widget="many2many_tags" domain="[('product_ids.product_tmpl_id', '=', parent.product_tmpl_id)]"/>
402                                 </tree>
403                             </field>
404                         </page>
405                         <page string="Properties" groups="product.group_mrp_properties">
406                             <group>
407                                 <group>
408                                     <field name="position"/>
409                                     <field name="sequence"/>
410                                     <field name="active"/>
411                                 </group>
412                                 <group>
413                                     <field name="date_start"/>
414                                     <field name="date_stop"/>
415                                     <field name="product_rounding"/>
416                                     <field name="product_efficiency"/>
417                                 </group>
418                             </group>
419                             <separator string="Properties"/>
420                             <field name="property_ids" widget="many2many_tags"/>
421                         </page>
422                     </notebook>
423                     <div class="oe_chatter">
424                          <field name="message_follower_ids" widget="mail_followers"/>
425                          <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
426                     </div>
427                 </form>
428             </field>
429         </record>
430
431         <record id="view_mrp_bom_filter" model="ir.ui.view">
432             <field name="name">mrp.bom.select</field>
433             <field name="model">mrp.bom</field>
434             <field name="arch" type="xml">
435                 <search string="Search Bill Of Material">
436                     <field name="name" string="Bill Of Material" filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/>
437                     <field name="bom_line_ids" string="Components"/>
438                     <field name="product_tmpl_id" string="Product"/>
439                     <field name="product_id" string="Variant"/>
440                     <field name="company_id" groups="base.group_multi_company"/>
441                     <group expand="0" string="Group By...">
442                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_tmpl_id'}"/>
443                         <filter string='Default Unit of Measure' icon="terp-mrp" domain="[]" context="{'group_by' : 'product_uom'}"/>
444                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}"/>
445                         <filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}"/>
446                         <filter string=" Valid From Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}" help="Valid From Date by Month"/>
447                    </group>
448                 </search>
449             </field>
450         </record>
451
452        <record id="mrp_bom_tree_view" model="ir.ui.view">
453             <field name="name">mrp.bom.tree</field>
454             <field name="model">mrp.bom.line</field>
455             <field name="field_parent">child_line_ids</field>
456             <field name="arch" type="xml">
457                 <tree string="Bill of Materials">
458                     <field name="sequence" invisible="1"/>
459                     <field name="product_id"/>
460                     <field name="product_uom" groups="product.group_uom"/>
461                     <field name="type"/>
462                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
463                     <field name="date_start"/>
464                     <field name="date_stop"/>
465                 </tree>
466             </field>
467         </record>
468
469         <record id="mrp_bom_form_action" model="ir.actions.act_window">
470             <field name="name">Bill of Materials</field>
471             <field name="type">ir.actions.act_window</field>
472             <field name="res_model">mrp.bom</field>
473             <field name="domain">[]</field> <!-- force empty -->
474             <field name="view_type">form</field>
475             <field name="search_view_id" ref="view_mrp_bom_filter"/>
476             <field name="help" type="html">
477               <p class="oe_view_nocontent_create">
478                 Click to create a bill of material. 
479               </p><p>
480                 Bills of Materials allow you to define the list of required raw
481                 materials used to make a finished product; through a manufacturing
482                 order or a pack of products.
483               </p><p>
484                 Odoo uses these BoMs to automatically propose manufacturing
485                 orders according to procurement needs.
486               </p>
487             </field>
488         </record>
489
490         <record id="mrp_bom_component_tree_view" model="ir.ui.view">
491             <field name="name">mrp.bom.component.tree</field>
492             <field name="model">mrp.bom.line</field>
493             <field name="arch" type="xml">
494                 <tree string="Components" editable="top">
495                     <field name="sequence" widget="handle"/>
496                     <field name="bom_id"/>
497                     <field name="product_id" on_change="onchange_product_id(product_id)"/>
498                     <field name="type"/>
499                     <field name="product_qty"/>
500                     <field name="product_rounding"/>
501                     <field name="product_efficiency"/>
502                     <field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
503                     <field name="product_uos_qty" groups="product.group_uos"/>
504                     <field name="product_uos" groups="product.group_uos"/>
505                     <field name="date_start"/>
506                     <field name="date_stop"/>
507                     <field name="routing_id"/>
508                     <field name="attribute_value_ids" widget="many2many_tags"/>
509                     <field name="property_ids" widget="many2many_tags"/>
510                 </tree>
511             </field>
512         </record>
513
514         <record id="view_mrp_bom_line_filter" model="ir.ui.view">
515             <field name="name">mrp.bom.line.select</field>
516             <field name="model">mrp.bom.line</field>
517             <field name="arch" type="xml">
518                 <search string="Search Bill Of Material Components">
519                     <field name="bom_id"/>
520                     <field name="product_id"/>
521                     <group expand="0" string="Group By...">
522                         <filter string="Bill Of Material" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'bom_id'}"/>
523                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
524                         <filter string='Default Unit of Measure' icon="terp-mrp" domain="[]" context="{'group_by' : 'product_uom'}"/>
525                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}"/>
526                         <filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}"/>
527                         <filter string=" Valid From Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}" help="Valid From Date by Month"/>
528                    </group>
529                 </search>
530             </field>
531         </record>
532
533         <record id="product_template_search_view_procurment" model="ir.ui.view">
534              <field name="name">product.template.search.bom</field>
535              <field name="model">product.template</field>
536              <field name="inherit_id" ref="product.product_template_search_view"/>
537              <field name="arch" type="xml">
538                  <xpath expr="//filter[@string='Consumable']" position="after">
539                      <separator/>
540                     <filter string="Components" name="components" icon="terp-accessories-archiver" domain="[('bom_ids','not in',[])]"/>
541                  </xpath>
542              </field>
543         </record>
544
545         <record id="view_mrp_product_template_form_inherited" model="ir.ui.view">
546             <field name="name">product.form.mrp.inherited</field>
547             <field name="model">product.template</field>
548             <field name="inherit_id" ref="stock.view_template_property_form"/>
549             <field name="arch" type="xml">
550                  <xpath expr="//group[@name='lot']" position="inside">
551                     <field name="track_production" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
552                 </xpath>
553                 <group name="sale_condition" position="inside">
554                     <label for="produce_delay" attrs="{'invisible':[('type','=','service')]}"/>
555                     <div attrs="{'invisible':[('type','=','service')]}">
556                         <field name="produce_delay" class="oe_inline"/> days
557                     </div>
558                 </group>
559             </field>
560         </record>
561         
562         <record id="product_template_action" model="ir.actions.act_window">
563             <field name="name">Products</field>
564             <field name="res_model">product.template</field>
565             <field name="view_type">form</field>
566             <field name="view_mode">kanban,tree,form</field>
567             <field name="context">{}</field>
568         </record>
569         <!-- BOM menus -->
570
571         <menuitem
572             action="mrp_bom_form_action"
573             id="menu_mrp_bom_form_action"
574             parent="menu_mrp_bom"
575             sequence="99"/>
576        <menuitem name="Products" 
577             id="menu_mrp_product_form" 
578             action="product_template_action"
579             parent="menu_mrp_bom"/>
580
581         <record id="action2" model="ir.actions.act_window">
582             <field name="name">Bill of Materials Structure</field>
583             <field name="type">ir.actions.act_window</field>
584             <field name="res_model">mrp.bom.line</field>
585             <field name="domain">[('bom_id', 'in', active_ids)]</field>
586             <field name="view_type">tree</field>
587             <field name="view_id" ref="mrp_bom_tree_view"/>
588             <field name="view_type">tree</field>
589         </record>
590         <record id="ir_BOM_structure" model="ir.values">
591             <field eval="'client_action_multi'" name="key2"/>
592             <field eval="'mrp.bom'" name="model"/>
593             <field name="name">Bill of Materials Structure</field>
594             <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
595         </record>
596
597         <!--
598         Production Management
599         -->
600         <record id="mrp_production_tree_view" model="ir.ui.view">
601             <field name="name">mrp.production.tree</field>
602             <field name="model">mrp.production</field>
603             <field name="arch" type="xml">
604                 <tree fonts="bold:message_unread==True" 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">
605                     <field name="message_unread" invisible="1"/>
606                     <field name="name"/>
607                     <field name="date_planned"/>
608                     <field name="product_id"/>
609                     <field name="product_qty" sum="Total Qty"/>
610                     <field name="product_uom" groups="product.group_uom"/>
611                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
612                     <field name="hour_total" sum="Total Hours"/>
613                     <field name="cycle_total" sum="Total Cycles"/>
614                     <field name="origin"/>
615                     <field name="state"/>
616                 </tree>
617             </field>
618         </record>
619
620         <record id="view_production_calendar" model="ir.ui.view">
621             <field name="name">mrp.production.calendar</field>
622             <field name="model">mrp.production</field>
623             <field eval="2" name="priority"/>
624             <field name="arch" type="xml">
625                 <calendar color="routing_id" date_start="date_planned" string="Manufacturing Orders">
626                     <field name="name"/>
627                     <field name="product_id"/>
628                     <field name="product_qty"/>
629                 </calendar>
630             </field>
631         </record>
632
633
634         <record id="view_production_gantt" model="ir.ui.view">
635             <field name="name">mrp.production.gantt</field>
636             <field name="model">mrp.production</field>
637             <field name="arch" type="xml">
638                 <gantt date_stop="date_finished" date_start="date_start" progress="progress" string="Productions" default_group_by="routing_id">
639                 </gantt>
640             </field>
641         </record>
642
643
644         <record model="ir.ui.view" id="view_production_graph">
645             <field name="name">mrp.production.graph</field>
646             <field name="model">mrp.production</field>
647             <field name="arch" type="xml">
648                 <graph string="Manufacturing Orders" type="bar">
649                     <field name="date_planned"/>
650                     <field name="hour_total" operator="+"/>
651                     <field name="cycle_total" operator="+"/>
652                 </graph>
653             </field>
654         </record>
655
656         <record id="mrp_production_form_view" model="ir.ui.view">
657             <field name="name">mrp.production.form</field>
658             <field name="model">mrp.production</field>
659             <field name="arch" type="xml">
660                 <form string="Manufacturing Orders">
661                 <header>
662                     <button name="button_confirm" states="draft" string="Confirm Production" class="oe_highlight"/>
663                     <button name="%(act_mrp_product_produce)d" states="ready,in_production" string="Produce" type="action" class="oe_highlight"/>
664                     <button name="action_assign" states="confirmed,picking_except" string="Check Availability" type="object" class="oe_highlight"/>
665                     <button name="force_production" states="confirmed" string="Force Reservation" type="object"/>
666                     <button name="button_produce" states="ready" string="Mark as Started"/>
667                     <button name="button_cancel" states="draft,ready,in_production" string="Cancel Production"/>
668                     <button name="action_cancel" type="object" states="confirmed" string="Cancel Production"/>
669                     <field name="state" widget="statusbar" statusbar_visible="draft,ready,in_production,done" statusbar_colors='{"confirmed":"blue"}'/>
670                 </header>
671                 <sheet>
672                     <div class="oe_title">
673                         <h1>Manufacturing Order <field name="name" class="oe_inline"/></h1>
674                     </div>
675                     <group>
676                         <group>
677                             <field name="product_id" on_change="product_id_change(product_id, product_qty)" domain="[('bom_ids','!=',False),('bom_ids.type','!=','phantom')]" class="oe_inline" context='{"default_type": "product"}'/>
678                             <label for="product_qty"/>
679                             <div>
680                                 <field name="product_qty" class="oe_inline" on_change="product_id_change(product_id, product_qty)"/>
681                                 <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
682                                 <button type="action"
683                                     name="%(mrp.action_change_production_qty)d"
684                                     string="Update" states="confirmed" class="oe_edit_only oe_link"/>
685                             </div>
686                             <label for="product_uos_qty" groups="product.group_uos"/>
687                             <div groups="product.group_uos">
688                                 <field name="product_uos_qty" class="oe_inline"/>
689                                 <label string="-" attrs="{'invisible':[('product_uos','=',False)]}" class="oe_inline"/>
690                                 <field name="product_uos" class="oe_inline"/>
691                             </div>
692                             <field name="date_planned"/>
693                         </group>
694                         <group>
695                             <field name="bom_id"
696                                 domain="['|',
697                                             ('product_id','=',product_id),
698                                             '&amp;',
699                                                 ('product_tmpl_id.product_variant_ids','=',product_id),
700                                                 ('product_id','=',False)]"
701                                 context="{'default_product_id': product_id}" on_change="bom_id_change(bom_id)" required="1"/>
702                             <field name="routing_id" class="oe_inline" groups="mrp.group_mrp_routings"/>
703                             <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'mrp.group_mrp_user']}"/>
704                             <field name="origin"/>
705                         </group>
706                         <group groups="stock.group_locations">
707                             <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
708                             <field name="location_dest_id" domain="[('usage','=','internal')]"/>
709                         </group>
710                     </group>
711                     <notebook>
712                         <page string="Consumed Products">
713                             <group>
714                                 <group string="Products to Consume">
715                                     <field name="move_lines" nolabel="1" options="{'reload_on_button': true}">
716                                         <tree colors="blue:state == 'draft';black:state in ('ready','assigned','in_production');gray:state in ('cancel','done');red:state in ('confirmed','waiting')" string="Products to Consume">
717                                             <field name="product_id"/>
718                                             <field name="product_uom_qty"  string="Quantity"/>
719                                             <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
720                                             <field name="state" invisible="1"/>
721                                             <button name="%(mrp.move_consume)d"
722                                                 string="Consume Products" type="action"
723                                                 icon="gtk-go-forward" context="{'consume': True}"
724                                                 states="assigned"
725                                                  />
726                                             <button name="%(stock.move_scrap)d"
727                                                 string="Scrap Products" type="action"
728                                                 icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
729                                                 states="draft,waiting,confirmed,assigned"/>
730                                         </tree>
731                                     </field>
732                                 </group>
733                                 <group string="Consumed Products">
734                                     <field name="move_lines2" nolabel="1" options="{'reload_on_button': true}">
735                                        <tree colors="red:scrapped==True;blue:state == 'draft';black:state in ('confirmed','ready','in_production');gray:state == 'cancel' " string="Consumed Products" editable="bottom">
736                                            <field name="product_id" readonly="1"/>
737                                            <field name="restrict_lot_id" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
738                                            <field name="product_uom_qty" readonly="1"/>
739                                            <field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
740                                            <field name="state" invisible="1"/>
741                                            <field name="scrapped" invisible="1"/>
742                                        </tree>
743                                     </field>
744                                 </group>
745                             </group>
746                         </page>
747                         <page string="Finished Products">
748                             <group>
749                                 <group string="Products to Produce">
750                                     <field name="move_created_ids" nolabel="1" options="{'reload_on_button': true}">
751                                         <tree string="Products to Finish">
752                                             <field name="product_id"/>
753                                             <field name="product_uom_qty"/>
754                                             <field name="product_uom"  string="Unit of Measure" groups="product.group_uom"/>
755                                             <field name="state" invisible="1"/>
756                                         </tree>
757                                     </field>
758                                 </group>
759                                 <group string="Produced Products">
760                                     <field name="move_created_ids2" nolabel="1" options="{'reload_on_button': true}">
761                                         <tree colors="red:scrapped==True;blue:state == 'draft';black:state in('confirmed','ready','in_production');gray:state in('cancel','done') " string="Finished Products">
762                                             <field name="product_id" readonly="1"/>
763                                             <field name="product_uom_qty" readonly="1"/>
764                                             <field name="restrict_lot_id" groups="stock.group_production_lot"/>
765                                             <field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
766                                             <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection" groups="stock.group_locations"/>
767                                             <field name="scrapped" invisible="1"/>
768                                             <field name="state" invisible="1"/>
769                                             <button name="%(stock.move_scrap)d"
770                                                 string="Scrap Products" type="action" icon="terp-gtk-jump-to-ltr"
771                                                 states="done,cancel"/>
772                                         </tree>
773                                     </field>
774                                 </group>
775                             </group>
776                         </page>
777                         <page string="Work Orders" groups="mrp.group_mrp_routings">
778                             <button name="action_compute" states="draft"
779                                 string="Compute Data" type="object"
780                                 icon="terp-stock_format-scientific"/>
781                             <field name="workcenter_lines">
782                                 <form string="Production Work Centers">
783                                     <group col="4">
784                                         <field colspan="4" name="name"/>
785                                         <field name="workcenter_id"/>
786                                         <field name="sequence"/>
787                                         <field name="cycle"/>
788                                         <field name="hour" widget="float_time"/>
789                                     </group>
790                                 </form>
791                                 <tree string="Production Work Centers">
792                                     <field name="sequence"/>
793                                     <field name="name"/>
794                                     <field name="workcenter_id"/>
795                                     <field name="cycle"/>
796                                     <field name="hour" widget="float_time"/>
797                                 </tree>
798                             </field>
799                         </page>
800                         <page string="Scheduled Products">
801                             <button name="action_compute" states="draft"
802                                 string="Compute Data" type="object"
803                                 icon="terp-stock_format-scientific"/>
804                             <field name="product_lines"/>
805                         </page>
806                         <page string="Extra Information">
807                             <group>
808                                 <group>
809                                     <field name="priority"/>
810                                     <field name="date_start" invisible="1"/>
811                                     <field name="date_finished" invisible="1"/>
812                                 </group>
813                                 <group>
814                                     <field name="company_id" groups="base.group_multi_company" widget="selection" />                                     
815                                     <field name="move_prod_id" groups="stock.group_locations"/>
816                                 </group>
817                             </group>
818                         </page>
819                     </notebook>
820                 </sheet>
821                 <div class="oe_chatter">
822                     <field name="message_follower_ids" widget="mail_followers"/>
823                     <field name="message_ids" widget="mail_thread"/>
824                 </div>
825                 </form>
826             </field>
827         </record>
828
829         <record id="view_mrp_production_filter" model="ir.ui.view">
830             <field name="name">mrp.production.select</field>
831             <field name="model">mrp.production</field>
832             <field name="arch" type="xml">
833                 <search string="Search Production">
834                     <field name="name" string="Production" filter_domain="['|',('name','ilike',self),('origin','ilike',self)]"/>
835                     <filter icon="terp-gtk-media-pause" string="Pending" name="pending" domain="[('state','=','confirmed')]"
836                         help="Manufacturing Orders which are waiting for raw materials."/>
837                     <filter icon="terp-camera_test" string="Ready" name="ready" domain="[('state','=','ready')]"
838                         help="Manufacturing Orders which are ready to start production."/>
839                     <filter icon="terp-check" string="In Production" name="inprogress" domain="[('state','=','in_production')]"
840                         help="Manufacturing Orders which are currently in production."/>
841                     <separator/>
842                     <filter icon="terp-gnome-cpu-frequency-applet+" string="Late" domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
843                         help="Production started late"/>
844                     <field name="product_id"/>
845                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
846                     <group expand="0" string="Group By...">
847                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
848                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}"/>
849                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
850                         <filter string="Scheduled Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}" help="Scheduled Date by Month"/>
851                     </group>
852                </search>
853             </field>
854         </record>
855
856         <record id="mrp_production_action" model="ir.actions.act_window">
857             <field name="name">Manufacturing Orders</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="view_id" eval="False"/>
863             <field name="search_view_id" ref="view_mrp_production_filter"/>
864             <field name="context">{}</field>
865             <field name="help" type="html">
866               <p class="oe_view_nocontent_create">
867                 Click to create a manufacturing order. 
868               </p><p>
869                 A manufacturing order, based on a bill of materials, will
870                 consume raw materials and produce finished products.
871               </p><p>
872                 Manufacturing orders are usually proposed automatically based
873                 on customer requirements or automated rules like the minimum
874                 stock rule.
875               </p>
876             </field>
877         </record>
878         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
879             parent="menu_mrp_manufacturing" sequence="1"/>
880
881         <record id="mrp_production_action_planning" model="ir.actions.act_window">
882             <field name="name">Manufacturing Orders</field>
883             <field name="type">ir.actions.act_window</field>
884             <field name="res_model">mrp.production</field>
885             <field name="view_type">form</field>
886             <field name="view_mode">calendar,tree,form,graph</field>
887             <field name="domain">[('state','in',('ready','confirmed','in_production'))]</field>
888             <field name="help" type="html">
889               <p class="oe_view_nocontent_create">
890                 Click to start a new manufacturing order. 
891               </p><p>
892                 A manufacturing order, based on a bill of materials, will
893                 consume raw materials and produce finished products.
894               </p><p>
895                 Manufacturing orders are usually proposed automatically based
896                 on customer requirements or automated rules like the minimum
897                 stock rule.
898               </p>
899             </field>
900         </record>
901
902         <record id="mrp_production_action2" model="ir.actions.act_window">
903             <field name="name">Manufacturing Orders To Start</field>
904             <field name="type">ir.actions.act_window</field>
905             <field name="res_model">mrp.production</field>
906             <field name="view_type">form</field>
907             <field name="view_mode">tree,form,calendar,graph,gantt</field>
908             <field name="domain">[('state','=','ready')]</field>
909             <field name="filter" eval="True"/>
910             <field name="search_view_id" ref="view_mrp_production_filter"/>
911         </record>
912
913         <record id="mrp_production_action3" model="ir.actions.act_window">
914             <field name="name">Manufacturing Orders in Progress</field>
915             <field name="type">ir.actions.act_window</field>
916             <field name="res_model">mrp.production</field>
917             <field name="view_type">form</field>
918             <field name="view_mode">tree,form,calendar,graph,gantt</field>
919             <field name="domain">[('state','=','in_production')]</field>
920             <field name="filter" eval="True"/>
921             <field name="search_view_id" ref="view_mrp_production_filter"/>
922         </record>
923
924         <record id="mrp_production_action4" model="ir.actions.act_window">
925             <field name="name">Manufacturing Orders Waiting Products</field>
926             <field name="type">ir.actions.act_window</field>
927             <field name="res_model">mrp.production</field>
928             <field name="view_type">form</field>
929             <field name="view_mode">tree,form,calendar,graph,gantt</field>
930             <field name="domain">[('state','=','confirmed')]</field>
931             <field name="filter" eval="True"/>
932             <field name="search_view_id" ref="view_mrp_production_filter"/>
933         </record>
934
935         <record id="mrp_production_product_form_view" model="ir.ui.view">
936             <field name="name">mrp.production.product.line.form</field>
937             <field name="model">mrp.production.product.line</field>
938             <field name="arch" type="xml">
939                 <form string="Scheduled Products">
940                     <group col="4">
941                         <field name="name"/>
942                         <field name="product_id"/>
943                         <field name="product_qty"/>
944                         <field name="product_uom" groups="product.group_uom"/>
945                         <field name="product_uos_qty" groups="product.group_uos"/>
946                         <field name="product_uos" groups="product.group_uos"/>
947                     </group>
948                 </form>
949             </field>
950         </record>
951         <record id="mrp_production_product_tree_view" model="ir.ui.view">
952             <field name="name">mrp.production.product.line.tree</field>
953             <field name="model">mrp.production.product.line</field>
954             <field name="arch" type="xml">
955                 <tree string="Scheduled Products">
956                     <field name="product_id"/>
957                     <field name="product_qty"/>
958                     <field name="product_uom" groups="product.group_uom"/>
959                     <field name="product_uos_qty" groups="product.group_uos"/>
960                     <field name="product_uos" groups="product.group_uos"/>
961                 </tree>
962             </field>
963         </record>
964
965         <!--
966             Procurements
967         -->
968
969         <record id="view_procurement_form_inherit" model="ir.ui.view">
970             <field name="name">procurement.order.form.inherit</field>
971             <field name="model">procurement.order</field>
972             <field name="inherit_id" ref="procurement.procurement_form_view"/>
973             <field name="arch" type="xml">
974             <data>
975                 <xpath expr="//field[@name='origin']" position="before">
976                     <field name="bom_id" domain="[('product_id','=',product_id)]"/>
977                     <field name="production_id" attrs="{'invisible': [('production_id','=',False)]}"/>
978                 </xpath>
979                 <xpath expr="//field[@name='origin']" position="after">
980                     <group colspan="4"  groups="product.group_mrp_properties">
981                         <field colspan="4" name="property_ids" widget="many2many_tags"/>
982                     </group>
983                 </xpath>
984                </data>
985             </field>
986         </record>
987
988         <!-- Menu for Resource for MRP-->
989
990         <record id="mrp_workcenter_action" model="ir.actions.act_window">
991             <field name="name">Work Centers</field>
992             <field name="type">ir.actions.act_window</field>
993             <field name="res_model">mrp.workcenter</field>
994             <field name="view_type">form</field>
995             <field name="view_id" ref="mrp_workcenter_tree_view"/>
996             <field name="search_view_id" ref="view_mrp_workcenter_search"/>
997             <field name="help" type="html">
998               <p class="oe_view_nocontent_create">
999                 Click to add a work center.
1000               </p><p>
1001                 Work Centers allow you to create and manage manufacturing
1002                 units. They consist of workers and/or machines, which are
1003                 considered as units for task assignation as well as capacity
1004                 and planning forecast.
1005               </p>
1006             </field>
1007         </record>
1008
1009         <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration" sequence="3"/>
1010         <menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" groups="mrp.group_mrp_routings" parent="mrp.menu_mrp_configuration_manufacturing" sequence="25"/>
1011         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1" groups="base.group_no_one"/>
1012         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1" groups="base.group_no_one"/>
1013
1014         <!-- Planning -->
1015
1016         <menuitem id="menu_mrp_planning" name="Planning"
1017                 parent="base.menu_mrp_root" sequence="2"/>
1018         <menuitem action="mrp.mrp_production_action_planning"
1019                 id="menu_mrp_production_order_action" name="Order Planning"
1020                 parent="menu_mrp_planning" sequence="1"/>
1021
1022         <record model="ir.actions.act_window" id="template_open_bom">
1023             <field name="context">{'default_product_tmpl_id': active_id, 'search_default_product_tmpl_id': active_id}</field>
1024             <field name="name">Bill of Materials</field>
1025             <field name="res_model">mrp.bom</field>
1026             <field name="view_type">form</field>
1027         </record>
1028         <record model="ir.actions.act_window" id="product_open_bom">
1029             <field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
1030             <field name="name">Bill of Materials</field>
1031             <field name="res_model">mrp.bom</field>
1032             <field name="domain">[]</field> <!-- Force empty -->
1033             <field name="view_type">form</field>
1034         </record>
1035
1036         <record id="act_product_mrp_production" model="ir.actions.act_window">
1037             <field name="context">{'search_default_product_id': [active_id]}</field>
1038             <field name="name">Manufacturing Orders</field>
1039             <field name="res_model">mrp.production</field>
1040             <field name="view_id" ref="mrp_production_tree_view"/>
1041         </record>
1042
1043         <record model="ir.ui.view" id="product_template_form_view_bom_button">
1044             <field name="name">product.template.procurement</field>
1045             <field name="model">product.template</field>
1046             <field name="inherit_id" ref="product.product_template_only_form_view"/>
1047             <field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
1048             <field name="arch" type="xml">
1049                 <div name="buttons" position="inside">
1050                     <button class="oe_inline oe_stat_button" name="%(template_open_bom)d" type="action"
1051                         attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
1052                         <field string="Bill of Materials" name="bom_count" widget="statinfo" />
1053                     </button>
1054                     <button class="oe_inline oe_stat_button" name="action_view_mos" type="object" 
1055                         attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
1056                         <field string="Manufacturing" name="mo_count" widget="statinfo" />
1057                     </button>
1058                 </div>
1059             </field>
1060         </record>
1061
1062         <record model="ir.ui.view" id="product_product_form_view_bom_button">
1063             <field name="name">product.product.procurement</field>
1064             <field name="model">product.product</field>
1065             <field name="inherit_id" ref="product.product_normal_form_view"/>
1066             <field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
1067             <field name="arch" type="xml">
1068                 <div name="buttons" position="inside">
1069                     <button class="oe_inline oe_stat_button" name="action_view_bom" type="object" 
1070                         attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
1071                         <field string="Bill of Materials" name="bom_count" widget="statinfo" />
1072                     </button>
1073                     <button class="oe_inline oe_stat_button" name="%(act_product_mrp_production)d" type="action" 
1074                         attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
1075                         <field string="Manufacturing" name="mo_count" widget="statinfo" />
1076                     </button>
1077                 </div>
1078             </field>
1079         </record>
1080
1081         <record id="view_warehouse_inherited" model="ir.ui.view">
1082             <field name="name">Stock Warehouse Inherited</field>
1083             <field name="model">stock.warehouse</field>
1084             <field name="inherit_id" ref="stock.view_warehouse"/>
1085             <field name="arch" type="xml">
1086                  <xpath expr="//field[@name='default_resupply_wh_id']" position="before">
1087                     <field name="manufacture_to_resupply" />
1088                 </xpath>
1089             </field>
1090         </record>
1091     </data>
1092 </openerp>