From 7304bef3f6da4cfec7c15c4c5a5f4585699be399 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 8 Aug 2011 15:33:10 +0530 Subject: [PATCH] [IMP]: account: l10n fullness and inheritancy: Improved label in the wizard, and docstring in the function bzr revid: ron@tinyerp.com-20110808100310-f61wr13a559loiyu --- addons/account/account.py | 19 +++++++++++++++++-- addons/account/wizard/account_tax_generate.py | 4 ++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 1f2c00e192e..b8b42f45d59 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2575,6 +2575,21 @@ class account_tax_template(osv.osv): _order = 'sequence' def generate_tax(self, cr, uid, ids, tax_templates_load, tax_code_template_ref, context=None): + """ + This method generate taxes from templates. + @param cr: A database cursor. + @param uid: ID of the user currently logged in. + @param tax_templates: Tax templates. + @param tax_code_template_ref: Taxcode templates reference. + @param company_id: if tax generated from account multi wizard at that time company_id is wizard company_id field + or logged user company_id. + @param Return: + {'taxes_id': taxes ids + 'account_dict': Used this reference value for Account Tax, + 'tax_template_ref': Used this reference value for Fiscal Position + } + """ + if context is None: context = {} res = {} @@ -2845,8 +2860,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): #create all the tax tax_template_to_tax = {} context.update({'false_tax_template': False}) - tax_templates_load = [x for x in obj_multi.chart_template_id.tax_template_ids if x.installable] - taxes_ids = obj_tax_temp.generate_tax(cr, uid, ids, tax_templates_load, tax_code_template_ref, context=context) + tax_templates = [x for x in obj_multi.chart_template_id.tax_template_ids if x.installable] + taxes_ids = obj_tax_temp.generate_tax(cr, uid, ids, tax_templates, tax_code_template_ref, context=context) #deactivate the parent_store functionnality on account_account for rapidity purpose ctx = context and context.copy() or {} ctx['defer_parent_store_computation'] = True diff --git a/addons/account/wizard/account_tax_generate.py b/addons/account/wizard/account_tax_generate.py index 1ee43b7813b..a149dd4d996 100644 --- a/addons/account/wizard/account_tax_generate.py +++ b/addons/account/wizard/account_tax_generate.py @@ -39,8 +39,8 @@ class account_tax_generate(osv.osv_memory): def tax_generate(self, cr, uid, ids, context=None): context.update({'false_tax_template': True}) obj_tax_temp = self.pool.get('account.tax.template') - tax_templates_load = [x for x in self.browse(cr, uid, ids, context=context)[0].template_ids] - taxes_ids = obj_tax_temp.generate_tax(cr, uid, ids, tax_templates_load, {}, context=context) + tax_templates = [x for x in self.browse(cr, uid, ids, context=context)[0].template_ids] + taxes_ids = obj_tax_temp.generate_tax(cr, uid, ids, tax_templates, {}, context=context) obj_tax_temp.write(cr, uid , taxes_ids['taxes_id'].keys(), {'installable': True}) return {}