[REF] account: code cleaning and removal of fields_view_get useless overwriting
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Fri, 9 Dec 2011 09:45:06 +0000 (10:45 +0100)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Fri, 9 Dec 2011 09:45:06 +0000 (10:45 +0100)
bzr revid: qdp-launchpad@openerp.com-20111209094506-798lozt56rrihzj9

addons/account/account.py
addons/account/account_view.xml

index 89e1061..8f85ade 100644 (file)
@@ -2827,13 +2827,13 @@ class account_fiscal_position_template(osv.osv):
 
     def generate_fiscal_position(self, cr, uid, chart_temp_id, tax_template_ref, acc_template_ref, company_id, context=None):
         """
-        This method generate Fiscal Position , Fiscal Position Accounts and Fiscal Position Taxes from templates.
-        @param cr: A database cursor.
-        @param uid: ID of the user currently logged in.
-        @param chart_temp_id: Chart Template Id.
-        @param taxes_ids: Taxes templates reference for generating account.fiscal.position.tax.
-        @param acc_template_ref: Account templates reference for generating account.fiscal.position.account.
-        @param company_id: company_id selected from wizard.multi.charts.accounts.
+        This method generate Fiscal Position, Fiscal Position Accounts and Fiscal Position Taxes from templates.
+
+        :param chart_temp_id: Chart Template Id.
+        :param taxes_ids: Taxes templates reference for generating account.fiscal.position.tax.
+        :param acc_template_ref: Account templates reference for generating account.fiscal.position.account.
+        :param company_id: company_id selected from wizard.multi.charts.accounts.
+        :returns: True
         """
         if context is None:
             context = {}
@@ -2855,7 +2855,7 @@ class account_fiscal_position_template(osv.osv):
                     'account_dest_id': acc_template_ref[acc.account_dest_id.id],
                     'position_id': new_fp
                 })
-        return {}
+        return True
 
 account_fiscal_position_template()
 
@@ -2989,7 +2989,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
         '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"),
         'seq_journal':fields.boolean('Separated Journal Sequences', help="Check this box if you want to use a different sequence for each created journal. Otherwise, all will use the same sequence."),
-        "sale_tax": fields.many2one("account.tax.template", "Default Sales Tax"),
+        "sale_tax": fields.many2one("account.tax.template", "Default Sale Tax"),
         "purchase_tax": fields.many2one("account.tax.template", "Default Purchase Tax"),
         'sale_tax_rate': fields.float('Sales Tax(%)'),
         'purchase_tax_rate': fields.float('Purchase Tax(%)'),
@@ -3048,7 +3048,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
         acc_template_obj = self.pool.get('account.chart.template')
         company_obj = self.pool.get('res.company')
 
-        template_ids = acc_template_obj.search(cr, uid, [('visible', '=', True)], context=context)
         company_ids = company_obj.search(cr, uid, [], context=context)
         #display in the widget selection of companies, only the companies that haven't been configured yet (but don't care about the demo chart of accounts)
         cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",))
@@ -3061,11 +3060,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
                 if unconfigured_cmp:
                     cmp_select = [(line.id, line.name) for line in company_obj.browse(cr, uid, unconfigured_cmp)]
                     res['fields'][field]['selection'] = cmp_select
-            if field == 'chart_template_id':
-                res['fields'][field]['selection'] = [('', '')]
-                if template_ids:
-                    template_select = [(template.id, template.name) for template in acc_template_obj.browse(cr, uid, template_ids)]
-                    res['fields'][field]['selection'] = template_select
         return res
 
     def check_created_journals(self, cr, uid, vals_journal, company_id, context=None):
index fabf689..59a2a8e 100644 (file)
                 <group string="res_config_contents" position="replace">
                     <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)"/>
+                    <field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
                     <field name ="seq_journal" groups="base.group_extended"/>
                     <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'))]"/>