~unifield-team/unifield-wm/us-826

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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE TESTS [
    <!ENTITY general SYSTEM "mcdb_view_general.xml">
    <!ENTITY account SYSTEM "mcdb_view_account.xml">
    <!ENTITY currency SYSTEM "mcdb_view_currency.xml">
    <!ENTITY end SYSTEM "mcdb_view_end.xml">
]>

<openerp>
    <data>

        <!-- Account Multi-Criteria Data Browser Form -->
        <record model="ir.ui.view" id="account_mcdb_form">
            <field name="name">account.mcdb.form</field>
            <field name="model">account.mcdb</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Selector - G/L" hide_new_button="1" hide_duplicate_button="1" hide_delete_button="1">
                    &general;
                    <group col="4" colspan="4">
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="G/L journals" colspan="3"/>
                                <field name="display_journal" colspan="1" nolabel="1"/>
                            </group>
                            <group col="2" colspan="2" attrs="{'invisible': [('display_journal', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_journal_clear" type="object" string="Remove all Journals" icon="gtk-clear" colspan="1"/>
                                    <button name="button_journal_add" type="object" string="Add all Journals" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_journal_ids" colspan="2"/>
                                <field name="journal_ids" colspan="2" nolabel="1">
                                    <tree string="Journals" editable="top" noteditable="1">
                                        <field name="code"/>
                                        <field name="name" string="Name"/>
                                        <field name="type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Periods" colspan="3"/>
                                <field name="display_period" colspan="1" nolabel="1"/>
                            </group>
                            <group col="2" colspan="2" attrs="{'invisible': [('display_period', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_period_clear" type="object" string="Remove all Periods" icon="gtk-clear" colspan="1"/>
                                    <button name="button_period_add" type="object" string="Add all Periods" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_period_ids" colspan="2"/>
                                <field name="period_ids" colspan="2" nolabel="1">
                                    <tree string="Periods" editable="top" noteditable="1">
                                        <field name="name" string="Name"/>
                                        <field name="state"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                    </group>
                    <group colspan="2" col="2">
                        <html>
                            <br />
                        </html>
                    </group>
                    &account;
                    <separator string="Reconciliation" colspan="4"/>
                    <field name="reconciled"/>
                    <field name="reconcile_id"/>
                    &currency;
                    <group colspan="4" col="6">
                        <separator string="Third Party" colspan="6"/>
                        <field name="partner_id" colspan="2"/>
                        <field name="employee_id" colspan="2" context="{'disrupt_inactive': True}"/>
                        <field name="transfer_journal_id" colspan="2"/>
                    </group>
                    &end;
                </form>
            </field>
        </record>

        <!-- Analytic Multi-Criteria Data Browser Form -->
        <record model="ir.ui.view" id="account_mcdb_analytic_form">
            <field name="name">account.mcdb.analytic.form</field>
            <field name="model">account.mcdb</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Selector - Analytic" hide_new_button="1" hide_duplicate_button="1" hide_delete_button="1">
                    &general;
                    <group col="4" colspan="4">
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Analytic journals" colspan="3"/>
                                <field name="display_analytic_journal" colspan="1" nolabel="1"/>
                            </group>
                            <group colspan="2" col="2" attrs="{'invisible': [('display_analytic_journal', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_analytic_journal_clear" type="object" string="Remove all Analytic Journals" icon="gtk-clear" colspan="1"/>
                                    <button name="button_analytic_journal_add" type="object" string="Add all Analytic Journals" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_analytic_journal_ids" colspan="2"/>
                                <field name="analytic_journal_ids" colspan="2" nolabel="1">
                                    <tree string="Analytic Journals" editable="top" noteditable="1">
                                        <field name="code"/>
                                        <field name="name" string="Name"/>
                                        <field name="type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Periods" colspan="3"/>
                                <field name="display_period" colspan="1" nolabel="1"/>
                            </group>
                            <group col="2" colspan="2" attrs="{'invisible': [('display_period', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_period_clear" type="object" string="Remove all Periods" icon="gtk-clear" colspan="1"/>
                                    <button name="button_period_add" type="object" string="Add all Periods" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_period_ids" colspan="2"/>
                                <field name="period_ids" colspan="2" nolabel="1">
                                    <tree string="Periods" editable="top" noteditable="1">
                                        <field name="name" string="Name"/>
                                        <field name="state"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Accounts" colspan="3"/>
                                <field name="display_account" colspan="1" nolabel="1"/>
                            </group>
                            <group colspan="2" col="2" attrs="{'invisible': [('display_account', '=', False)]}">
                                <group colspan="2" col="2">
                                    <button name="button_account_clear" type="object" string="Remove all Accounts" icon="gtk-clear" colspan="1"/>
                                    <button name="button_account_add" type="object" string="Add all Accounts" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_account_ids"/>
                                <field name="account_ids" colspan="2" nolabel="1" domain="[('parent_id', '!=', False)]">
                                    <tree string="Accounts" colors="blue:type in ('view');black:type not in ('view')" editable="top" noteditable="1">
                                        <field name="code"/>
                                        <field name="name"/>
                                        <field name="type" string="Type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                    </group>
                    <group colspan="2" col="2">
                        <html>
                            <br />
                        </html>
                    </group>
                    <group col="4" colspan="4" attrs="{'invisible': [('analytic_axis', '!=', 'fp')]}">
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Cost Centers" colspan="3"/>
                                <field name="display_cost_center" colspan="1" nolabel="1"/>
                            </group>
                            <label string="" colspan="2"/>
                            <group colspan="2" col="2" attrs="{'invisible': [('display_cost_center', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_cost_center_clear" type="object" string="Remove all Cost Centers" icon="gtk-clear" colspan="1"/>
                                    <button name="button_cost_center_add" type="object" string="Add all Cost Centers" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_analytic_account_cc_ids"/>
                                <field name="analytic_account_cc_ids" colspan="2" nolabel="1" domain="[('type', '!=', 'view'), ('category', '=', 'OC')]">
                                    <tree string="Cost Center" editable="top" noteditable="1">
                                        <field name="code" string="Ana. Code"/>
                                        <field name="name" string="Ana. Name"/>
                                        <field name="type" string="Ana. Type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Destinations" colspan="3"/>
                                <field name="display_destination" colspan="1" nolabel="1"/>
                            </group>
                            <group colspan="2" col="2" attrs="{'invisible': [('display_destination', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_destination_clear" type="object" string="Remove all Destinations" icon="gtk-clear" colspan="1"/>
                                    <button name="button_destination_add" type="object" string="Add all Destinations" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_analytic_account_dest_ids"/>
                                <field name="analytic_account_dest_ids" colspan="2" nolabel="1" domain="[('type', '!=', 'view'), ('category', '=', 'DEST')]">
                                    <tree string="Destination" editable="top" noteditable="1">
                                        <field name="code" string="Ana. Code"/>
                                        <field name="name" string="Ana. Name"/>
                                        <field name="type" string="Ana. Type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                    </group>
                    <group col="2" colspan="2">
                        <html>
                            <br />
                        </html>
                    </group>
                    <group col="4" colspan="4" attrs="{'invisible': [('analytic_axis', '!=', 'fp')]}">
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Funding pools" colspan="3"/>
                                <field name="display_funding_pool" colspan="1" nolabel="1"/>
                            </group>
                            <group colspan="2" col="2" attrs="{'invisible': [('display_funding_pool', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_funding_pool_clear" type="object" string="Remove all Funding Pools" icon="gtk-clear" colspan="1"/>
                                    <button name="button_funding_pool_add" type="object" string="Add all Funding Pools" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_analytic_account_fp_ids"/>
                                <field name="analytic_account_fp_ids" colspan="2" nolabel="1" domain="[('type', '!=', 'view'), ('category', '=', 'FUNDING')]">
                                    <tree string="Funding Pool" editable="top" noteditable="1">
                                        <field name="code" string="Ana. Code"/>
                                        <field name="name" string="Ana. Name"/>
                                        <field name="type" string="Ana. Type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                        <group col="2" colspan="2">
                            <label string="" colspan="2"/>
                        </group>
                    </group>
                    <group col="4" colspan="4" attrs="{'invisible': [('analytic_axis', '!=', 'f1')]}">
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Free 1" colspan="3"/>
                                <field name="display_free1" colspan="1" nolabel="1"/>
                            </group>
                            <group colspan="2" col="2" attrs="{'invisible': [('display_free1', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_free_1_clear" type="object" string="Remove all Free 1" icon="gtk-clear" colspan="1"/>
                                    <button name="button_free_1_add" type="object" string="Add all Free 1" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_analytic_account_f1_ids"/>
                                <field name="analytic_account_f1_ids" colspan="2" nolabel="1" domain="[('type', '!=', 'view'), ('category', '=', 'FREE1')]">
                                    <tree string="Free 1" editable="top" noteditable="1">
                                        <field name="code" string="Ana. Code"/>
                                        <field name="name" string="Ana. Name"/>
                                        <field name="type" string="Ana. Type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                        <group col="2" colspan="2">
                            <label string="" colspan="2"/>
                        </group>
                    </group>
                    <group col="4" colspan="4" attrs="{'invisible': [('analytic_axis', '!=', 'f2')]}">
                        <group col="2" colspan="2">
                            <group col="4" colspan="2">
                                <separator string="Free 2" colspan="3"/>
                                <field name="display_free2" colspan="1" nolabel="1"/>
                            </group>
                            <group colspan="2" col="2" attrs="{'invisible': [('display_free2', '=', False)]}">
                                <group col="2" colspan="2">
                                    <button name="button_free_2_clear" type="object" string="Remove all Free 2" icon="gtk-clear" colspan="1"/>
                                    <button name="button_free_2_add" type="object" string="Add all Free 2" icon="gtk-add" colspan="1"/>
                                </group>
                                <field name="rev_analytic_account_f2_ids"/>
                                <field name="analytic_account_f2_ids" colspan="2" nolabel="1" domain="[('type', '!=', 'view'), ('category', '=', 'FREE2')]">
                                    <tree string="Free 2" editable="top" noteditable="1">
                                        <field name="code" string="Ana. Code"/>
                                        <field name="name" string="Ana. Name"/>
                                        <field name="type" string="Ana. Type"/>
                                    </tree>
                                </field>
                            </group>
                        </group>
                        <group col="2" colspan="2">
                            <label string="" colspan="2"/>
                        </group>
                    </group>
                    <group col="2" colspan="2">
                        <html>
                            <br />
                        </html>
                    </group>
                    <separator string="Reallocation" colspan="4"/>
                    <field name="reallocated" colspan="2"/>
                    <field name="reversed" colspan="2"/>
                    &currency;
                    <group colspan="4" col="6">
                        <separator string="Third Party" colspan="6"/>
                        <field name="partner_txt" colspan="2"/>
                     </group>
                    &end;
                </form>
            </field>
        </record>

    <!-- Tree view -->
        <record id="account_mcdb_tree" model="ir.ui.view">
            <field name="name">account.mcdb.tree</field>
            <field name="model">account.mcdb</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Selector list">
                    <field name="description"/>
                    <field name="user"/>
                </tree>
            </field>
        </record>

    <!-- Search view with different name -->
        <record id="account_mcdb_search" model="ir.ui.view">
            <field name="name">account.mcdb.search</field>
            <field name="model">account.mcdb</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Selector - G/L">
                    <field name="description" select="1"/>
                    <field name="user" select="1"/>
                </search>
            </field>
        </record>

        <record id="account_mcdb_analytic_search" model="ir.ui.view">
            <field name="name">account.mcdb.analytic.search</field>
            <field name="model">account.mcdb</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Selector - Analytic">
                    <field name="description" select="1"/>
                    <field name="user" select="1"/>
                </search>
            </field>
        </record>

    <!-- Actions to display search view (analytic OR G/L) -->
        <record id="action_account_mcdb" model="ir.actions.act_window">
            <field name="name">G/L Selector - Saved queries</field>
            <field name="res_model">account.mcdb</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="account_mcdb_tree"/>
            <field name="search_view_id" ref="account_mcdb_search"/>
            <field name="domain">[('description', '!=', False), ('model', '=', 'account.move.line')]</field>
            <field name="context">{'search_default_user': uid}</field>
        </record>

        <record id="action_account_mcdb_analytic" model="ir.actions.act_window">
            <field name="name">Analytic Selector - Saved queries</field>
            <field name="res_model">account.mcdb</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="account_mcdb_tree"/>
            <field name="search_view_id" ref="account_mcdb_analytic_search"/>
            <field name="context">{'from': 'account.analytic.line', 'search_default_user': uid}</field>
            <field name="domain">[('description', '!=', False), ('model', '=', 'account.analytic.line')]</field>
        </record>

    <!-- Actions to display form view (analytic OR G/L) -->
        <record id="action_account_mcdb_form" model="ir.actions.act_window">
            <field name="name">G/L Selector</field>
            <field name="res_model">account.mcdb</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
            <field name="view_id" ref="account_mcdb_form"/>
            <field name="search_view_id" ref="account_mcdb_search"/>
            <field name="domain">[('description', '!=', False), ('model', '=', 'account.move.line')]</field>
            <field name="context">{'search_default_user': uid}</field>
        </record>

        <record id="action_account_mcdb_analytic_form" model="ir.actions.act_window">
            <field name="name">Analytic Selector</field>
            <field name="res_model">account.mcdb</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
            <field name="view_id" ref="account_mcdb_analytic_form"/>
            <field name="search_view_id" ref="account_mcdb_analytic_search"/>
            <field name="context">{'from': 'account.analytic.line', 'search_default_user': uid}</field>
            <field name="domain">[('description', '!=', False), ('model', '=', 'account.analytic.line')]</field>
        </record>

    <!-- Actions that link each specific search view to a specific form view -->
        <record model="ir.actions.act_window.view" id="action_account_mcdb_form2">
            <field name="sequence" eval="20"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="account_mcdb_form"/>
            <field name="act_window_id" ref="action_account_mcdb"/>
        </record>
        <record model="ir.actions.act_window.view" id="action_account_mcdb_tree">
            <field name="sequence" eval="10"/>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="account_mcdb_tree"/>
            <field name="act_window_id" ref="action_account_mcdb"/>
        </record>

        <record model="ir.actions.act_window.view" id="action_account_mcdb_analytic_form2">
            <field name="sequence" eval="20"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="account_mcdb_analytic_form"/>
            <field name="act_window_id" ref="action_account_mcdb_analytic"/>
        </record>
        <record model="ir.actions.act_window.view" id="action_account_mcdb_analytic_tree">
            <field name="sequence" eval="10"/>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="account_mcdb_tree"/>
            <field name="act_window_id" ref="action_account_mcdb_analytic"/>
        </record>

    <!-- Menu -->
        <menuitem id="menu_finance_mcdb" name="Selector" parent="account.menu_finance" sequence="9"/>
        <menuitem string="G/L Selector" action="action_account_mcdb_form" id="menu_finance_mcdb_move_line" parent="menu_finance_mcdb" sequence="1"/>
        <menuitem string="G/L Selector - Saved queries" action="action_account_mcdb" id="menu_finance_mcdb_move_line_search" parent="menu_finance_mcdb" sequence="2"/>
        <menuitem string="Analytic Selector" action="action_account_mcdb_analytic_form" id="menu_finance_mcdb_analytic_move_line" parent="menu_finance_mcdb" sequence="3"/>
        <menuitem string="Analytic Selector - Saved queries" action="action_account_mcdb_analytic" id="menu_finance_mcdb_analytic_move_line_search" parent="menu_finance_mcdb" sequence="4"/>

    <!-- Redefine MCDB to add instance -->
        <record id="account_mcdb_form_instance_inherit" model="ir.ui.view">
            <field name="name">account.mcdb.form.instance.inherit</field>
            <field name="model">account.mcdb</field>
            <field name="type">form</field>
            <field name="priority" eval="18"/>
            <field name='inherit_id' ref='account_mcdb.account_mcdb_form' />
            <field name="arch" type="xml">
                <xpath expr="/form//field[@name='journal_ids']/tree/field[@name='code']" position="before">
                    <field name="instance_id"/>
                </xpath>
            </field>
        </record>

        <record id="account_mcdb_analytic_form_instance_inherit" model="ir.ui.view">
            <field name="name">account.mcdb.analytic.form.instance.inherit</field>
            <field name="model">account.mcdb</field>
            <field name="type">form</field>
            <field name="priority" eval="18"/>
            <field name='inherit_id' ref='account_mcdb.account_mcdb_analytic_form' />
            <field name="arch" type="xml">
                <xpath expr="/form//field[@name='analytic_journal_ids']/tree/field[@name='code']" position="before">
                    <field name="instance_id"/>
                </xpath>
            </field>
        </record>

    </data>
</openerp>