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