[IMP] Reportings Review
[odoo/odoo.git] / addons / mrp_operations / report / mrp_workorder_analysis_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <!--
5         Work Order Report
6         -->
7         <record id="view_report_mrp_workorder_graph" model="ir.ui.view">
8             <field name="name">mrp.workorder.graph</field>
9             <field name="model">mrp.workorder</field>
10             <field name="arch" type="xml">
11                 <graph string="Work Orders" type="pivot">
12                     <field name="workcenter_id" type="row"/>
13                     <field name="date" interval="month" type="col"/>
14                     <field name="product_qty" type="measure"/>
15                     <field name="total_hours" type="measure"/>
16                     <field name="total_cycles" type="measure"/>
17                 </graph>
18             </field>
19         </record>
20
21         <!-- Custom reports (aka filters) -->
22         <record id="filter_mrp_workorder_workload" model="ir.filters">
23             <field name="name">Workload</field>
24             <field name="model_id">mrp.workorder</field>
25             <field name="user_id" eval="False"/>
26             <field name="context">{'group_by': ['workcenter_id'], 'col_group_by': ['date:month'], 'measures': ['total_hours', 'total_cycles']}</field>
27         </record>
28         <record id="filter_mrp_workorder_quantity_produced" model="ir.filters">
29             <field name="name">Quantity Produced</field>
30             <field name="model_id">mrp.workorder</field>
31             <field name="domain">[('state','=','done')]</field>
32             <field name="user_id" eval="False"/>
33             <field name="context">{'group_by': ['workcenter_id'], 'col_group_by': ['date:month'], 'measures': ['total_hours', 'total_cycles']}</field>
34         </record>
35         <record id="filter_mrp_workorder_current_production" model="ir.filters">
36             <field name="name">Current Production</field>
37             <field name="model_id">mrp.workorder</field>
38             <field name="domain">[('state','=','startworking')]</field>
39             <field name="user_id" eval="False"/>
40             <field name="context">{'group_by': ['workcenter_id'], 'col_group_by': ['product_id'], 'measures': ['product_qty', 'total_hours']}</field>
41         </record>
42
43         <record id="view_report_mrp_workorder_filter" model="ir.ui.view">
44             <field name="name">mrp.workorder.select</field>
45             <field name="model">mrp.workorder</field>
46             <field name="arch" type="xml">
47                 <search string="Search">
48                     <field name="date"/>
49                     <filter string="Current" domain="[('state','not in',('draft','cancel','done'))]"/>
50                     <filter string="Started" name="started" domain="[('state','=','startworking')]"/>
51                     <filter string="Done" name="done" domain="[('state','=','done')]"/>
52                     <field name="product_id" />
53                     <field name="workcenter_id"/>
54                     <group expand="1" string="Group By">
55                         <filter string="Work Center" name="Workcenter" context="{'group_by':'workcenter_id'}" />
56                         <filter string="Production" context="{'group_by':'production_id'}"/>
57                         <filter string="Status" context="{'group_by':'state'}"/>
58                         <filter string="Product" name="Product" context="{'group_by':'product_id'}" />
59                         <separator/>
60                         <filter string="Planned Month" name="terp-go-month" context="{'group_by':'date:month'}" help="Planned Month"/>
61                     </group>
62                 </search>
63             </field>
64         </record>
65         <record id="action_report_mrp_workorder" model="ir.actions.act_window">
66             <field name="name">Work Order</field>
67             <field name="res_model">mrp.workorder</field>
68             <field name="view_type">form</field>
69             <field name="view_mode">graph</field>
70             <field name="view_id" ref="view_report_mrp_workorder_graph"/>
71             <field name="search_view_id" ref="view_report_mrp_workorder_filter"/>
72             <field name="context">{'search_default_Workcenter': 1,'group_by_no_leaf':1,'group_by':[]}</field>
73         </record>
74
75         <record model="ir.actions.act_window.view" id="action_report_mrp_workorder_graph">
76             <field name="sequence" eval="2"/>
77             <field name="view_mode">graph</field>
78             <field name="view_id" ref="view_report_mrp_workorder_graph"/>
79             <field name="act_window_id" ref="action_report_mrp_workorder"/>
80         </record>
81
82         <menuitem name="Work Order Analysis" action="action_report_mrp_workorder" id="menu_report_mrp_workorders_tree" parent="mrp.next_id_77"/>
83
84   </data>
85 </openerp>