merged with trunk
[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="6">
565                         <field name="name" string="Reference"/>
566                         <field name="date_planned"/>
567                         <field name="origin"/>
568                         <field name="product_id" on_change="product_id_change(product_id)"/>
569                         <field name="product_qty"/>
570                         <group colspan="2" col="4">
571                         <field name="product_uom"/>
572                         <button type="action"
573                             icon="terp-accessories-archiver+"
574                             name="%(mrp.action_change_production_qty)d"
575                             string="Change Qty" states="ready,confirmed" />
576                         </group>
577                         <label string="" colspan="2"/>
578                         <field name="product_uos_qty" groups="product.group_uos"/>
579                         <field name="product_uos" groups="product.group_uos"/>
580                     </group>
581
582                     <notebook colspan="4">
583                         <page string="Consumed Products">
584                             <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
585                             <field name="routing_id" groups="base.group_extended" select="1"/>
586                             <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
587                             <field name="location_dest_id" domain="[('usage','=','internal')]"/>
588                             <separator string="" colspan="4"/>
589
590                             <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
591                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
592                                 <tree colors="blue:state in ('draft');black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
593                                     <field name="product_id" />
594                                     <field name="product_qty"  string="Qty"/>
595                                     <field name="product_uom"  string="UOM"/>
596                                     <field name="location_id"  string="Source Loc."/>
597                                     <field name="state" invisible="1"/>
598                                     <button name="%(stock.move_consume)d"
599                                         string="Consume Products" type="action"
600                                         icon="gtk-go-forward" context="{'consume': True}"
601                                         states="draft,waiting,confirmed,assigned" />
602                                     <button name="%(stock.move_scrap)d"
603                                         string="Scrap Products" type="action"
604                                         icon="gtk-convert" context="{'scrap': True}"
605                                         states="draft,waiting,confirmed,assigned"/>
606                                 </tree>
607                             </field>
608
609                             <field colspan="2" name="move_lines2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
610                                        widget="one2many_list" mode="tree,form" height="275">
611                                    <tree colors="red:scrapped==True;blue:state in('draft');black:state in('picking_except','confirmed','ready','in_production');gray:state in('cancel') " string="Consumed Products" editable="bottom">
612                                        <field name="product_id" readonly="1"/>
613                                        <field name="product_qty" readonly="1" string="Qty"/>
614                                        <field name="product_uom" readonly="1" string="UOM"/>
615                                        <field name="location_dest_id"  readonly="1" string="Destination Loc."/>
616                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
617                                        <field name="state" invisible="1"/>
618                                        <field name="scrapped" invisible="1"/>
619                                        <button
620                                            name="%(stock.track_line)d"
621                                            string="Split in production lots"
622                                            type="action" icon="gtk-justify-fill"
623                                            states="done,cancel" />
624                                        <button
625                                            name="%(stock.move_scrap)d"
626                                            string="Scrap Products" type="action"
627                                            icon="gtk-convert"
628                                            states="done,cancel"/>
629                                    </tree>
630                                </field>
631                             <separator colspan="4"/>
632                             <group col="9" colspan="4">
633                                 <field name="state"/>
634                                 <button name="button_cancel" states="draft,ready,confirmed,in_production,picking_except" string="Cancel" icon="gtk-stop"/>
635                                 <button name="button_confirm" states="draft" string="Confirm Production" icon="gtk-apply"/>
636                                 <button name="button_produce" states="ready" string="Start Production" icon="terp-gtk-jump-to-ltr"/>
637                                 <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" icon="gtk-ok" type="action"/>
638                                 <button name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object" icon="gtk-jump-to"/>
639                                 <button name="button_recreate" states="picking_except" string="Recreate Picking" icon="terp-document-new"/>
640                             </group>
641                         </page>
642                         <page string="Finished Products">
643                             <field colspan="2" name="move_created_ids" nolabel="1" widget="one2many_list"
644                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
645                                 <tree string="Products to Finish">
646                                     <field name="product_id" />
647                                     <field name="product_qty"  string="Qty"/>
648                                     <field name="product_uom"  string="UOM"/>
649                                     <field name="location_id"  string="Source Loc." />
650                                     <field name="state" invisible="1"/>
651                                     <button name="%(stock.action_partial_move)d"
652                                         string="Partial"
653                                         type="action" states="confirmed,assigned"
654                                         icon="gtk-justify-fill"/>
655                                     <button name="%(stock.move_scrap)d"
656                                         string="Scrap Products" type="action"
657                                         icon="gtk-convert" context="{'scrap': True}"
658                                         states="draft,waiting,confirmed,assigned" />
659                                 </tree>
660                             </field>
661
662                             <field colspan="2" name="move_created_ids2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
663                                        widget="one2many_list" mode="tree,form" height="275">
664                                    <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">
665                                        <field name="product_id" readonly="1"/>
666                                        <field name="product_qty" readonly="1" string="Qty"/>
667                                        <field name="product_uom" readonly="1" string="UOM"/>
668                                        <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection"/>
669                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
670                                        <field name="scrapped" invisible="1"/>
671                                        <field name="state" invisible="1"/>
672                                        <button name="%(stock.track_line)d"
673                                             string="Split in production lots" type="action" icon="gtk-justify-fill" states="done,cancel"/>
674                                        <button name="%(stock.move_scrap)d"
675                                            string="Scrap Products" type="action" icon="gtk-convert"
676                                            states="done,cancel" />
677                                    </tree>
678                                </field>
679                         </page>
680                         <page string="Work Orders" groups="base.group_extended">
681                             <button name="action_compute" states="draft"
682                                 string="Compute Data" type="object"
683                                 icon="terp-stock_format-scientific"
684                                 colspan="4" />
685                             <field colspan="4" name="workcenter_lines" nolabel="1">
686                                 <form string="Production Work Centers">
687                                     <field colspan="4" name="name"/>
688                                     <field name="workcenter_id" widget="selection"/>
689                                     <field name="sequence"/>
690                                     <field name="cycle"/>
691                                     <field name="hour"/>
692                                 </form>
693                                 <tree string="Production Work Centers">
694                                     <field name="sequence"/>
695                                     <field name="name"/>
696                                     <field name="workcenter_id" widget="selection"/>
697                                     <field name="cycle"/>
698                                     <field name="hour"/>
699                                 </tree>
700                             </field>
701                         </page>
702                         <page string="Scheduled Products">
703                             <button name="action_compute" states="draft"
704                                 string="Compute Data" type="object"
705                                 icon="terp-stock_format-scientific"
706                                 colspan="4" />
707                             <field colspan="4" name="product_lines" nolabel="1" widget="one2many_list"/>
708                         </page>
709                         <page string="Extra Information">
710                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
711                             <field name="priority" groups="base.group_extended"/>
712                             <newline/>
713                             <field name="date_start"/>
714                             <field name="date_finished"/>
715                             <field name="picking_id" groups="base.group_extended"/>
716                             <field name="move_prod_id" groups="base.group_extended"/>
717                         </page>
718                     </notebook>
719                 </form>
720             </field>
721         </record>
722
723         <record id="view_mrp_production_filter" model="ir.ui.view">
724             <field name="name">mrp.production.select</field>
725             <field name="model">mrp.production</field>
726             <field name="type">search</field>
727             <field name="arch" type="xml">
728                 <search string="Search Production">
729                    <group col='9' colspan='4'>
730                        <filter icon="terp-camera_test" string="Ready" name="ready"
731                            domain="[('state','=','ready')]"
732                            help="Non confirmed manufacturing orders"/>
733                        <filter icon="terp-check" string="Current" name="current"
734                            domain="[('state','in',('confirmed','ready','exception','in_production'))]"
735                            help="Manufacturing Orders which are waiting for raw materials, confirmed, ready to start or currently in production."/>
736                        <separator orientation="vertical"/>
737                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
738                            domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
739                            help="Production started late" />
740                        <separator orientation="vertical"/>
741                        <field name="name"/>
742                        <field name="product_id"/>
743                        <field name="routing_id" groups="base.group_extended"/>
744                        <field name="origin"/>
745                     </group>
746                     <newline/>
747                     <group expand="0" string="Group By..." colspan="10" col="8" groups="base.group_extended">
748                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
749                         <separator orientation="vertical"/>
750                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}" groups="base.group_extended"/>
751                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
752                         <separator orientation="vertical"/>
753                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}" help="Scheduled Date"/>
754                     </group>
755                </search>
756             </field>
757         </record>
758
759         <record id="mrp_production_action" model="ir.actions.act_window">
760             <field name="name">Manufacturing Orders</field>
761             <field name="type">ir.actions.act_window</field>
762             <field name="res_model">mrp.production</field>
763             <field name="view_type">form</field>
764             <field name="view_mode">tree,form,calendar,graph,gantt</field>
765             <field name="view_id" eval="False"/>
766             <field name="search_view_id" ref="view_mrp_production_filter"/>
767             <field name="context">{'search_default_ready':1}</field>
768             <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>
769         </record>
770         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
771             parent="menu_mrp_manufacturing" sequence="1"/>
772
773         <record id="mrp_production_action_planning" model="ir.actions.act_window">
774             <field name="name">Manufacturing Orders</field>
775             <field name="type">ir.actions.act_window</field>
776             <field name="res_model">mrp.production</field>
777             <field name="view_type">form</field>
778             <field name="view_mode">calendar,tree,form,graph</field>
779             <field name="domain">[('state','in',('ready','confirmed','in_production'))]</field>
780             <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>
781         </record>
782
783         <record id="mrp_production_action2" model="ir.actions.act_window">
784             <field name="name">Manufacturing Orders To Start</field>
785             <field name="type">ir.actions.act_window</field>
786             <field name="res_model">mrp.production</field>
787             <field name="view_type">form</field>
788             <field name="view_mode">tree,form,calendar,graph,gantt</field>
789             <field name="domain">[('state','=','ready')]</field>
790             <field name="filter" eval="True"/>
791             <field name="search_view_id" ref="view_mrp_production_filter"/>
792         </record>
793
794         <record id="mrp_production_action3" model="ir.actions.act_window">
795             <field name="name">Manufacturing Orders in Progress</field>
796             <field name="type">ir.actions.act_window</field>
797             <field name="res_model">mrp.production</field>
798             <field name="view_type">form</field>
799             <field name="view_mode">tree,form,calendar,graph,gantt</field>
800             <field name="domain">[('state','=','in_production')]</field>
801             <field name="filter" eval="True"/>
802             <field name="search_view_id" ref="view_mrp_production_filter"/>
803         </record>
804
805         <record id="mrp_production_action4" model="ir.actions.act_window">
806             <field name="name">Manufacturing Orders Waiting Products</field>
807             <field name="type">ir.actions.act_window</field>
808             <field name="res_model">mrp.production</field>
809             <field name="view_type">form</field>
810             <field name="view_mode">tree,form,calendar,graph,gantt</field>
811             <field name="domain">[('state','=','confirmed')]</field>
812             <field name="filter" eval="True"/>
813             <field name="search_view_id" ref="view_mrp_production_filter"/>
814         </record>
815
816         <record id="mrp_production_lot_form_view" model="ir.ui.view">
817             <field name="name">mrp.production.lot.line.form</field>
818             <field name="model">mrp.production.lot.line</field>
819             <field name="type">form</field>
820             <field name="arch" type="xml">
821                 <form string="Production Products">
822                     <field colspan="4" name="move_id" on_change="onchange_lot_line_id(lot_id)"/>
823                     <field name="name"/>
824                     <field name="product_id"/>
825                     <field name="product_qty"/>
826                     <field name="product_uom"/>
827                     <field name="product_uos_qty" groups="product.group_uos"/>
828                     <field name="product_uos" groups="product.group_uos"/>
829                     <field name="tracking_id"/>
830                 </form>
831             </field>
832         </record>
833         <record id="mrp_production_lot_tree_view" model="ir.ui.view">
834             <field name="name">mrp.production.lot.line.tree</field>
835             <field name="model">mrp.production.lot.line</field>
836             <field name="type">tree</field>
837             <field name="arch" type="xml">
838                 <tree string="Production Products Consommation">
839                     <field name="product_id"/>
840                     <field name="product_qty"/>
841                     <field name="product_uom"/>
842                     <field name="product_uos_qty" groups="product.group_uos"/>
843                     <field name="product_uos" groups="product.group_uos"/>
844                     <field name="tracking_id"/>
845                 </tree>
846             </field>
847         </record>
848
849         <record id="mrp_production_product_form_view" model="ir.ui.view">
850             <field name="name">mrp.production.product.line.form</field>
851             <field name="model">mrp.production.product.line</field>
852             <field name="type">form</field>
853             <field name="arch" type="xml">
854                 <form string="Scheduled Products">
855                     <field name="name"/>
856                     <field name="product_id"/>
857                     <field name="product_qty"/>
858                     <field name="product_uom"/>
859                     <field name="product_uos_qty" groups="product.group_uos"/>
860                     <field name="product_uos" groups="product.group_uos"/>
861                 </form>
862             </field>
863         </record>
864         <record id="mrp_production_product_tree_view" model="ir.ui.view">
865             <field name="name">mrp.production.product.line.tree</field>
866             <field name="model">mrp.production.product.line</field>
867             <field name="type">tree</field>
868             <field name="arch" type="xml">
869                 <tree string="Scheduled Products">
870                     <field name="product_id"/>
871                     <field name="product_qty"/>
872                     <field name="product_uom"/>
873                     <field name="product_uos_qty" groups="product.group_uos"/>
874                     <field name="product_uos" groups="product.group_uos"/>
875                 </tree>
876             </field>
877         </record>
878
879         <!--
880             Procurements
881         -->
882
883         <record id="view_procurement_form_inherit" model="ir.ui.view">
884             <field name="name">procurement.order.form.inherit</field>
885             <field name="model">procurement.order</field>
886             <field name="inherit_id" ref="procurement.procurement_form_view"/>
887             <field name="type">form</field>
888             <field name="arch" type="xml">
889             <data>
890                 <xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
891                     <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
892                 </xpath>
893                 <xpath expr="/form/notebook/page/field[@name='close_move']" position="after">
894                     <group colspan="4"  groups="base.group_extended">
895                     <separator colspan="4" string="Properties" />
896                     <field colspan="4" name="property_ids" nolabel="1"/>
897                      </group>
898                 </xpath>
899                </data>
900             </field>
901         </record>
902         <act_window
903             id="action_product_bom_structure"
904             name="Product BoM Structure"
905             domain="[('product_id', '=', active_id),('bom_id','=',False)]"
906             view_type="tree"
907             view_id="mrp_bom_tree_view"
908             res_model="mrp.bom"
909             src_model="product.product"
910             groups="mrp.group_mrp_user"/>
911
912         <act_window
913             domain="[('bom_id','=',False)]"
914             context="{'search_default_product_id': [active_id],'default_product_id':active_id}"
915             id="act_product_product_2_mrp_bom"
916             name="Bill of Materials"
917             res_model="mrp.bom"
918             src_model="product.product"
919             groups="mrp.group_mrp_user"/>
920
921         <!-- Menu for Resource for MRP-->
922
923         <record id="mrp_workcenter_action" model="ir.actions.act_window">
924             <field name="name">Work Centers</field>
925             <field name="type">ir.actions.act_window</field>
926             <field name="res_model">mrp.workcenter</field>
927             <field name="view_type">form</field>
928             <field name="view_id" ref="mrp_workcenter_tree_view"/>
929             <field name="search_view_id" ref="view_mrp_workcenter_search"/>
930             <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>
931         </record>
932
933         <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration"/>
934         <menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
935         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
936         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1"/>
937
938         <!-- Planning -->
939
940         <menuitem id="menu_mrp_planning" name="Planning"
941                 parent="base.menu_mrp_root" sequence="2"
942                 groups="base.group_extended"/>
943         <menuitem action="mrp.mrp_production_action_planning"
944                 id="menu_mrp_production_order_action"
945                 parent="menu_mrp_planning" sequence="1"/>
946
947     </data>
948 </openerp>