forked from OCA/account-closing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount_cutoff_view.xml
240 lines (224 loc) · 10.7 KB
/
account_cutoff_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
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <[email protected]>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<menuitem id="cutoff_menu"
parent="account.menu_finance_periodical_processing"
name="Cut-offs"
sequence="24"
groups="account.group_account_user,account.group_account_manager,account.group_account_invoice"/>
<!-- Form view -->
<record id="account_cutoff_form" model="ir.ui.view">
<field name="name">account.cutoff.form</field>
<field name="model">account.cutoff</field>
<field name="arch" type="xml">
<form string="Cut-offs" version="7.0">
<header>
<button name="back2draft" string="Back to Draft" type="object" states="done" />
<!-- here, we have the 'get_lines' button that is supplied by the other cutoff modules -->
<button class="oe_highlight" name="create_move" string="Create Journal Entry" type="object" states="draft" attrs="{'invisible': ['|', ('line_ids', '=', False), ('state', '=', 'done')]}"/>
<field name="state" widget="statusbar" />
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="type" readonly="1" />
</h1>
</div>
<group name="top">
<group name="general-params">
<field name="cutoff_date" on_change="cutoff_date_onchange(type, cutoff_date, move_label, context)"/>
<field name="total_cutoff_amount" widget="monetary" options="{'currency_field': 'company_currency_id'}"/>
<field name="company_id" groups="base.group_multi_company" widget="selection" />
<field name="company_currency_id" invisible="1"/>
</group>
<group name="accounting-params">
<field name="cutoff_journal_id"/>
<field name="cutoff_account_id"/>
<field name="move_label"/>
<field name="move_id"/>
</group>
</group>
<group name="lines">
<field name="line_ids" nolabel="1" context="{'type': type}"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<!-- Tree view -->
<record id="account_cutoff_tree" model="ir.ui.view">
<field name="name">account.cutoff.tree</field>
<field name="model">account.cutoff</field>
<field name="arch" type="xml">
<tree string="Cut-offs" colors="blue:state=='draft'">
<field name="type" invisible="context.get('type')" />
<field name="cutoff_date" />
<field name="total_cutoff_amount"/>
<field name="company_currency_id"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Search view -->
<record id="account_cutoff_filter" model="ir.ui.view">
<field name="name">account.cutoff.filter</field>
<field name="model">account.cutoff</field>
<field name="arch" type="xml">
<search string="Search Cut-offs">
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]" />
<filter name="done" string="Done" domain="[('state', '=', 'done')]" />
</search>
</field>
</record>
<!-- Form view for lines -->
<record id="account_cutoff_line_form" model="ir.ui.view">
<field name="name">account.cutoff.line.form</field>
<field name="model">account.cutoff.line</field>
<field name="arch" type="xml">
<form string="Cut-off Lines" version="7.0">
<group name="source" string="Source">
<field name="parent_id" invisible="not context.get('account_cutoff_line_main_view', False)"/>
<field name="partner_id"/>
<field name="name"/>
<field name="account_id"/>
<field name="cutoff_account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="tax_ids" widget="many2many_tags" invisible="'accrued' not in context.get('type', '-')"/>
<field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible="1"/>
</group>
<group name="cutoff" string="Cut-off Computation">
<field name="cutoff_amount" widget="monetary" options="{'currency_field': 'company_currency_id'}"/>
<field name="company_currency_id" invisible="1"/>
</group>
<group name="tax" string="Cut-off Taxes Lines" invisible="'accrued' not in context.get('type', '-')">
<field name="tax_line_ids" nolabel="1"/>
</group>
</form>
</field>
</record>
<!-- Tree view for lines -->
<record id="account_cutoff_line_tree" model="ir.ui.view">
<field name="name">account.cutoff.line.tree</field>
<field name="model">account.cutoff.line</field>
<field name="arch" type="xml">
<tree string="Cut-off Lines">
<field name="parent_id" invisible="not context.get('account_cutoff_line_main_view', False)"/>
<field name="partner_id"/>
<field name="name"/>
<field name="cutoff_account_code"/>
<field name="analytic_account_code" groups="analytic.group_analytic_accounting"/>
<field name="tax_ids" widget="many2many_tags" invisible="'accrued' not in context.get('type', '-')"/>
<field name="amount"/>
<field name="currency_id" groups="base.group_multi_currency"/>
<field name="cutoff_amount"/>
<field name="company_currency_id" groups="base.group_multi_currency"/>
</tree>
</field>
</record>
<!-- Form view for tax lines -->
<record id="account_cutoff_tax_line_form" model="ir.ui.view">
<field name="name">account.cutoff.tax.line.form</field>
<field name="model">account.cutoff.tax.line</field>
<field name="arch" type="xml">
<form string="Cut-off Tax Lines" version="7.0">
<group name="tax" string="Tax">
<field name="parent_id" invisible="not context.get('account_cutoff_tax_line_main_view', False)"/>
<field name="tax_id"/>
<field name="sequence"/>
<field name="cutoff_account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="base" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible="True"/>
</group>
<group name="cutoff" string="Cut-off Computation">
<field name="cutoff_amount" widget="monetary" options="{'currency_field': 'company_currency_id'}"/>
<field name="company_currency_id" invisible="True"/>
</group>
</form>
</field>
</record>
<!-- Tree view for tax lines -->
<record id="account_cutoff_tax_line_tree" model="ir.ui.view">
<field name="name">account.cutoff.tax.line.tree</field>
<field name="model">account.cutoff.tax.line</field>
<field name="arch" type="xml">
<tree string="Cut-off Tax Lines">
<field name="parent_id" invisible="not context.get('account_cutoff_tax_line_main_view', False)"/>
<field name="tax_id"/>
<field name="cutoff_account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="base"/>
<field name="amount"/>
<field name="currency_id" groups="base.group_multi_currency"/>
<field name="cutoff_amount"/>
<field name="company_currency_id" groups="base.group_multi_currency"/>
<field name="sequence" invisible="True"/>
</tree>
</field>
</record>
<!-- Notification in the chatter -->
<record id="cutoff_done" model="mail.message.subtype">
<field name="name">Cut-off Journal Entry Created</field>
<field name="res_model">account.cutoff</field>
<field name="default" eval="False"/>
<field name="description">Cut-off Journal Entry Created</field>
</record>
<!-- Form view for account mappings -->
<record id="account_cutoff_mapping_form" model="ir.ui.view">
<field name="name">account.cutoff.mapping.form</field>
<field name="model">account.cutoff.mapping</field>
<field name="arch" type="xml">
<form string="Account Cut-off Mapping" version="7.0">
<field name="company_id" groups="base.group_multi_company" widget="selection" invisible="not context.get('account_cutoff_mapping_main_view', False)" />
<field name="account_id"/>
<field name="cutoff_account_id"/>
<field name="cutoff_type"/>
</form>
</field>
</record>
<!-- Tree view for account mappings -->
<record id="account_cutoff_mapping_tree" model="ir.ui.view">
<field name="name">account.cutoff.mapping.tree</field>
<field name="model">account.cutoff.mapping</field>
<field name="arch" type="xml">
<tree string="Account Cut-off Mapping" editable="bottom">
<field name="company_id" groups="base.group_multi_company" widget="selection" invisible="not context.get('account_cutoff_mapping_main_view', False)" />
<field name="account_id"/>
<field name="cutoff_account_id"/>
<field name="cutoff_type"/>
</tree>
</field>
</record>
<!-- Action for account mappings -->
<record id="account_cutoff_mapping_action" model="ir.actions.act_window">
<field name="name">Cut-off Account Mapping</field>
<field name="res_model">account.cutoff.mapping</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'account_cutoff_mapping_main_view': True}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new cutoff account mapping.
</p><p>
These account mappings allow you to have an cutoff account for expense/revenue that is not the same as the original expense/revenue account, using the same concept as the fiscal positions.
</p>
</field>
</record>
<!-- Menu entry for account mapping -->
<menuitem id="account_cutoff_mapping_menu"
parent="account.account_account_menu"
action="account_cutoff_mapping_action"
sequence="100"/>
</data>
</openerp>