forked from OCA/account-financial-tools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
account_asset_view.xml
385 lines (365 loc) · 19.2 KB
/
account_asset_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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<openerp>
<data>
<!-- Asset Category -->
<record model="ir.ui.view" id="view_account_asset_category_form">
<field name="name">account.asset.category.form</field>
<field name="model">account.asset.category</field>
<field name="arch" type="xml">
<form string="Asset category">
<group>
<group>
<field name="name"/>
<field name="parent_id" required="1"/>
<field name="active"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<group>
<field name="journal_id"/>
<field name="account_asset_id"/>
<field name="account_depreciation_id"/>
<field name="account_expense_depreciation_id"/>
<field name="account_plus_value_id"/>
<field name="account_min_value_id"/>
<field name="account_residual_value_id"/>
</group>
<group string="Depreciation Dates">
<field name="method_time" on_change="onchange_method_time(method_time)"/>
<field name="method_number" attrs="{'invisible':[('method_time','=','end')], 'required':[('method_time','in',['number','year'])]}"/>
<field name="method_period"/>
</group>
<group string="Depreciation Method">
<field name="method"/>
<field name="method_progress_factor" digits="(14, 4)" attrs="{'invisible':[('method','=','linear')], 'required':[('method','in',['degressive','degr-linear'])]}"/>
<field name="prorata" attrs="{'readonly':[('method_time','!=','year')]}"/>
<field name="open_asset"/>
</group>
<group groups="analytic.group_analytic_accounting" string="Analytic Information">
<field name="account_analytic_id"/>
</group>
</group>
<separator string="Notes"/>
<field name="note"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_account_asset_category_tree">
<field name="name">account.asset.category.tree</field>
<field name="model">account.asset.category</field>
<field name="arch" type="xml">
<tree string="Asset category">
<field name="name"/>
<field name="journal_id"/>
<field name="method"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_account_asset_category_search">
<field name="name">account.asset.category.search</field>
<field name="model">account.asset.category</field>
<field name="arch" type="xml">
<search string="Search Asset Category">
<field name="name" string="Asset Category"/>
<field name="journal_id"/>
</search>
</field>
</record>
<!-- Asset -->
<record model="ir.ui.view" id="view_account_asset_asset_form">
<field name="name">account.asset.asset.form</field>
<field name="model">account.asset.asset</field>
<field name="arch" type="xml">
<form string="Asset">
<header>
<button name="validate" states="draft" string="Confirm Asset" type="object" class="oe_highlight"/>
<button name="set_to_draft" states="open,close" string="Set to Draft" type="object" groups="account.group_account_manager"/>
<button name="remove" string="Remove" type="object" groups="account.group_account_manager"
attrs="{'invisible':['|', ('method_time', '!=', 'year'),('state', 'not in', ['open', 'close'])]}"
help="Asset removal."/>
<field name="state" widget="statusbar" statusbar_visible="draft,open,close,removed"/>
</header>
<sheet>
<div class="oe_button_box oe_right">
<button name="open_entries" string="Journal Entries" type="object" class="oe_inline"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" class="oe_inline"/>
</h1>
</div>
<group colspan="4" col="4">
<field name="code"/>
<field name="parent_id" attrs="{'required':[('type','=','normal')]}"/>
<field name="type" on_change="onchange_type(type)"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="company_currency_id" groups="base.group_multi_currency" invisible="1"/>
<field name="move_line_check" invisible="1"/>
<newline/>
<field name="asset_value" widget="monetary" options="{'currency_field': 'company_currency_id'}" attrs="{'invisible':[('type','=','view')]}"/>
<field name="value_depreciated" widget="monetary" options="{'currency_field': 'company_currency_id'}" attrs="{'invisible':[('type','=','view')]}"/>
<field name="value_residual" widget="monetary" options="{'currency_field': 'company_currency_id'}" attrs="{'invisible':[('type','=','view')]}"/>
</group>
<notebook colspan="4" attrs="{'invisible':[('type','=','view')]}">
<page string="General">
<group colspan="4" col="4">
<group>
<field name="purchase_value" widget="monetary" options="{'currency_field': 'currency_id'}"
attrs="{'readonly':['|',('move_line_check','=',True),('state','!=','draft')]}"
on_change="onchange_purchase_salvage_value(purchase_value, salvage_value, date_start)"/>
<field name="date_start"
attrs="{'readonly':[('state','!=','draft')],'required':[('type','=','normal')]}"
on_change="onchange_purchase_salvage_value(purchase_value, salvage_value, date_start)"/>
</group>
<group>
<field name="salvage_value" widget="monetary" options="{'currency_field': 'company_currency_id'}"
attrs="{'readonly':['|',('move_line_check','=',True),('state','!=','draft')]}"
on_change="onchange_purchase_salvage_value(purchase_value, salvage_value, date_start)"/>
<field name="date_remove"/>
</group>
</group>
<separator string="Other Information" colspan="4"/>
<group colspan="4" col="4">
<field name="category_id" on_change="onchange_category_id(category_id)" attrs="{'required':[('type','=','normal')]}"/>
<field name="partner_id"/>
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
</group>
<group colspan="4">
<group>
<separator string="Depreciation Dates" colspan="2"/>
<label for="method_time"/>
<div>
<field name="method_time" on_change="onchange_method_time(method_time)" class="oe_inline"/>
<button name="%(action_asset_modify)d" states="open" string="Change Duration" type="action" icon="terp-stock_effects-object-colorize" class="oe_inline" colspan="1"/>
</div>
<field name="method_number" attrs="{'invisible':[('method_time','=','end')], 'required':[('method_time','in',['number','year'])]}"/>
<field name="method_period"/>
<field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','in',['number','year'])]}"/>
</group>
<group>
<separator string="Depreciation Method" colspan="2"/>
<field name="method"/>
<field name="method_progress_factor" digits="(14, 4)" attrs="{'invisible':[('method','=','linear')], 'required':[('method','in',['degressive','degr-linear'])]}"/>
<field name="prorata" attrs="{'readonly':[('method_time','!=','year')]}"/>
</group>
</group>
</page>
<page string="Depreciation Board">
<header>
<button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','in',['close','removed'])]}"/>
</header>
<field name="depreciation_line_ids" mode="tree" options="{'reload_on_button': true}">
<tree string="Asset Lines" colors="blue:(move_check == False) and (init_entry == False)" create="false">
<field name="type"/>
<field name="line_date"/>
<field name="depreciated_value" readonly="1"/>
<field name="amount"/>
<field name="remaining_value" readonly="1"/>
<field name="init_entry" string="Init"/>
<field name="move_check"/>
<field name="parent_state" invisible="1"/>
<button name="create_move" icon="gtk-execute" string="Create Move" type="object"
attrs="{'invisible':['|','|',('init_entry','=',True),('move_check','!=',False),('parent_state','!=','open')]}"/>
<button name="open_move" icon="terp-gtk-jump-to-ltr" string="View Move" type="object"
attrs="{'invisible':[('move_check','!=',True)]}"/>
<button name="unlink_move" icon="gtk-cancel" string="Delete Move" type="object" confirm="Are you sure ?" groups="account.group_account_manager"
attrs="{'invisible':[('move_check','!=',True)]}"/>
</tree>
<form string="Asset Line">
<group>
<group>
<field name="parent_state" invisible="1"/>
<field name="asset_value" invisible="1"/>
<field name="type"/>
<field name="name"/>
<field name="amount" attrs="{'readonly':[('move_check','=',True)]}"
on_change="onchange_amount(type, asset_value, amount, depreciated_value)"/>
<field name="init_entry" attrs="{'readonly':['|', ('move_check', '=', True), ('type', '=', 'create')]}"/>
<field name="move_id"/>
<field name="move_check"/>
</group>
<group>
<field name="line_date" attrs="{'readonly':[('move_check','=',True)]}"/>
<field name="depreciated_value" readonly="1"/>
<field name="remaining_value" readonly="1"/>
</group>
</group>
</form>
</field>
</page>
<page string="History">
<field name="account_move_line_ids" readonly="1">
<tree colors="red:state == 'draft';black:state == 'valid'" string="Journal Items">
<field name="move_id"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="date"/>
<field name="ref"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
<field name="state" invisible="1"/>
</tree>
<form string="Journal Item">
<field name="journal_id" options='{"no_open":True}'/>
<field name="move_id" options='{"no_open":True}'/>
<newline/>
<field name="name"/>
<field name="ref"/>
<newline/>
<field name="date"/>
<field name="period_id" options='{"no_open":True}'/>
<newline/>
<field name="partner_id" options='{"no_open":True}'/>
<newline/>
<field name="account_id" options='{"no_open":True}'/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" options='{"no_open":True}'/>
<newline/>
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
</form>
</field>
<field name="history_ids" readonly="1"/>
</page>
<page string="Notes">
<field name="note" placeholder="Add an internal note here..."/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_account_asset_asset_tree">
<field name="name">account.asset.asset.tree</field>
<field name="model">account.asset.asset</field>
<field name="arch" type="xml">
<tree string="Assets" colors="blue:(type == 'view')">
<field name="name"/>
<field name="type" invisible="1"/>
<field name="code"/>
<field name="asset_value"/>
<field name="value_depreciated"/>
<field name="value_residual"/>
<field name="date_start"/>
<field name="date_remove"/>
<field name="category_id"/>
<field name="state"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_account_asset_asset_hierarchy_tree">
<field name="name">account.asset.asset.hierarchy</field>
<field name="model">account.asset.asset</field>
<field name="field_parent">child_ids</field>
<field name="arch" type="xml">
<tree string="Assets" colors="blue:(type == 'view')">
<field name="name"/>
<field name="type" invisible="1"/>
<field name="code"/>
<field name="asset_value"/>
<field name="value_depreciated"/>
<field name="value_residual"/>
<field name="date_start"/>
<field name="date_remove"/>
<field name="category_id"/>
<field name="state"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_account_asset_search" model="ir.ui.view">
<field name="name">account.asset.asset.search</field>
<field name="model">account.asset.asset</field>
<field name="arch" type="xml">
<search string="Account Asset">
<filter icon="terp-document-new" string="Draft" name="draft" domain="[('state','=','draft')]" help="Draft Assets"/>
<filter icon="terp-check" string="Running" domain="[('state','=', 'open')]" help="Assets in Running State"/>
<filter icon="terp-check" string="Close" domain="[('state','=', 'close')]" help="Assets in Close State"/>
<filter icon="terp-dialog-close" string="Removed" domain="[('state','=', 'removed')]" help="Assets which have been removed"/>
<separator orientation="vertical"/>
<field name="name" string="Asset"/>
<field name="code"/>
<field name="date_start"/>
<field name="category_id"/>
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
<group expand="0" string="Group By...">
<filter string="Type" icon="terp-stock_symbol-selection" domain="" context="{'group_by':'type'}"/>
<filter string="Category" icon="terp-stock_symbol-selection" domain="" context="{'group_by':'category_id'}"/>
</group>
</search>
</field>
</record>
<!--
Asset History
-->
<record model="ir.ui.view" id="view_account_asset_history_form">
<field name="name">account.asset.history.form</field>
<field name="model">account.asset.history</field>
<field name="arch" type="xml">
<form string="Asset History">
<group>
<group>
<field name="name"/>
<field name="date"/>
<field name="user_id"/>
</group>
<group>
<field name="method_time"/>
<field name="method_number" attrs="{'invisible':[('method_time','=','end')]}"/>
<field name="method_period"/>
<field name="method_end" attrs="{'invisible':[('method_time','in',['number','year'])]}"/>
</group>
</group>
<separator string="Notes"/>
<field name="note"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_account_asset_history_tree">
<field name="name">account.asset.history.tree</field>
<field name="model">account.asset.history</field>
<field name="arch" type="xml">
<tree string="Asset history">
<field name="date"/>
<field name="name"/>
<field name="user_id"/>
<field name="method_time"/>
<field name="method_number" invisible="1"/>
<field name="method_period" invisible="1"/>
<field name="method_end" invisible="1"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_account_asset_asset_tree">
<field name="name">Asset Hierarchy</field>
<field name="res_model">account.asset.asset</field>
<field name="view_type">tree</field>
<field name="domain">[('parent_id','=',False)]</field>
<field name="view_id" ref="view_account_asset_asset_hierarchy_tree"/>
</record>
<menuitem id="menu_finance_assets" name="Assets" parent="account.menu_finance" sequence="9"/>
<menuitem parent="menu_finance_assets" id="menu_action_account_asset_asset_tree"
sequence="100"
action="action_account_asset_asset_tree"/>
<record model="ir.actions.act_window" id="action_account_asset_asset_form">
<field name="name">Assets</field>
<field name="res_model">account.asset.asset</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_account_asset_asset_tree"/>
<field name="search_view_id" ref="view_account_asset_search"/>
</record>
<menuitem parent="menu_finance_assets" id="menu_action_account_asset_asset_form" action="action_account_asset_asset_form"/>
<act_window id="act_entries_open" name="Journal Items" res_model="account.move.line" src_model="account.asset.asset"
domain="['|',('asset_id','in',context.get('active_ids')),('asset_id','=','active_id')]"/>
<menuitem id="menu_finance_config_assets" name="Assets" parent="account.menu_finance_configuration" sequence="25"/>
<record model="ir.actions.act_window" id="action_account_asset_asset_list_normal">
<field name="name">Asset Categories</field>
<field name="res_model">account.asset.category</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem parent="menu_finance_config_assets" id="menu_action_account_asset_asset_list_normal" action="action_account_asset_asset_list_normal"/>
</data>
</openerp>