~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
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

    <!-- Analytic distribution wizard -->
        <record model="ir.ui.view" id="analytic_distribution_wizard_lines_tree">
            <field name="name">analytic.distribution.wizard.lines.tree"</field>
            <field name="model">analytic.distribution.wizard.lines</field>
            <field name="type">tree</field>
            <field name="arch" type='xml'>
                <tree string="" editable="top">
                    <field name="destination_id" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/>
                    <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'OC'), ('state', '=', 'open')]" string="Cost Center" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/>
                    <field name="percentage" sum="Total Percentage" digits="(16,2)"/>
                    <field name="amount" sum="Total Amount"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="analytic_distribution_wizard_lines_fp_tree">
            <field name="name">analytic.distribution.wizard.lines.fp.tree"</field>
            <field name="model">analytic.distribution.wizard.fp.lines</field>
            <field name="type">tree</field>
            <field name="arch" type='xml'>
                <tree string="" editable="top">
                    <field name="destination_id" on_change="onchange_destination(destination_id, analytic_id, parent.account_id)" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/>
                    <field name="cost_center_id" on_change="onchange_cost_center(cost_center_id, analytic_id)" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/>
                    <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'FUNDING'), ('state', '=', 'open'), ('cost_center_ids', '=', cost_center_id)]" string="Funding Pool" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('document_date')}"/>
                    <field name="percentage" sum="Total Percentage" digits="(16,2)"/>
                    <field name="amount" sum="Total Amount"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="analytic_distribution_wizard_lines_f1_tree">
            <field name="name">analytic.distribution.wizard.lines.f1.tree"</field>
            <field name="model">analytic.distribution.wizard.f1.lines</field>
            <field name="type">tree</field>
            <field name="arch" type='xml'>
                <tree string="" editable="top">
                    <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'FREE1'), ('state', '=', 'open')]" context="{'search_default_active': 1, 'hide_inactive': 1}"/>
                    <field name="percentage" sum="Total Percentage" digits="(16,2)"/>
                    <field name="amount" sum="Total Amount"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="analytic_distribution_wizard_lines_f2_tree">
            <field name="name">analytic.distribution.wizard.lines.f2.tree"</field>
            <field name="model">analytic.distribution.wizard.f2.lines</field>
            <field name="type">tree</field>
            <field name="arch" type='xml'>
                <tree string="" editable="top">
                    <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'FREE2'), ('state', '=', 'open')]" context="{'search_default_active': 1, 'hide_inactive': 1}"/>
                    <field name="percentage" sum="Total Percentage" digits="(16,2)"/>
                    <field name="amount" sum="Total Amount"/>
                </tree>
            </field>
        </record>

        <record id="analytic_distribution_wizard_view" model="ir.ui.view">
            <field name="name">analytic.distribution.wizard.view</field>
            <field name="model">analytic.distribution.wizard</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Analytic Wizard Distribution">
                    <field colspan="2" name="amount" readonly="1"/>
                    <field name="move_id" invisible="1"/>
                    <field name="invoice_id" invisible="1"/>
                    <field name="direct_invoice_id" invisible="1"/>
                    <field name="commitment_id" invisible="1"/>
                    <field name="purchase_id" invisible="1"/>
                    <field name="purchase_line_id" invisible="1"/>
                    <field name="model_id" invisible="1"/>
                    <field name="sale_order_id" invisible="1"/>
                    <field name="sale_order_line_id" invisible="1"/>
                    <field name="posting_date" invisible="1"/>
                    <field name="document_date" invisible="1"/>
                    <field name="partner_type" invisible="1"/>
                    <field name="register_line_id" invisible="1"/>
                    <field name="register_line_state" invisible="1"/>
                    <field name="commitment_line_id" invisible="1"/>
                    <field name="account_id" attrs="{'invisible': ['|', ('register_line_id', '=', False), ('register_line_state', 'in', ['draft', 'hard'])], 'required': [('register_line_state', '=', 'temp')]}" readonly="0" domain="[('type', '!=', 'view'), ('is_analytic_addicted', '=', True)]"/>
                    <field name="cash_return_id" invisible="1"/>
                    <group colspan="2" col="3">
                        <field colspan="2" name="entry_mode" readonly="1"/>
                        <button name="dummy" type="object" string="Switch entry mode" icon='gtk-jump-to' colspan="1" attrs="{'invisible': [('is_writable', '=', False)]}"/>
                    </group>
                    <group colspan="4">
                        <field name="have_header" invisible="1"/>
                        <button name="button_get_header_distribution" type="object" string="Populate line analytic distribution from header*" icon='gtk-convert' colspan="1" attrs="{'invisible': ['|', ('have_header', '=', False), ('is_writable', '=', False)]}" />
                        <group colspan="3" col="3" attrs="{'invisible': ['|', ('have_header', '=', False), ('is_writable', '=', False)]}">
                            <label string="*: this action will copy the analytic distribution from the header to the line allowing then the user to make changes starting from the copied distribution." colspan="3" />
                        </group>
                    </group>
                    <group colspan="4" col="2" attrs="{'invisible': [('state', '!=', 'cc')]}">
                        <separator string="Cost Center"/>
                        <field colspan="4" name="line_ids" nolabel="1" widget="one2many_list" context="{'mode': entry_mode, 'from_purchase': purchase_id, 'from_sale_order': sale_order_id, 'parent_id':active_id}" attrs="{'readonly': [('is_writable', '=', False)]}"/>
                    </group>
                    <group colspan="4" col="2" attrs="{'invisible': [('state', 'in', ['draft', 'cc'])]}">
                        <separator colspan="4" string="Cost Center and Funding Pool allocation"/>
                        <field colspan="4" name="fp_line_ids" nolabel="1" widget="one2many_list" context="{'mode': entry_mode, 'from_invoice': invoice_id, 'from_commitment': commitment_id, 'from_model': model_id, 'direct_invoice_id': direct_invoice_id, 'from_move': move_id, 'parent_id':active_id, 'posting_date': posting_date, 'document_date': document_date, 'from_cash_return': cash_return_id}" attrs="{'readonly': [('is_writable', '=', False)]}"/>
                    </group>
                    <group colspan="6" attrs="{'invisible': ['|', '|', ('state', 'in', ['draft', 'cc']), ('commitment_id', '!=', False), ('commitment_line_id', '!=', False)]}">
                        <group colspan="2">
                            <separator string="Free 1"/>
                            <field colspan="4" name="f1_line_ids" nolabel="1" widget="one2many_list" context="{'mode': entry_mode, 'parent_id':active_id}" attrs="{'readonly': [('is_writable', '=', False)]}"/>
                        </group>
                        <group colspan="2">
                            <separator string="Free 2"/>
                            <field colspan="4" name="f2_line_ids" nolabel="1" widget="one2many_list" context="{'mode': entry_mode, 'parent_id':active_id}" attrs="{'readonly': [('is_writable', '=', False)]}"/>
                        </group>
                    </group>
                    <group colspan="4" attrs="{'invisible': [('state', '=', 'correction')]}">
                        <label string="" colspan="2"/>
                        <button name="button_cancel" string='Cancel' type='object' icon='gtk-cancel' colspan="1"/>
                        <button name="button_confirm" string="Save" type="object" icon="gtk-ok" colspan="1" attrs="{'readonly': [('is_writable', '=', False)]}"/>
                    </group>
                    <field name="state" invisible="1"/>
                    <field name="is_writable" invisible="1"/>
                    <field name="total_amount" invisible="1" readonly="1" />
                </form>
            </field>
        </record>

    <!-- Actions -->
        <act_window id="action_mass_reallocation"
            name="Mass reallocation"
            res_model="mass.reallocation.wizard"
            src_model="account.analytic.line"
            key2="client_action_multi"
            view_mode="form"
            view_type="form"
            context="{'analytic_account_from': context.get('analytic_account_from', False) }"
            target="new"/>

    <!-- Mass reallocation wizard -->
        <record id="mass_reallocation_wizard_view" model="ir.ui.view">
            <field name="name">Mass Reallocation Wizard</field>
            <field name="model">mass.reallocation.wizard</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form>
                    <field name="account_id" colspan="2" attrs="{'readonly': [('state', '=', 'blocked')]}"/>
                    <label string="" colspan="2"/>
                    <newline/>
                    <field name="date" colspan="2" /><label string="" colspan="2"/>
                    <newline/>
                    <field name="display_fp" invisible="1"/>
                    <separator string="Items to check"/>
                    <newline/>
                    <field name="line_ids" nolabel="1" colspan="4" context="{'display_fp': display_fp}"/>
                    <newline/>
                    <separator string="Items not considered in reallocation"/>
                    <newline/>
                    <label string="Criteria used to exclude specific types of items from the reallocation perimeter." align="0.0" colspan="2"/>
                    <newline/>
                    <label string="- Commitments" align="0.0"/>
                    <newline/>
                    <label string="- Items already reallocated" align="0.0"/>
                    <newline/>
                    <label string="- Reversals" align="0.0"/>
                    <newline/>
                    <label string="- Items from engagement journal" align="0.0"/>
                    <newline/>
                    <label string="- Write-off" align="0.0"/>
                    <newline/>
                    <label string="- Unposted items" align="0.0"/>
                    <newline/>
                    <label string="- Free 1 / Free 2 items" align="0.0"/>
                    <newline/>
                    <html>
                        <br />
                    </html>
                    <field name="other_ids" nolabel="1" colspan="4" context="{'display_fp': display_fp}">
                        <tree string="Analytic journal items">
                            <field name="instance_id"/>
                            <field name="journal_id"/>
                            <field name="entry_sequence"/>
                            <field name="name"/>
                            <field name="ref"/>
                            <field name="from_commitment_line"/>
                            <field name="is_reallocated"/>
                            <field name="is_reversal"/>
                            <field name="from_write_off"/>
                            <field name="is_unposted"/>
                            <field name="free_account"/>
                        </tree>
                    </field>
                    <separator string=""/>
                    <group col="6" colspan="4">
                        <label string="" colspan="2"/>
                        <button special="cancel" string="Cancel" colspan="1" icon="gtk-cancel"/>
                        <button name="button_validate" type="object" string="Verify" icon="terp-camera_test" colspan="1"/>
                    </group>
                    <field name="state" invisible="1"/>
                </form>
            </field>
        </record>

    <!-- Mass reallocation verification wizard -->
        <record id="mass_reallocation_verification_wizard_view" model="ir.ui.view">
            <field name="name">Mass Reallocation Verification Wizard</field>
            <field name="model">mass.reallocation.verification.wizard</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form>
                    <group col="6" colspan="4">
                        <field name="nb_process" colspan="2"/>
                        <field name="nb_error" colspan="2"/>
                        <field name="nb_other" colspan="2"/>
                    </group>
                    <field name="display_fp" invisible="1"/>
                    <field name="account_id" colspan="2"/>
                    <newline/>
                    <field name="date"/>
                    <newline/>
                    <separator string="Allocatable items"/>
                    <newline/>
                    <field name="process_ids" colspan="4" nolabel="1" context="{'display_fp': display_fp}"/>
                    <newline/>
                    <separator string="Items excluded from reallocation"/>
                    <newline/>
                    <field name="error_ids" colspan="4" nolabel="1" context="{'display_fp': display_fp}"/>
                    <newline />
                    <separator string="Excluded lines"/>
                    <newline/>
                    <field name="other_ids" colspan="4" nolabel="1" context="{'display_fp': display_fp}"/>
                    <newline/>
                    <group col="6" colspan="4"/>
                        <label string="" colspan="2"/>
                        <button special="cancel" string="Cancel" colspan="1" icon="gtk-cancel"/>
                        <button name="button_validate" type="object" string="Process" icon="gtk-ok" colspan="1"/>
                </form>
            </field>
        </record>

    </data>
</openerp>