[IMP] Improve xml code for accouting config wizard
[odoo/odoo.git] / addons / account / res_config_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <record id="open_account_charts_modules" model="ir.actions.act_window">
6             <field name="name">Chart Templates</field>
7             <field name="res_model">ir.module.module</field>
8             <field name="view_mode">kanban,tree,form</field>
9             <field name="context" eval="{'search_default_category_id': ref('base.module_category_localization_account_charts')}"/>
10             <field name="search_view_id" ref="base.view_module_filter"/>
11         </record>
12
13         <record id="view_account_config_settings" model="ir.ui.view">
14             <field name="name">account settings</field>
15             <field name="model">account.config.settings</field>
16             <field name="type">form</field>
17             <field name="arch" type="xml">
18                 <form string="Configure Accounting" layout="manual">
19                     <div class="oe_form_topbar">
20                         <button string="Apply" type="object" name="execute"/>
21                         <button string="Cancel" special="cancel"/>
22                     </div>
23                     <sheet layout="auto">
24                         <field name="has_default_company" invisible="1" />
25                         <field name="has_chart_of_accounts" invisible="1"/>
26                         <field name="company_id" widget="selection" on_change="onchange_company_id(company_id)"
27                             attrs="{'invisible': [('has_default_company', '=', True)]}"/>
28                         <field name="expects_chart_of_accounts"/>
29
30                         <group string="No Chart of Accounts exists for this Company" colspan="4" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">
31                             <label string="Please select a chart template to install a chart of accounts." colspan="4"/>
32                             <field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
33                             <button string="Install More Chart Templates" icon="gtk-go-forward"
34                                 name="%(open_account_charts_modules)d" type="action"/>
35                             <newline/>
36                             <field name ="code_digits" groups="account.group_account_user"/>
37                             <field name ="seq_journal"/>
38                             <newline/>
39                             <field name ="complete_tax_set" invisible="1"/>
40                             <field name="sale_tax" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',False)]}"
41                                 domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
42                             <field name="purchase_tax" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',False)]}"
43                                 domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
44                             <field name ="sale_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}" on_change="onchange_tax_rate(sale_tax_rate)"/>
45                             <field name ="purchase_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}"/>
46                         </group>
47
48                         <field name="has_fiscal_year" invisible="1"/>
49                         <group string="No Fiscal Year exists for this Company" colspan="4" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}">
50                             <field name="date_start" on_change="onchange_start_date(date_start)"/>
51                             <field name="date_stop"/>
52                             <field name="period" colspan="4"/>
53                         </group>
54
55                         <group colspan="4">
56                             <separator string="Accounting Configuration" colspan="4"/>
57                             <field name ="complete_tax_set" invisible="1"/>
58                             <newline/>
59                             <group colspan="2" col="2">
60                                 <field name="default_sale_tax" domain="[('type_tax_use','=','sale'), ('company_id','=',company_id)]" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',True), ('has_fiscal_year','=',False)]}"/>
61                                 <field name="module_account_accountant"/>
62                                 <field name="module_account_asset"/>
63                             </group>
64                             <group colspan="2" col="2">
65                                 <field name="default_purchase_tax" domain="[('type_tax_use','=','purchase'), ('company_id','=',company_id)]" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',True), ('has_fiscal_year','=',False)]}"/>
66                                 <field name="currency_id" widget="selection"/>
67                                 <field name="module_account_budget"/>
68                             </group>
69                         </group>
70                         <group colspan="2" col="2">
71                             <separator string="Customer Invoices" colspan="2"/>
72                             <field name="sale_journal_id" invisible="1"/>
73                             <field name="sale_sequence_next" attrs="{'readonly': [('sale_journal_id','=',False)]}"/>
74                             <field name="sale_refund_journal_id" invisible="1"/>
75                             <field name="sale_refund_sequence_next" attrs="{'readonly': [('sale_refund_journal_id','=',False)]}"/>
76                             <field name="module_account_invoice_layout"/>
77                             <field name="module_account_voucher"/>
78                             <field name="module_account_followup"/>
79                             <field name="group_proforma_invoices"/>
80                         </group>
81                         <group colspan="2" col="2">
82                             <separator string="Supplier Invoices" colspan="2"/>
83                             <field name="purchase_journal_id" invisible="1"/>
84                             <field name="purchase_sequence_next" attrs="{'readonly': [('purchase_journal_id','=',False)]}"/>
85                             <field name="purchase_refund_journal_id" invisible="1"/>
86                             <field name="purchase_refund_sequence_next" attrs="{'readonly': [('purchase_refund_journal_id','=',False)]}"/>
87                             <field name="module_account_payment"/>
88                         </group>
89                         <group colspan="2" col="2">
90                             <separator string="Electronic Payments" colspan="2"/>
91                             <field name="paypal_account"/>
92                         </group>
93                         <group colspan="2" col="2">
94                             <separator string="Bank &amp; Cash" colspan="2"/>
95                             <label string="Configure Bank Accounts :"/>
96                             <button name="%(action_bank_tree)d" string="Configure Bank Accounts" icon="gtk-go-forward" type="action"/>
97                             <field name="company_footer"/>
98                             <field name="module_account_check_writing"/>
99                         </group>
100                         <group colspan="4" col="4">
101                             <separator string="Analytic Accounting" colspan="4"/>
102                             <group name="analytic_accounting" colspan="4"/>
103                         </group>
104                     </sheet>
105                 </form>
106             </field>
107         </record>
108
109         <record id="action_account_config" model="ir.actions.act_window">
110             <field name="name">Configure Accounting</field>
111             <field name="type">ir.actions.act_window</field>
112             <field name="res_model">account.config.settings</field>
113             <field name="view_mode">form</field>
114             <field name="target">inline</field>
115         </record>
116
117         <menuitem id="menu_account_config" name="Accounting" parent="base.menu_config"
118             sequence="6" action="action_account_config"/>
119
120     </data>
121 </openerp>