This repository has been archived by the owner on Oct 6, 2020. It is now read-only.
forked from mga-team/openerp-sale_simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsale_view.xml
152 lines (144 loc) · 7.99 KB
/
sale_view.xml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?xml version='1.0' encoding='UTF-8'?>
<openerp>
<data>
<menuitem id="menu_simulator"
name="Simulator"
parent="base.menu_base_partner"
groups="sale_simulator.group_sale_configurator"/>
<record model="ir.ui.view" id="view_sale_simulator_form">
<field name="name">sale.simulator.form</field>
<field name="model">sale.simulator</field>
<field name="priority" eval="7"/>
<field name="arch" type="xml">
<form string="Feature item" version="7.0">
<header>
</header>
<sheet>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name"/>
</div>
<h1>
<field name="name" default_focus="1" placeholder="Number" />
</h1>
</div>
<group colspan="4">
<field name="partner_id" on_change="onchange_partner(partner_id)"/>
<field name="fiscal_position"/>
<field name="pricelist_id"/>
<field name="shop_id"/>
<field name="user_id"/>
<field name="validity_date"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<field name="line_ids" nolabel="1" colspan="4">
<tree string="Lines">
<field name="description" width="450"/>
<field name="item_id" domain="[('type','=','p')]"/>
<field name="quantity"/>
<field name="factory_price"/>
<field name="discount"/>
<field name="retail_price"/>
<field name="margin"/>
<field name="sale_price"/>
<button string="Compute price"
icon="gtk-ok"
type="object"
name="compute_price"/>
<button string="Create Sale order"
icon="gtk-justify-fill"
type="object"
name="create_sale_order"
attrs="{'invisible': [('order_id','!=', False)]}"/>
<button string="Cancel Sale order"
icon="gtk-cancel"
type="object"
name="cancel_sale_order"
attrs="{'invisible': [('order_id','=', False)]}"/>
<field name="order_id" readonly="1"/>
</tree>
<form string="Lines" version="7.0">
<header>
<button name="check_config" string="Check" type="object"/>
<button string="Create Sale Order" icon="gtk-justofy-fill" type="object" name="create_sale_order"
attrs="{'invisible': [('order_id','!=', False)]}"/>
<button string="Compute price" icon="gtk-ok" type="object" name="compute_price"/>
<button string="Cancel Sale order" icon="gtk-cancel" type="object" name="cancel_sale_order"
attrs="{'invisible': [('order_id','=', False)]}"/>
</header>
<sheet>
<group colspan="4">
<field name="item_id" domain="[('type','=','p')]"
on_change="onchange_product(item_id, description)"/>
<field name="description"/>
<group colspan="4" col="4">
<field name="quantity"/>
<field name="discount" on_change="onchange_discount(item_id, discount, retail_price)"/>
<field name="factory_price"/>
<field name="retail_price"/>
<field name="sale_price" on_change="onchange_saleprice(item_id, retail_price, sale_price)"/>
<field name="margin"/>
</group>
<field name="order_id" readonly="1"/>
<field name="line_ids" nolabel="1" colspan="4">
<tree string="Item" editable="bottom">
<field name="item_id2" domain="[('type','=','m'),('p_item_id','=',parent.item_id)]"
width="450" on_change="onchange_item(item_id2)"/>
<field name="factory_price"/>
<field name="retail_price"/>
</tree>
</field>
<field name="message" colspan="2" nolabel="1" readonly="1"/>
</group>
</sheet>
</form>
</field>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_sale_simulator_tree">
<field name="name">sale.simulator.tree</field>
<field name="model">sale.simulator</field>
<field name="priority" eval="7"/>
<field name="arch" type="xml">
<tree string="Feature item">
<field name="name"/>
<field name="partner_id"/>
<field name="pricelist_id"/>
<field name="user_id"/>
<field name="shop_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_sale_simulator_all">
<field name="name">Sale simulator</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.simulator</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_sale_simulator_tree"/>
</record>
<menuitem name="All Simulations"
action="action_sale_simulator_all"
sequence="10"
id="menu_sale_simulator_all"
parent="menu_simulator"
groups="sale_simulator.group_sale_configurator"/>
<record model="ir.actions.act_window" id="action_sale_simulator_my">
<field name="name">Sale simulator</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.simulator</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_sale_simulator_tree"/>
<field name="domain">[('user_id','=',uid)]</field>
</record>
<menuitem name="My Simulations"
action="action_sale_simulator_my"
sequence="10"
id="menu_sale_simulator_my"
parent="menu_simulator"
groups="sale_simulator.group_sale_configurator"/>
</data>
</openerp>