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