1 <?xml version="1.0" encoding="utf-8"?>
5 <!-- Purchases by products by month -->
6 <record id="view_order_product_form" model="ir.ui.view">
7 <field name="name">report.purchase.order.product.form</field>
8 <field name="model">report.purchase.order.product</field>
9 <field name="type">form</field>
10 <field name="arch" type="xml">
11 <form string="Purchases by products">
12 <field name="name" select="1"/>
13 <field name="product_id" select="1"/>
15 <field name="quantity" select="1"/>
16 <field name="price_total" select="1"/>
17 <field name="price_average" select="1"/>
18 <field name="state" select="1"/>
23 <record model="ir.ui.view" id="view_product_month_graph">
24 <field name="name">product.month.graph</field>
25 <field name="model">report.purchase.order.product</field>
26 <field name="type">graph</field>
27 <field name="arch" type="xml">
28 <graph string="Purchases by products" type="bar">
29 <field name="product_id"/>
30 <field name="quantity" operator="+"/>
31 <field name="price_total" operator="+"/>
36 <record id="view_order_product_tree" model="ir.ui.view">
37 <field name="name">report.purchase.order.product.tree</field>
38 <field name="model">report.purchase.order.product</field>
39 <field name="type">tree</field>
40 <field name="arch" type="xml">
41 <tree string="Purchases by products">
43 <field name="product_id"/>
45 <field name="quantity"/>
46 <field name="price_total"/>
47 <field name="price_average"/>
53 <record id="action_order_product_tree" model="ir.actions.act_window">
54 <field name="name">Purchases by Products (this month)</field>
55 <field name="res_model">report.purchase.order.product</field>
56 <field name="view_type">form</field>
57 <field name="view_mode">tree,graph</field>
58 <field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
60 <menuitem id="next_id_73" name="Reporting" parent="purchase.menu_purchase_root"/><menuitem id="next_id_74" name="This Month" parent="next_id_73"/><menuitem action="action_order_product_tree" id="menu_report_order_product" parent="next_id_74"/>
61 <record id="action_order_product_tree_all" model="ir.actions.act_window">
62 <field name="name">Purchases by Products</field>
63 <field name="res_model">report.purchase.order.product</field>
64 <field name="view_type">form</field>
65 <field name="view_mode">tree,graph</field>
67 <menuitem id="next_id_75" name="All Months" parent="report_purchase.next_id_73"/><menuitem action="action_order_product_tree_all" id="menu_report_order_product_all" parent="next_id_75"/>
69 <!-- Purchases by category by month -->
71 <record id="view_order_category_form" model="ir.ui.view">
72 <field name="name">report.purchase.order.category.form</field>
73 <field name="model">report.purchase.order.category</field>
74 <field name="type">form</field>
75 <field name="arch" type="xml">
76 <form string="Purchases by Category of Products">
77 <field name="name" select="1"/>
78 <field name="category_id" select="1"/>
80 <field name="quantity" select="1"/>
81 <field name="price_total" select="1"/>
82 <field name="price_average" select="1"/>
83 <field name="state" select="1"/>
88 <record model="ir.ui.view" id="view_product_category_graph">
89 <field name="name">product.category.graph</field>
90 <field name="model">report.purchase.order.category</field>
91 <field name="type">graph</field>
92 <field name="arch" type="xml">
93 <graph string="Purchases by Category of Products" type="bar">
94 <field name="category_id"/>
95 <field name="quantity" operator="+"/>
96 <field name="price_total" operator="+"/>
101 <record id="view_order_category_tree" model="ir.ui.view">
102 <field name="name">report.purchase.order.category.tree</field>
103 <field name="model">report.purchase.order.category</field>
104 <field name="type">tree</field>
105 <field name="arch" type="xml">
106 <tree string="Purchases by Category of Products">
108 <field name="category_id"/>
109 <field name="count"/>
110 <field name="quantity"/>
111 <field name="price_total"/>
112 <field name="price_average"/>
113 <field name="state"/>
118 <record id="action_order_category_tree" model="ir.actions.act_window">
119 <field name="name">Purchases by Category of Product (this month)</field>
120 <field name="res_model">report.purchase.order.category</field>
121 <field name="view_type">form</field>
122 <field name="view_mode">tree,graph</field>
123 <field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
125 <menuitem action="action_order_category_tree" id="menu_report_order_category" parent="report_purchase.next_id_74"/>
126 <record id="action_order_category_tree_all" model="ir.actions.act_window">
127 <field name="name">Purchases by Category of Products</field>
128 <field name="res_model">report.purchase.order.category</field>
129 <field name="view_type">form</field>
130 <field name="view_mode">tree,graph</field>
132 <menuitem action="action_order_category_tree_all" id="menu_report_order_category_all" parent="report_purchase.next_id_75"/>
134 <act_window domain="[('product_id', '=', active_id)]" id="act_product_product_2_report_purchases_order_product" name="Monthly purchases" res_model="report.purchase.order.product" src_model="product.product"/>
136 <act_window domain="[('category_id', '=', active_id)]" id="act_product_category_2_report_purchase_order_category" name="Monthly purchases" res_model="report.purchase.order.category" src_model="product.category"/>