~unifield-team/unifield-wm/wm-2418-rw-fix

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
<?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"/>
                    <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'OC'), ('state', '=', 'open')]" string="Cost Center"/>
                    <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)"/>
                    <field name="cost_center_id"/>
                    <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'FUNDING'), ('state', '=', 'open'), ('cost_center_ids', '=', cost_center_id)]" string="Funding Pool"/>
                    <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')]"/>
                    <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')]"/>
                    <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="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="sale_order_id" invisible="1"/>
                    <field name="sale_order_line_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, 'parent_id':active_id}" attrs="{'readonly': [('is_writable', '=', False)]}"/>
                    </group>
                    <group colspan="6" attrs="{'invisible': [('state', 'in', ['draft', 'cc'])]}">
                        <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">
                        <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="account_id" invisible="1"/>
                    <field name="total_amount" readonly="1" invisible="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')]}"/>
                    <newline/>
                    <field name="display_fp" invisible="1"/>
                    <field name="line_ids" nolabel="1" colspan="4" context="{'display_fp': display_fp}"/>
                    <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="error_ids" colspan="4" nolabel="1" context="{'display_fp': display_fp}"/>
                    <newline />
                    <field name="process_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>