[IMP] account: improve config settings form
[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" version="7.0">
19                     <header>
20                         <button string="Apply" type="object" name="execute" class="oe_highlight"/>
21                         <button string="Cancel" special="cancel"/>
22                     </header>
23                     <sheet>
24                     <field name="has_default_company" invisible="1" />
25                     <field name="has_chart_of_accounts" invisible="1"/>
26                     <field name="complete_tax_set" invisible="1"/>
27                     <field name="has_fiscal_year" invisible="1"/>
28
29                     <group groups="base.group_multi_company">
30                         <field name="company_id" string="Select Company" widget="selection"
31                             on_change="onchange_company_id(company_id)"
32                             attrs="{'invisible': [('has_default_company', '=', True)]}"/>
33                         <field name="expects_chart_of_accounts"/>
34                     </group>
35
36                     <group string="Select a Chart of Accounts to Install"
37                         attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">
38                         <group>
39                             <field name="chart_template_id" widget="selection" domain="[('visible','=', True)]"
40                                 on_change="onchange_chart_template_id(chart_template_id)"/>
41                             <field name="code_digits" groups="account.group_account_user"/>
42                             <field name="sale_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',('sale','all'))]"/>
44                             <field name="purchase_tax" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',False)]}"
45                                 domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
46                             <field name="sale_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}" on_change="onchange_tax_rate(sale_tax_rate)"/>
47                             <field name="purchase_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}"/>
48                         </group>
49                         <button string="Install More Chart Templates" icon="gtk-go-forward"
50                             name="%(open_account_charts_modules)d" type="action"/>
51                     </group>
52
53                     <group string="No Fiscal Year Defined for This Company"
54                         attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}">
55                         <label for="date_start" string="Date Range"/>
56                         <div>
57                             <field name="date_start" on_change="onchange_start_date(date_start)" class="oe_inline"/> -
58                             <field name="date_stop" class="oe_inline"/>
59                         </div>
60                         <field name="period"/>
61                     </group>
62
63                     <group string="Accounting Configuration">
64                         <group>
65                             <field name="default_sale_tax" domain="[('type_tax_use','=','sale'), ('company_id','=',company_id)]"
66                                 attrs="{'invisible': [('has_chart_of_accounts','=',False)]}"/>
67                             <field name="module_account_accountant"/>
68                             <field name="currency_id"/>
69                             <field name="decimal_precision"/>
70                         </group>
71                         <group>
72                             <field name="default_purchase_tax" domain="[('type_tax_use','=','purchase'), ('company_id','=',company_id)]"
73                                 attrs="{'invisible': [('has_chart_of_accounts','=',False)]}"/>
74                             <field name="module_account_asset"/>
75                             <field name="module_account_budget"/>
76                         </group>
77                     </group>
78
79                     <field name="sale_journal_id" invisible="1"/>
80                     <field name="sale_refund_journal_id" invisible="1"/>
81                     <field name="purchase_journal_id" invisible="1"/>
82                     <field name="purchase_refund_journal_id" invisible="1"/>
83                     <group>
84                         <group string="Customer Invoices">
85                             <label for="sale_sequence_next"/>
86                             <group>
87                                 <field name="sale_sequence_prefix" class="oe_inline" nolabel="1"
88                                     help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
89                                 <field name="sale_sequence_next" class="oe_inline" nolabel="1" attrs="{'readonly': [('sale_journal_id','=',False)]}"/>
90                             </group>
91                             <label for="sale_refund_sequence_next"/>
92                             <group>
93                                 <field name="sale_refund_sequence_prefix" class="oe_inline" nolabel="1"
94                                     help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
95                                 <field name="sale_refund_sequence_next" class="oe_inline" nolabel="1" attrs="{'readonly': [('sale_refund_journal_id','=',False)]}"/>
96                             </group>
97                             <field name="module_account_invoice_layout"/>
98                             <field name="module_account_voucher"/>
99                             <field name="module_account_followup"/>
100                             <field name="group_proforma_invoices"/>
101                         </group>
102
103                         <group string="Supplier Invoices">
104                              <label for="purchase_sequence_next"/>
105                             <group>
106                                 <field name="purchase_sequence_prefix" class="oe_inline" nolabel="1"
107                                     help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
108                                 <field name="purchase_sequence_next" class="oe_inline" nolabel="1" attrs="{'readonly': [('purchase_journal_id','=',False)]}"/>
109                             </group>
110                             <label for="purchase_refund_sequence_next"/>
111                             <group>
112                                 <field name="purchase_refund_sequence_prefix" class="oe_inline" nolabel="1"
113                                     help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
114                                 <field name="purchase_refund_sequence_next" class="oe_inline" nolabel="1"
115                                   attrs="{'readonly': [('purchase_refund_journal_id','=',False)]}"/>
116                             </group>
117                             <field name="module_account_payment"/>
118                         </group>
119
120                         <group string="Electronic Payments">
121                             <field name="paypal_account" placeholder="sales@openerp.com"/>
122                         </group>
123
124                         <group string="Bank &amp; Cash">
125                             <label for="id" string="Configure Bank Accounts"/>
126                             <button name="%(action_bank_tree)d" string="Configure Bank Accounts" icon="gtk-go-forward" type="action"/>
127                             <field name="company_footer"/>
128                             <field name="module_account_check_writing"/>
129                         </group>
130
131                         <group name="analytic_accounting" invisible="1" string="Analytic Accounting"/>
132                     </group>
133                     </sheet>
134                 </form>
135             </field>
136         </record>
137
138         <record id="action_account_config" model="ir.actions.act_window">
139             <field name="name">Configure Accounting</field>
140             <field name="type">ir.actions.act_window</field>
141             <field name="res_model">account.config.settings</field>
142             <field name="view_mode">form</field>
143             <field name="target">inline</field>
144         </record>
145
146         <menuitem id="menu_account_config" name="Accounting" parent="base.menu_config"
147             sequence="14" action="action_account_config"/>
148
149     </data>
150 </openerp>