price_hist.xml
5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_tandur_price_hist_tree" model="ir.ui.view">
<field name="name">view.tandur.price.hist.tree</field>
<field name="model">tandur.price.hist</field>
<field name="arch" type="xml">
<tree string="Price History" sample="1" create="1" delete="1">
<!-- editable="top" -->
<field name="period"/>
<field name="product_id"/>
<field name="price"/>
</tree>
</field>
</record>
<!--editable="top" sample="1" create="1" delete="1" multi_edit="0"-->
<!-- <record id="view_tandur_price_hist_tree" model="ir.ui.view">-->
<!-- <field name="name">view.tandur.price.hist.tree</field>-->
<!-- <field name="model">tandur.price.hist</field>-->
<!-- <field name="arch" type="xml">-->
<!-- <tree string="Price History" editable="top" sample="1" multi_edit="0">-->
<!-- <field name="year"/>-->
<!-- <field name="month"/>-->
<!-- <field name="period"/>-->
<!-- <field name="product_id"/>-->
<!-- <field name="price"/>-->
<!-- </tree>-->
<!-- </field>-->
<!-- </record>-->
<record id="view_tandur_price_hist_form" model="ir.ui.view">
<field name="name">view.tandur.price.hist.form</field>
<field name="model">tandur.price.hist</field>
<field name="arch" type="xml">
<form string="Price History">
<sheet>
<div class="oe_title">
<h1>
<field name="product_id"/>
</h1>
</div>
<group>
<field name="year" options="{'format': 0}"/>
<field name="month" options="{'format': 00}"/>
<field name="price"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="tandur_price_hist_graph">
<field name="name">tandur.price.hist.graph</field>
<field name="model">tandur.price.hist</field>
<field name="arch" type="xml">
<graph string="Price History" sample="1">
<field name="period"/>
<field name="product_id"/>
<field name="price" type="measure"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="tandur_price_hist_pivot">
<field name="name">tandur.price.hist.pivot</field>
<field name="model">tandur.price.hist</field>
<field name="arch" type="xml">
<pivot string="Price History" display_quantity="True" sample="1">
<field name="product_id" type="row"/>
<field name="period" type="row"/>
<field name="price" type="measure"/>
</pivot>
</field>
</record>
<record id="view_tandur_price_hist_filter" model="ir.ui.view">
<field name="name">view.tandur.price.hist.filter</field>
<field name="model">tandur.price.hist</field>
<field name="arch" type="xml">
<search string="Search Product">
<field name="product_id" string="Product"/>
<separator/>
<group expand="0" string="Group By...">
<filter string="Product" name="group_by_product" domain="[]"
context="{'group_by': 'product_id'}"/>
<filter string='Year' name="group_by_year" domain="[]" context="{'group_by' : 'year'}"/>
</group>
</search>
</field>
</record>
<!-- <record id="action_tandur_price_hist_search" model="ir.actions.act_window">-->
<!-- <field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>-->
<!-- <field name="name">Price History</field>-->
<!-- <field name="res_model">tandur.price.hist</field>-->
<!-- <field name="view_type">form</field>-->
<!-- <field name="domain">[]</field> <!– Force empty –>-->
<!-- </record>-->
<record id="action_tandur_price_hist" model="ir.actions.act_window">
<field name="name">History of Price</field>
<field name="res_model">tandur.price.hist</field>
<field name="context">{'search_default_group_by_product': 1}</field>
<field name="view_mode">tree,form,graph,pivot</field>
<field name="search_view_id" ref="view_tandur_price_hist_filter"/>
<field name="view_id" ref="view_tandur_price_hist_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
History of Price Not Found
</p>
</field>
</record>
</data>
</odoo>