forked from OCA/purchase-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
purchase_view.xml
213 lines (199 loc) · 9.92 KB
/
purchase_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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="c2c_landed_cost_tree">
<field name="name">c2clanded.cost.tree</field>
<field name="model">landed.cost.position</field>
<field name="priority">1</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Landing Costs" editable="bottom">
<field name="generate_invoice"/>
<field name="product_id" context="{'landed_cost_type':'per_unit'}" on_change="onchange_product_id(product_id)"/>
<field name="account_id" invisible="1"/>
<field name="partner_id"/>
<field name="amount"/>
<field name="distribution_type_id" domain="[('apply_on','=','line')]" widget="selection"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="c2c_landed_cost_form">
<field name="name">c2clanded.cost.form</field>
<field name="model">landed.cost.position</field>
<field name="priority">1</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Landing Costs">
<field name="generate_invoice"/>
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="account_id" invisible="1"/>
<field name="partner_id"/>
<field name="amount"/>
<field name="distribution_type_id" domain="[('apply_on','=','line')]" widget="selection"/>
</form>
</field>
</record>
<!-- ******************
Landed cost definition in product form
******************-->
<record model="ir.ui.view" id="c2c_product_landed_cost_view">
<field name="name">c2c_product.landed.cost.view</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="description" position="before">
<group>
<field name="landed_cost_type" groups="purchase.group_purchase_user"/>
</group>
</field>
</field>
</record>
<!-- Analysis (placed before the view due to the action in c2c_purchase_order_landed_cost_view -->
<record model="ir.ui.view" id="c2c_landed_cost_tree_stat">
<field name="name">c2clanded.cost.tree</field>
<field name="model">landed.cost.position</field>
<field name="priority">20</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Landing Costs" create="false">
<field name="date_po"/>
<field name="product_id"/>
<field name="account_id" />
<field name="partner_id"/>
<field name="amount_total" sum="Total amount"/>
<field name="amount_total_comp_currency" sum="Total amount"/>
<field name="distribution_type_id" widget="selection"/>
<field name="purchase_order_id"/>
<field name="purchase_order_line_id"/>
</tree>
</field>
</record>
<record id="act_po_2_landed_costs" model="ir.actions.act_window">
<field name="name">Related Landed Costs</field>
<field name="res_model">landed.cost.position</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_purchase_order_id': active_id}</field>
<field name="view_id" ref="c2c_landed_cost_tree_stat"></field>
</record>
<!-- Landed costs Purchase Form-->
<record model="ir.ui.view" id="c2c_purchase_order_landed_cost_view">
<field name="name">c2c_purchase.order.landed.cost.form.view</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<data>
<field name="price_subtotal" position="after">
<field name="landing_costs" invisible="1"/>
<field name="landing_costs_order"/>
<field name="landed_costs"/>
</field>
<notebook position="inside">
<page string="Landing Costs" attrs="{'readonly':[('state','=','done')]}">
<group>
<group>
<field name="quantity_total"/>
<field name="landed_cost_base_quantity" />
<field name="landed_cost_base_value" />
</group>
<group>
<field name="landing_cost_lines"/>
<field name="landed_cost"/>
<button name="%(act_po_2_landed_costs)d" type="action"
string="Open All Landed costs"/>
</group>
</group>
<field name="landed_cost_line_ids" colspan="4" nolabel="1" context="{'landed_cost_type':'per_unit'}" widget="one2many_list">
<tree string="Landing Costs" editable="bottom">
<field name="generate_invoice"/>
<field name="product_id" on_change="onchange_product_id(product_id,parent.id)"/>
<field name="account_id" invisible="1"/>
<field name="partner_id"/>
<field name="amount"/>
<field name="distribution_type_id" domain="[('apply_on','=','order')]" widget="selection"/>
</tree>
</field>
</page>
</notebook>
</data>
</field>
</record>
<!-- inherited view to make the order lines list in the form non-editable-->
<record id="view_order_form_editable_list" model="ir.ui.view">
<field name="name">purchase.order.landed.cost.form.view.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree" position="attributes">
<attribute name="editable"/>
</xpath>
</field>
</record>
<!-- Landed costs Purchase Line Form-->
<record model="ir.ui.view" id="purchase_oder_line_landed_cost_view">
<field name="name">purchase.oder.line.landed.cost.view</field>
<field name="model">purchase.order.line</field>
<field name="inherit_id" ref="purchase.purchase_order_line_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Landing Costs" >
<group colspan="2" col="2">
<field name="landing_costs"/>
<field name="landing_costs_order"/>
<field name="landed_costs"/>
<field name="landed_cost_line_ids" colspan="4" nolabel="1" widget="one2many_list"/>
</group>
</page>
</notebook>
</field>
</record>
<record id="view_landed_cost_search" model="ir.ui.view">
<field name="name">landed.cost.position.search</field>
<field name="model">landed.cost.position</field>
<field name="arch" type="xml">
<search string="Purchase Orders">
<field name="date_po"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="product_id"/>
<field name="distribution_type_id"/>
<field name="purchase_order_id"/>
<field name="purchase_order_line_id"/>
<newline/>
<group expand="1" string="Group By...">
<filter string="Date" name="group_date_po" icon="terp-personal" context="{'group_by':'date_po'}"/>
<filter string="Supplier" name="group_partner_id" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<filter string="Account" name="group_account_id" icon="terp-stock_symbol-selection" context="{'group_by':'account_id'}"/>
<filter string="Landed Cost Name" name="group_product_id" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Distribution Type" name="distribution_type_id" icon="terp-accessories-archiver" context="{'group_by':'distribution_type_id'}"/>
<filter string="Purchase" icon="terp-stock_effects-object-colorize" context="{'group_by':'purchase_order_id'}"/>
<filter string="Purchase Line" icon="terp-stock_effects-object-colorize" context="{'group_by':'purchase_order_line_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="landed_cost_position_graph">
<field name="name">landed.cost.position.graph</field>
<field name="model">landed.cost.position</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Landed Costs" type="bar">
<field name="account_id"/>
<field name="amount_total_comp_currency" operator="+"/>
</graph>
</field>
</record>
<record id="action_landed_cost_report_all" model="ir.actions.act_window">
<field name="name">Landed Costs Analysis</field>
<field name="res_model">landed.cost.position</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="view_id" ref="c2c_landed_cost_tree_stat"></field>
<field name="context">{'search_default_group_account_id':1,'search_default_group_product_id': 1,'group_by':[]}</field>
<field name="help">Landed cost Analysis allows you to easily check and analyse your estimated landed costs.</field>
</record>
<menuitem action="action_landed_cost_report_all" id="menu_action_landed_cost_report_all" parent="base.next_id_73" sequence="3"/>
</data>
</openerp>