[MERGE] merge with latest stable
[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                                 <form string="Bill of Material">
347                                     <group colspan="4" col="6">
348                                     <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
349                                     <field name="name" select="1"/>
350                                     <field name="code" select="1" string="Reference" groups="base.group_extended"/>
351                                     <newline/>
352                                     <field name="product_qty"/>
353                                     <field name="product_uom"/>
354                                     <field name="routing_id"  groups="base.group_extended"/>
355                                     <newline/>
356                                     <field name="product_uos_qty" groups="product.group_uos" />
357                                     <field name="product_uos"  groups="product.group_uos"/>
358                                     <newline/>
359                                     <field name="type" groups="base.group_extended"/>
360                                     <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
361                                 </group>
362                                 <group groups="base.group_extended">
363                                 <notebook colspan="4">
364                                     <page string="Components">
365                                         <field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list">
366                                             <tree string="Components" editable="bottom">
367                                                 <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
368                                                 <field name="product_qty"/>
369                                                 <field name="product_uom"/>
370                                                 <field name="name" invisible="1"/>
371                                                 <field name="date_start"/>
372                                                 <field name="date_stop"/>
373                                             </tree>
374                                         </field>
375                                     </page>
376                                     <page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False)]}">
377                                         <field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
378                                     </page>
379                                     <page string="Properties" groups="base.group_extended">
380                                         <field name="position"/>
381                                         <field name="active"/>
382                                         <field name="sequence"/>
383                                         <field name="bom_id"/>
384
385                                         <field name="date_start"/>
386                                         <field name="date_stop"/>
387                                         <field name="product_rounding"/>
388                                         <field name="product_efficiency" groups="base.group_extended"/>
389                                         <field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
390                                     </page>
391                                 </notebook>
392                                 </group>
393                             </form>
394                             </field>
395                         </page>
396                         <page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False)]}">
397                             <field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
398                         </page>
399                         <page string="Properties" groups="base.group_extended">
400                             <field name="position"/>
401                             <field name="active"/>
402                             <field name="sequence"/>
403                             <field name="bom_id"/>
404
405                             <field name="date_start"/>
406                             <field name="date_stop"/>
407                             <field name="product_rounding"/>
408                             <field name="product_efficiency" groups="base.group_extended"/>
409                             <field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
410                         </page>
411                     </notebook>
412                 </form>
413             </field>
414         </record>
415
416         <record id="view_mrp_bom_filter" model="ir.ui.view">
417             <field name="name">mrp.bom.select</field>
418             <field name="model">mrp.bom</field>
419            <field name="type">search</field>
420             <field name="arch" type="xml">
421                 <search string="Search Bill Of Material">
422                     <group col='4' colspan='4'>
423                          <field name="name"/>
424                          <field name="code" string="Reference"/>
425                          <field name="product_id"/>
426                          <field name="company_id" groups="base.group_multi_company"/>
427                     </group>
428                     <newline/>
429                     <group expand="0" string="Group By..." colspan="4" col="8" groups="base.group_extended">
430                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
431                         <filter string='Default UOM' icon="terp-mrp" domain="[]" context="{'group_by' : 'product_uom'}" />
432                         <separator orientation="vertical"/>
433                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}"/>
434                         <filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}" />
435                         <separator orientation="vertical"/>
436                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}" help="Starting Date"/>
437                    </group>
438                 </search>
439             </field>
440         </record>
441
442        <record id="mrp_bom_tree_view" model="ir.ui.view">
443             <field name="name">mrp.bom.tree</field>
444             <field name="model">mrp.bom</field>
445             <field name="type">tree</field>
446             <field name="field_parent">child_complete_ids</field>
447             <field name="arch" type="xml">
448                 <tree string="BoM Structure" colors="blue:method">
449                     <field name="sequence" invisible="1"/>
450                     <field name="name"/>
451                     <field name="code"/>
452                     <field name="product_id"/>
453                     <field name="product_qty"/>
454                     <field name="product_uom"/>
455                     <field name="type"/>
456                     <field name="method" groups="base.group_extended"/>
457                     <field name="routing_id" groups="base.group_extended"/>
458                     <field name="date_start" groups="base.group_extended"/>
459                     <field name="date_stop" groups="base.group_extended"/>
460                 </tree>
461             </field>
462         </record>
463        <record id="mrp_bom_component_tree_view" model="ir.ui.view">
464             <field name="name">mrp.bom.component.tree</field>
465             <field name="model">mrp.bom</field>
466             <field name="type">tree</field>
467             <field name="field_parent">child_complete_ids</field>
468             <field name="arch" type="xml">
469                 <tree string="BoM Structure" colors="blue:method">
470                     <field name="sequence" invisible="1"/>
471                     <field name="name" string="Component Name"/>
472                     <field name="code"/>
473                     <field name="product_id" string="Component Product"/>
474                     <field name="bom_id"/>
475                     <field name="product_qty"/>
476                     <field name="product_uom"/>
477                     <field name="type"/>
478                     <field name="method" groups="base.group_extended"/>
479                     <field name="routing_id" groups="base.group_extended"/>
480                     <field name="date_start" groups="base.group_extended"/>
481                     <field name="date_stop" groups="base.group_extended"/>
482                 </tree>
483             </field>
484         </record>
485         <record id="mrp_bom_form_action" model="ir.actions.act_window">
486             <field name="name">Bill of Materials</field>
487             <field name="type">ir.actions.act_window</field>
488             <field name="res_model">mrp.bom</field>
489             <field name="view_type">form</field>
490             <field name="domain">[('bom_id','=',False)]</field>
491             <field name="search_view_id" ref="view_mrp_bom_filter"/>
492             <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>
493         </record>
494         <record id="mrp_bom_form_action2" model="ir.actions.act_window">
495             <field name="name">Bill of Material Components</field>
496             <field name="type">ir.actions.act_window</field>
497             <field name="res_model">mrp.bom</field>
498             <field name="view_type">form</field>
499             <field name="view_id" ref="mrp_bom_component_tree_view"/>
500             <field name="domain">[('bom_id','!=',False)]</field>
501             <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>
502         </record>
503
504         <!-- BOM menus -->
505
506         <menuitem
507             action="mrp_bom_form_action"
508             id="menu_mrp_bom_form_action"
509             parent="menu_mrp_bom"
510             sequence="10"/>
511         <menuitem
512             action="mrp_bom_form_action2"
513             id="menu_mrp_bom_form_action2"
514             groups="base.group_extended"
515             parent="menu_mrp_bom"
516             sequence="20"/>
517
518         <record id="action2" model="ir.actions.act_window">
519             <field name="name">Bill of Materials Structure</field>
520             <field name="type">ir.actions.act_window</field>
521             <field name="res_model">mrp.bom</field>
522             <field name="domain">[('id','=',active_id)]</field>
523             <field name="view_type">tree</field>
524             <field name="view_id" ref="mrp_bom_tree_view"/>
525         </record>
526         <record id="ir_BOM_structure" model="ir.values">
527             <field eval="'client_action_multi'" name="key2"/>
528             <field eval="'mrp.bom'" name="model"/>
529             <field name="name">Bill of Materials Structure</field>
530             <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
531             <field eval="True" name="object"/>
532         </record>
533
534         <record id="mrp_bom_revision_tree" model="ir.ui.view">
535             <field name="name">mrp.bom.revision</field>
536             <field name="model">mrp.bom.revision</field>
537             <field name="type">tree</field>
538             <field name="arch" type="xml">
539                 <tree string="BoM Revisions">
540                     <field name="indice"/>
541                     <field name="author_id"/>
542                     <field name="date"/>
543                     <field colspan="4" name="name"/>
544                 </tree>
545             </field>
546         </record>
547         <record id="mrp_bom_revision_form" model="ir.ui.view">
548             <field name="name">mrp.bom.revision</field>
549             <field name="model">mrp.bom.revision</field>
550             <field name="type">form</field>
551             <field name="arch" type="xml">
552                 <form string="BoM Revisions">
553                     <field colspan="4" name="name"/>
554                     <field colspan="1" name="indice"/>
555                     <field colspan="1" name="date"/>
556                     <field name="author_id" readonly="1"/>
557                     <separator colspan="4" string="Description"/>
558                     <field colspan="4" name="description" nolabel="1"/>
559                 </form>
560             </field>
561         </record>
562
563         <!--
564         Production Management
565         -->
566         <record id="mrp_production_tree_view" model="ir.ui.view">
567             <field name="name">mrp.production.tree</field>
568             <field name="model">mrp.production</field>
569             <field name="type">tree</field>
570             <field name="arch" type="xml">
571                 <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">
572                     <field name="name"/>
573                     <field name="date_planned"/>
574                     <field name="product_id"/>
575                     <field name="product_qty" sum="Total Qty"/>
576                     <field name="product_uom"/>
577                     <field name="routing_id" groups="base.group_extended"/>
578                     <field name="hour_total" sum="Total Hours" groups="base.group_extended"/>
579                     <field name="cycle_total" sum="Total Cycles" groups="base.group_extended"/>
580                     <field name="origin"/>
581                     <field name="state"/>
582                 </tree>
583             </field>
584         </record>
585
586         <record id="view_production_calendar" model="ir.ui.view">
587             <field name="name">mrp.production.calendar</field>
588             <field name="model">mrp.production</field>
589             <field name="type">calendar</field>
590             <field eval="2" name="priority"/>
591             <field name="arch" type="xml">
592                 <calendar color="routing_id" date_start="date_planned" string="Manufacturing Orders">
593                     <field name="name"/>
594                     <field name="product_id"/>
595                     <field name="product_qty"/>
596                 </calendar>
597             </field>
598         </record>
599
600
601         <record id="view_production_gantt" model="ir.ui.view">
602             <field name="name">mrp.production.gantt</field>
603             <field name="model">mrp.production</field>
604             <field name="type">gantt</field>
605             <field name="arch" type="xml">
606                 <gantt color="product_id" date_stop="date_finished" date_start="date_start" string="Productions">
607                     <level object="mrp.routing" link="routing_id" domain="[]">
608                         <field name="name"/>
609                         <field name="origin"/>
610                     </level>
611                 </gantt>
612             </field>
613         </record>
614
615
616         <record model="ir.ui.view" id="view_production_graph">
617             <field name="name">mrp.production.graph</field>
618             <field name="model">mrp.production</field>
619             <field name="type">graph</field>
620             <field name="arch" type="xml">
621                 <graph string="Manufacturing Orders" type="bar">
622                     <field name="date_planned_date"/>
623                     <field name="hour_total" operator="+"/>
624                     <field name="cycle_total" operator="+"/>
625                 </graph>
626             </field>
627         </record>
628
629         <record id="mrp_production_form_view" model="ir.ui.view">
630             <field name="name">mrp.production.form</field>
631             <field name="model">mrp.production</field>
632             <field name="type">form</field>
633             <field name="arch" type="xml">
634                 <form string="Manufacturing Orders">
635                     <group colspan="4" col="7">
636                         <field name="name" string="Reference"/>
637                         <field name="date_planned"/>
638                         <field name="origin"/>
639                         <newline/>
640                         <field name="product_id" on_change="product_id_change(product_id)"/>
641                         <field name="product_qty"/>
642                         <field name="product_uom"/>
643                         <button type="action"
644                             icon="terp-accessories-archiver+"
645                             name="%(mrp.action_change_production_qty)d"
646                             string="Change Qty" states="ready,confirmed" />
647                         <label string="" colspan="2"/>
648                         <field name="product_uos_qty" groups="product.group_uos"/>
649                         <field name="product_uos" groups="product.group_uos"/>
650                     </group>
651
652                     <notebook colspan="4">
653                         <page string="Consumed Products">
654                             <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
655                             <field name="routing_id" groups="base.group_extended" select="1"/>
656                             <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
657                             <field name="location_dest_id" domain="[('usage','=','internal')]"/>
658                             <separator string="" colspan="4"/>
659
660                             <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
661                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
662                                 <tree colors="blue:state in ('draft');black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
663                                     <field name="product_id" />
664                                     <field name="product_qty"  string="Qty"/>
665                                     <field name="product_uom"  string="UOM"/>
666                                     <field name="location_id"  string="Source Loc."/>
667                                     <field name="state" invisible="1"/>
668                                     <button name="%(stock.move_consume)d"
669                                         string="Consume Products" type="action"
670                                         icon="gtk-go-forward" context="{'consume': True}"
671                                         states="draft,waiting,confirmed,assigned" />
672                                     <button
673                                            name="%(stock.track_line)d"
674                                            string="Split in production lots"
675                                            type="action" icon="gtk-justify-fill"
676                                            states="draft,waiting,confirmed,assigned" />
677                                     <button name="%(stock.move_scrap)d"
678                                         string="Scrap Products" type="action"
679                                         icon="gtk-convert" context="{'scrap': True}"
680                                         states="draft,waiting,confirmed,assigned"/>
681                                 </tree>
682                             </field>
683
684                             <field colspan="2" name="move_lines2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
685                                        widget="one2many_list" mode="tree,form" height="275">
686                                    <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">
687                                        <field name="product_id" readonly="1"/>
688                                        <field name="product_qty" readonly="1" string="Qty"/>
689                                        <field name="product_uom" readonly="1" string="UOM"/>
690                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
691                                        <field name="state" invisible="1"/>
692                                        <field name="scrapped" invisible="1"/>
693                                        <button
694                                            name="%(stock.move_scrap)d"
695                                            string="Scrap Products" type="action"
696                                            icon="gtk-convert"
697                                            states="done,cancel"/>
698                                    </tree>
699                                </field>
700                             <separator colspan="4"/>
701                             <group col="9" colspan="4">
702                                 <field name="state"/>
703                                 <button name="button_cancel" states="draft,ready,in_production,picking_except" string="Cancel" icon="gtk-stop"/>
704                                 <button name="action_cancel" type="object" states="confirmed" string="Cancel" icon="gtk-stop"/>
705                                 <button name="button_confirm" states="draft" string="Confirm Production" icon="gtk-apply"/>
706                                 <button name="button_produce" states="ready" string="Start Production" icon="terp-gtk-jump-to-ltr"/>
707                                 <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" icon="gtk-ok" type="action"/>
708                                 <button name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object" icon="gtk-jump-to"/>
709                                 <button name="button_recreate" states="picking_except" string="Recreate Picking" icon="terp-document-new"/>
710                             </group>
711                         </page>
712                         <page string="Finished Products">
713                             <field colspan="2" name="move_created_ids" nolabel="1" widget="one2many_list"
714                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
715                                 <tree string="Products to Finish">
716                                     <field name="product_id" />
717                                     <field name="product_qty"  string="Qty"/>
718                                     <field name="product_uom"  string="UOM"/>
719                                     <field name="state" invisible="1"/>
720                                     <button name="%(stock.action_partial_move_server)d"
721                                         string="Partial"
722                                         type="action" states="confirmed,assigned"
723                                         icon="gtk-justify-fill"/>
724                                     <button name="%(stock.move_scrap)d"
725                                         string="Scrap Products" type="action"
726                                         icon="gtk-convert" context="{'scrap': True}"
727                                         states="draft,waiting,confirmed,assigned" />
728                                 </tree>
729                             </field>
730
731                             <field colspan="2" name="move_created_ids2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
732                                        widget="one2many_list" mode="tree,form" height="275">
733                                    <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">
734                                        <field name="product_id" readonly="1"/>
735                                        <field name="product_qty" readonly="1" string="Qty"/>
736                                        <field name="product_uom" readonly="1" string="UOM"/>
737                                        <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection"/>
738                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
739                                        <field name="scrapped" invisible="1"/>
740                                        <field name="state" invisible="1"/>
741                                        <button name="%(stock.track_line)d"
742                                             string="Split in production lots" type="action" icon="gtk-justify-fill" states="done,cancel"/>
743                                        <button name="%(stock.move_scrap)d"
744                                            string="Scrap Products" type="action" icon="gtk-convert"
745                                            states="done,cancel" />
746                                    </tree>
747                                </field>
748                         </page>
749                         <page string="Work Orders" groups="base.group_extended">
750                             <button name="action_compute" states="draft"
751                                 string="Compute Data" type="object"
752                                 icon="terp-stock_format-scientific"
753                                 colspan="2" />
754                             <field colspan="4" name="workcenter_lines" nolabel="1">
755                                 <form string="Production Work Centers">
756                                     <field colspan="4" name="name"/>
757                                     <field name="workcenter_id" widget="selection"/>
758                                     <field name="sequence"/>
759                                     <field name="cycle"/>
760                                     <field name="hour"/>
761                                 </form>
762                                 <tree string="Production Work Centers">
763                                     <field name="sequence"/>
764                                     <field name="name"/>
765                                     <field name="workcenter_id" widget="selection"/>
766                                     <field name="cycle"/>
767                                     <field name="hour"/>
768                                 </tree>
769                             </field>
770                         </page>
771                         <page string="Scheduled Products">
772                             <button name="action_compute" states="draft"
773                                 string="Compute Data" type="object"
774                                 icon="terp-stock_format-scientific"
775                                 colspan="2" />
776                             <field colspan="4" name="product_lines" nolabel="1" widget="one2many_list"/>
777                         </page>
778                         <page string="Extra Information">
779                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
780                             <field name="priority" groups="base.group_extended"/>
781                             <newline/>
782                             <field name="date_start"/>
783                             <field name="date_finished"/>
784                             <field name="picking_id" groups="base.group_extended"/>
785                             <field name="move_prod_id" groups="base.group_extended"/>
786                         </page>
787                     </notebook>
788                 </form>
789             </field>
790         </record>
791
792         <record id="view_mrp_production_filter" model="ir.ui.view">
793             <field name="name">mrp.production.select</field>
794             <field name="model">mrp.production</field>
795             <field name="type">search</field>
796             <field name="arch" type="xml">
797                 <search string="Search Production">
798                    <group col='9' colspan='4'>
799                        <filter icon="terp-gtk-media-pause" string="Pending" name="pending"
800                            domain="[('state','=','confirmed')]"
801                            help="Manufacturing Orders which are waiting for raw materials."/>
802                        <filter icon="terp-camera_test" string="Ready" name="ready"
803                            domain="[('state','=','ready')]"
804                            help="Manufacturing Orders which are ready to start production."/>
805                        <filter icon="terp-check" string="In Production" name="inprogress"
806                            domain="[('state','=','in_production')]"
807                            help="Manufacturing Orders which are currently in production."/>
808                        <separator orientation="vertical"/>
809                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
810                            domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
811                            help="Production started late" />
812                        <separator orientation="vertical"/>
813                        <field name="name"/>
814                        <field name="product_id"/>
815                        <field name="routing_id" groups="base.group_extended"/>
816                        <field name="origin"/>
817                     </group>
818                     <newline/>
819                     <group expand="0" string="Group By..." colspan="10" col="8" groups="base.group_extended">
820                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
821                         <separator orientation="vertical"/>
822                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}" groups="base.group_extended"/>
823                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
824                         <separator orientation="vertical"/>
825                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}" help="Scheduled Date"/>
826                     </group>
827                </search>
828             </field>
829         </record>
830
831         <record id="mrp_production_action" model="ir.actions.act_window">
832             <field name="name">Manufacturing Orders</field>
833             <field name="type">ir.actions.act_window</field>
834             <field name="res_model">mrp.production</field>
835             <field name="view_type">form</field>
836             <field name="view_mode">tree,form,calendar,graph,gantt</field>
837             <field name="view_id" eval="False"/>
838             <field name="search_view_id" ref="view_mrp_production_filter"/>
839             <field name="context">{'search_default_ready':1}</field>
840             <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>
841         </record>
842         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
843             parent="menu_mrp_manufacturing" sequence="1"/>
844
845         <record id="mrp_production_action_planning" model="ir.actions.act_window">
846             <field name="name">Manufacturing Orders</field>
847             <field name="type">ir.actions.act_window</field>
848             <field name="res_model">mrp.production</field>
849             <field name="view_type">form</field>
850             <field name="view_mode">calendar,tree,form,graph</field>
851             <field name="domain">[('state','in',('ready','confirmed','in_production'))]</field>
852             <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>
853         </record>
854
855         <record id="mrp_production_action2" model="ir.actions.act_window">
856             <field name="name">Manufacturing Orders To Start</field>
857             <field name="type">ir.actions.act_window</field>
858             <field name="res_model">mrp.production</field>
859             <field name="view_type">form</field>
860             <field name="view_mode">tree,form,calendar,graph,gantt</field>
861             <field name="domain">[('state','=','ready')]</field>
862             <field name="filter" eval="True"/>
863             <field name="search_view_id" ref="view_mrp_production_filter"/>
864         </record>
865
866         <record id="mrp_production_action3" model="ir.actions.act_window">
867             <field name="name">Manufacturing Orders in Progress</field>
868             <field name="type">ir.actions.act_window</field>
869             <field name="res_model">mrp.production</field>
870             <field name="view_type">form</field>
871             <field name="view_mode">tree,form,calendar,graph,gantt</field>
872             <field name="domain">[('state','=','in_production')]</field>
873             <field name="filter" eval="True"/>
874             <field name="search_view_id" ref="view_mrp_production_filter"/>
875         </record>
876
877         <record id="mrp_production_action4" model="ir.actions.act_window">
878             <field name="name">Manufacturing Orders Waiting Products</field>
879             <field name="type">ir.actions.act_window</field>
880             <field name="res_model">mrp.production</field>
881             <field name="view_type">form</field>
882             <field name="view_mode">tree,form,calendar,graph,gantt</field>
883             <field name="domain">[('state','=','confirmed')]</field>
884             <field name="filter" eval="True"/>
885             <field name="search_view_id" ref="view_mrp_production_filter"/>
886         </record>
887
888         <record id="mrp_production_lot_form_view" model="ir.ui.view">
889             <field name="name">mrp.production.lot.line.form</field>
890             <field name="model">mrp.production.lot.line</field>
891             <field name="type">form</field>
892             <field name="arch" type="xml">
893                 <form string="Production Products">
894                     <field colspan="4" name="move_id" on_change="onchange_lot_line_id(lot_id)"/>
895                     <field name="name"/>
896                     <field name="product_id"/>
897                     <field name="product_qty"/>
898                     <field name="product_uom"/>
899                     <field name="product_uos_qty" groups="product.group_uos"/>
900                     <field name="product_uos" groups="product.group_uos"/>
901                     <field name="tracking_id"/>
902                 </form>
903             </field>
904         </record>
905         <record id="mrp_production_lot_tree_view" model="ir.ui.view">
906             <field name="name">mrp.production.lot.line.tree</field>
907             <field name="model">mrp.production.lot.line</field>
908             <field name="type">tree</field>
909             <field name="arch" type="xml">
910                 <tree string="Production Products Consommation">
911                     <field name="product_id"/>
912                     <field name="product_qty"/>
913                     <field name="product_uom"/>
914                     <field name="product_uos_qty" groups="product.group_uos"/>
915                     <field name="product_uos" groups="product.group_uos"/>
916                     <field name="tracking_id"/>
917                 </tree>
918             </field>
919         </record>
920
921         <record id="mrp_production_product_form_view" model="ir.ui.view">
922             <field name="name">mrp.production.product.line.form</field>
923             <field name="model">mrp.production.product.line</field>
924             <field name="type">form</field>
925             <field name="arch" type="xml">
926                 <form string="Scheduled Products">
927                     <field name="name"/>
928                     <field name="product_id"/>
929                     <field name="product_qty"/>
930                     <field name="product_uom"/>
931                     <field name="product_uos_qty" groups="product.group_uos"/>
932                     <field name="product_uos" groups="product.group_uos"/>
933                 </form>
934             </field>
935         </record>
936         <record id="mrp_production_product_tree_view" model="ir.ui.view">
937             <field name="name">mrp.production.product.line.tree</field>
938             <field name="model">mrp.production.product.line</field>
939             <field name="type">tree</field>
940             <field name="arch" type="xml">
941                 <tree string="Scheduled Products">
942                     <field name="product_id"/>
943                     <field name="product_qty"/>
944                     <field name="product_uom"/>
945                     <field name="product_uos_qty" groups="product.group_uos"/>
946                     <field name="product_uos" groups="product.group_uos"/>
947                 </tree>
948             </field>
949         </record>
950
951         <!--
952             Procurements
953         -->
954
955         <record id="view_procurement_form_inherit" model="ir.ui.view">
956             <field name="name">procurement.order.form.inherit</field>
957             <field name="model">procurement.order</field>
958             <field name="inherit_id" ref="procurement.procurement_form_view"/>
959             <field name="type">form</field>
960             <field name="arch" type="xml">
961             <data>
962                 <xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
963                     <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
964                 </xpath>
965                 <xpath expr="/form/notebook/page/field[@name='close_move']" position="after">
966                     <group colspan="4"  groups="base.group_extended">
967                     <separator colspan="4" string="Properties" />
968                     <field colspan="4" name="property_ids" nolabel="1"/>
969                      </group>
970                 </xpath>
971                </data>
972             </field>
973         </record>
974         <act_window
975             id="action_product_bom_structure"
976             name="Product BoM Structure"
977             domain="[('product_id', '=', active_id),('bom_id','=',False)]"
978             view_type="tree"
979             view_id="mrp_bom_tree_view"
980             res_model="mrp.bom"
981             src_model="product.product"
982             groups="mrp.group_mrp_user"/>
983
984         <act_window
985             domain="[('bom_id','=',False)]"
986             context="{'search_default_product_id': [active_id],'default_product_id':active_id}"
987             id="act_product_product_2_mrp_bom"
988             name="Bill of Materials"
989             res_model="mrp.bom"
990             src_model="product.product"
991             groups="mrp.group_mrp_user"/>
992
993         <!-- Menu for Resource for MRP-->
994
995         <record id="mrp_workcenter_action" model="ir.actions.act_window">
996             <field name="name">Work Centers</field>
997             <field name="type">ir.actions.act_window</field>
998             <field name="res_model">mrp.workcenter</field>
999             <field name="view_type">form</field>
1000             <field name="view_id" ref="mrp_workcenter_tree_view"/>
1001             <field name="search_view_id" ref="view_mrp_workcenter_search"/>
1002             <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>
1003         </record>
1004
1005         <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration"/>
1006         <menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
1007         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
1008         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
1009
1010         <!-- Planning -->
1011
1012         <menuitem id="menu_mrp_planning" name="Planning"
1013                 parent="base.menu_mrp_root" sequence="2"
1014                 groups="base.group_extended"/>
1015         <menuitem action="mrp.mrp_production_action_planning"
1016                 id="menu_mrp_production_order_action"
1017                 parent="menu_mrp_planning" sequence="1"/>
1018
1019     </data>
1020 </openerp>