[IMP] account: clean up wizard.multi.charts.accounts

bzr revid: rco@openerp.com-20120619143809-l61w89poos2r33db
This commit is contained in:
Raphael Collet 2012-06-19 16:38:09 +02:00
parent 9bbe6bc9f5
commit bd02df1493
5 changed files with 52 additions and 9163 deletions

View File

@ -2969,6 +2969,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=True),
'only_one_chart_template': fields.boolean('Only One Chart Template Available'),
'chart_template_id': fields.many2one('account.chart.template', 'Chart Template', required=True),
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Cash and Banks', required=True),
'code_digits':fields.integer('# of Digits', required=True, help="No. of Digits to use for account code"),
@ -3015,7 +3016,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
ids = self.pool.get('account.chart.template').search(cr, uid, [('visible', '=', True)], context=context)
if ids:
if 'chart_template_id' in fields:
res.update({'chart_template_id': ids[0]})
res.update({'only_one_chart_template': len(ids) == 1, 'chart_template_id': ids[0]})
if 'sale_tax' in fields:
sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id"
, "=", ids[0]), ('type_tax_use', 'in', ('sale','all'))], order="sequence")

View File

@ -2348,48 +2348,66 @@
<!-- Wizard for Multi Charts of Accounts -->
<record id="view_wizard_multi_chart" model="ir.ui.view">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="name">Set Your Accounting Options</field>
<field name="model">wizard.multi.charts.accounts</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<data>
<form position="attributes" version="7.0">
<attribute name="string">Accounting Application Configuration</attribute>
<attribute name="string">Accounting Application Configuration</attribute>
</form>
<button name="action_skip" position="replace"/>
<button name="action_next" position="attributes">
<attribute name="class">oe_form_button_save_dirty</attribute>
</button>
<group string="res_config_contents" position="replace">
<label string="This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template" width="150" />
<separator string="Generate Your Chart of Accounts from a Chart Template" />
<field name="company_id" widget="selection"/> <!-- we assume that this wizard will be run only by administrators and as this field may cause problem if hidden (because of the default company of the user removed from the selection because already configured), we simply choosed to remove the group "multi company" of it -->
<field name="code_digits" groups="account.group_account_user"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
<field name="seq_journal"/>
<field name="sale_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
<field name="purchase_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
<newline/>
<field name ="sale_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}" on_change="onchange_tax_rate(sale_tax_rate)"/>
<field name ="purchase_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
<field name ="complete_tax_set" invisible="1"/>
<newline/> <!-- extended view because the web UI is not good for one2many -->
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="account.group_account_user">
<form string="Bank Information">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection"/>
</form>
<tree editable="bottom" string="Bank Information">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection"/>
</tree>
</field>
<field name="only_one_chart_template" invisible="1"/>
<field name="complete_tax_set" invisible="1"/>
<p>This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template.</p>
<div groups="base.group_multi_company">
<label for="company_id"/>
<field name="company_id" widget="selection"/> <!-- we assume that this wizard will be run only by administrators and as this field may cause problem if hidden (because of the default company of the user removed from the selection because already configured), we simply choosed to remove the group "multi company" of it -->
</div>
<group string="Set Your Accounting Options">
<div attrs="{'invisible': [('only_one_chart_template','=',True)]}">
<label for="chart_template_id"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
</div>
<newline/>
<group groups="account.group_account_user">
<field name="code_digits"/>
<field name="seq_journal"/>
</group>
<group>
<field name="sale_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
<label for="sale_tax_rate" string="Sale Tax" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
<div attrs="{'invisible': [('complete_tax_set', '=', True)]}">
<field name="sale_tax_rate" class="oe_inline" on_change="onchange_tax_rate(sale_tax_rate)"/> %%
</div>
<field name="purchase_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
<label for="purchase_tax_rate" string="Purchase Tax" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
<div attrs="{'invisible': [('complete_tax_set', '=', True)]}">
<field name="purchase_tax_rate" class="oe_inline"/> %%
</div>
</group>
</group>
<notebook>
<page string="Bank Accounts">
<field name="bank_accounts_id" groups="account.group_account_user">
<tree string="Bank Information" editable="bottom">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection"/>
</tree>
</field>
</page>
</notebook>
</group>
</data>
</field>
</record>
<record id="action_wizard_multi_chart" model="ir.actions.act_window">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="name">Set Your Accounting Options</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.multi.charts.accounts</field>
<field name="view_id" ref="view_wizard_multi_chart"/>

View File

@ -548,7 +548,7 @@
</record>
<record id="action_wizard_multi_chart_todo" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="name">Set Your Accounting Options</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
<field name="category_id" ref="account.category_accounting_configuration"/>
<field name="type">automatic</field>

View File

@ -2913,7 +2913,7 @@ msgstr ""
#. module: account
#: model:ir.actions.act_window,name:account.action_wizard_multi_chart
msgid "Generate Chart of Accounts from a Chart Template"
msgid "Set Your Accounting Options"
msgstr ""
#. module: account

File diff suppressed because it is too large Load Diff