~openerp-commiter/openobject-addons/extra-6.0

« back to all changes in this revision

Viewing changes to account_chart_update/account_view.xml

  • Committer: Borja L.S.
  • Date: 2010-06-15 10:47:32 UTC
  • Revision ID: borjals@pexego.es-20100615104732-gw4vm8mp0d91uiy7
[ADD] account_chart_update: Module to update accounts and taxes using a Chart Template.

Port of the module from 5.0 extra-addons revno 4344.

Adds a wizard to update a company account chart from a chart template.

This is a pretty useful tool to update OpenERP instalations after tax reforms
on the oficial charts of accounts, or to apply fixes performed on the chart
template.

The wizard:

- Allows the user to compare a chart and a template showing differences
    on accounts, taxes, tax codes and fiscal positions.
- It may create the new account, taxes, tax codes and fiscal positions detected
    on the template.
- It can also update (overwrite) the accounts, taxes, tax codes and fiscal
    positions that got modified on the template.

The wizard lets the user select what kind of objects must be checked/updated,
and whether old records must be checked for changes and updated.
It will display all the accounts to be created / updated with some information
about the detected differences, and allow the user to exclude records
individually.
Any problem found while updating will be shown on the last step.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<openerp>
 
3
    <data>
 
4
 
 
5
        <!--  Wizard for Multi Charts of Accounts -->
 
6
 
 
7
        <record id="view_update_multi_chart" model="ir.ui.view">
 
8
            <field name="name">Update Chart of Accounts from a Chart Template</field>
 
9
            <field name="model">wizard.update.charts.accounts</field>
 
10
            <field name="type">form</field>
 
11
            <field name="arch" type="xml">
 
12
                <form string="Update Chart of Accounts from a Chart Template">
 
13
                    <group col="4" colspan="4" attrs="{'invisible':[('state','!=','init')]}">
 
14
                        <label string="This wizard will update your accounts, taxes and fiscal positions according to the selected chart template." colspan="4"/>
 
15
                        <label string="" colspan="4"/>
 
16
                        <group colspan="4">
 
17
                            <separator col="4" colspan="4" string="Chart of Accounts"/>
 
18
                            <field name="company_id" on_change="onchange_company_id(company_id)"/>
 
19
                            <field name="code_digits"/>
 
20
                            <field name="chart_template_id"/>
 
21
                            <field name="lang"/>
 
22
                        </group>
 
23
                        <label string=""/>
 
24
                        <group colspan="4">
 
25
                            <separator string="Update records?" colspan="4"/>
 
26
                            <group colspan="2" col="2">
 
27
                                <field name="update_tax_code"/>
 
28
                                <field name="update_tax"/>
 
29
                                <field name="update_account"/>
 
30
                                <field name="update_fiscal_position"/>
 
31
                            </group>
 
32
                            <group colspan="2">
 
33
                                <label string="If you leave these options set, the wizard will not just create new records, but also update records with changes (i.e. different tax amount)." colspan="4" align="0.0"/>
 
34
                                <label string="Note: Not all the fields are tested for changes, just the main ones." colspan="4" align="0.0"/>
 
35
                            </group>
 
36
                        </group>
 
37
                        <group colspan="4">
 
38
                            <separator string="Other options" colspan="4"/>
 
39
                            <field name="update_children_accounts_parent"/>
 
40
                            <field name="continue_on_errors"/>
 
41
                        </group>
 
42
                    </group>
 
43
 
 
44
                    <group col="4" colspan="4" attrs="{'invisible':[('state','!=','ready')]}">
 
45
                        <separator colspan="4" string="Records to create/update"/>
 
46
                        <notebook colspan="4">
 
47
                            <page string="Tax codes">
 
48
                                <field name="tax_code_ids" colspan="4" nolabel="1" mode="tree,form" height="330">
 
49
                                    <tree string="Tax codes" colors="red:type=='updated'">
 
50
                                        <field name="tax_code_id"/>
 
51
                                        <field name="update_tax_code_id"/>
 
52
                                        <field name="type" invisible="1"/>
 
53
                                    </tree>
 
54
                                    <form string="Tax code">
 
55
                                        <field name="tax_code_id" colspan="4"/>
 
56
                                        <field name="type"/>
 
57
                                        <field name="update_tax_code_id"/>
 
58
                                        <separator string="Notes" colspan="4"/>
 
59
                                        <field name="notes" colspan="4" nolabel="1"/>
 
60
                                    </form>
 
61
                                </field>
 
62
                            </page>
 
63
                            <page string="Taxes">
 
64
                                <field name="tax_ids" colspan="4" nolabel="1" mode="tree,form" height="330">
 
65
                                    <tree string="Taxes" colors="red:type=='updated'">
 
66
                                        <field name="tax_id"/>
 
67
                                        <field name="update_tax_id"/>
 
68
                                        <field name="type" invisible="1"/>
 
69
                                    </tree>
 
70
                                    <form string="Tax">
 
71
                                        <field name="tax_id" colspan="4"/>
 
72
                                        <field name="type"/>
 
73
                                        <field name="update_tax_id"/>
 
74
                                        <separator string="Notes" colspan="4"/>
 
75
                                        <field name="notes" colspan="4" nolabel="1"/>
 
76
                                    </form>
 
77
                                </field>
 
78
                            </page>
 
79
                            <page string="Accounts">
 
80
                                <field name="account_ids" colspan="4" nolabel="1" mode="tree,form" height="330">
 
81
                                    <tree string="Accounts" colors="red:type=='updated'">
 
82
                                        <field name="account_id"/>
 
83
                                        <field name="update_account_id"/>
 
84
                                        <field name="type" invisible="1"/>
 
85
                                    </tree>
 
86
                                    <form string="Account">
 
87
                                        <field name="account_id" colspan="4"/>
 
88
                                        <field name="type"/>
 
89
                                        <field name="update_account_id"/>
 
90
                                        <separator string="Notes" colspan="4"/>
 
91
                                        <field name="notes" colspan="4" nolabel="1"/>
 
92
                                    </form>
 
93
                                </field>
 
94
                            </page>
 
95
                            <page string="Fiscal positions">
 
96
                                <field name="fiscal_position_ids" colspan="4" nolabel="1" mode="tree,form" height="330">
 
97
                                    <tree string="Fiscal positions" colors="red:type=='updated'">
 
98
                                        <field name="fiscal_position_id"/>
 
99
                                        <field name="update_fiscal_position_id"/>
 
100
                                        <field name="type" invisible="1"/>
 
101
                                    </tree>
 
102
                                    <form string="Fiscal position">
 
103
                                        <field name="fiscal_position_id" colspan="4"/>
 
104
                                        <field name="type"/>
 
105
                                        <field name="update_fiscal_position_id"/>
 
106
                                        <separator string="Notes" colspan="4"/>
 
107
                                        <field name="notes" colspan="4" nolabel="1"/>
 
108
                                    </form>
 
109
                                </field>
 
110
                            </page>
 
111
                        </notebook>
 
112
                    </group>
 
113
 
 
114
                    <group col="4" colspan="4" attrs="{'invisible':[('state','!=','done'),]}">
 
115
                        <separator colspan="4" string="Log"/>
 
116
                        <field name="log" colspan="4" nolabel="1"/>
 
117
                        <group colspan="4">
 
118
                            <separator colspan="4" string="Summary of created objects"/>
 
119
                            <field name="new_tax_codes"/>
 
120
                            <field name="new_taxes"/>
 
121
                            <field name="new_accounts"/>
 
122
                            <field name="new_fps"/>
 
123
                        </group>
 
124
                        <group colspan="4">
 
125
                            <separator colspan="4" string="Summary of updated objects"/>
 
126
                            <field name="updated_tax_codes"/>
 
127
                            <field name="updated_taxes"/>
 
128
                            <field name="updated_accounts"/>
 
129
                            <field name="updated_fps"/>
 
130
                        </group>
 
131
                    </group>
 
132
 
 
133
                    <separator string="" colspan="4"/>
 
134
                    <group col="8" colspan="4">
 
135
                        <field name="state"/>
 
136
                        <button icon="gtk-cancel" special="cancel" string="Cancel" states="init,ready"/>
 
137
                        <button icon="gtk-go-forward" name="action_find_records" string="Next" type="object" states="init"/>
 
138
                        <button icon="gtk-go-back" name="action_init" string="Previous" type="object" states="ready"/>
 
139
                        <button icon="gtk-ok" name="action_update_records" string="Create/Update" type="object" states="ready"/>
 
140
                        <button icon="gtk-ok" special="cancel" string="Ok" type="object" states="done"/>
 
141
                    </group>
 
142
 
 
143
                </form>
 
144
            </field>
 
145
        </record>
 
146
 
 
147
        <record id="action_wizard_update_chart" model="ir.actions.act_window">
 
148
            <field name="name">Update Chart of Accounts from a Chart Template</field>
 
149
            <field name="type">ir.actions.act_window</field>
 
150
            <field name="res_model">wizard.update.charts.accounts</field>
 
151
            <field name="view_type">form</field>
 
152
            <field name="view_mode">form</field>
 
153
            <field name="target">new</field>
 
154
        </record>
 
155
 
 
156
        <menuitem parent="account.account_template_folder" action="action_wizard_update_chart" id="menu_wizard"/>
 
157
 
 
158
    </data>
 
159
</openerp>