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