[IMP]: account: l10n fullness and inheritancy: Add company_id as argument in tax_generate function
bzr revid: ron@tinyerp.com-20110808102658-hy4dkqcdb3u4ike5
This commit is contained in:
parent
7304bef3f6
commit
cb2f70799b
|
@ -2574,7 +2574,7 @@ class account_tax_template(osv.osv):
|
|||
}
|
||||
_order = 'sequence'
|
||||
|
||||
def generate_tax(self, cr, uid, ids, tax_templates_load, tax_code_template_ref, context=None):
|
||||
def generate_tax(self, cr, uid, ids, tax_templates_load, tax_code_template_ref, company_id, context=None):
|
||||
"""
|
||||
This method generate taxes from templates.
|
||||
@param cr: A database cursor.
|
||||
|
@ -2596,10 +2596,8 @@ class account_tax_template(osv.osv):
|
|||
todo_dict = {}
|
||||
tax_template_ref = {}
|
||||
tax_template_to_tax = {}
|
||||
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
|
||||
if not context.get('false_tax_template'):
|
||||
obj_multi = self.browse(cr, uid, ids[0])
|
||||
company_id = obj_multi.company_id.id
|
||||
ir_values_obj = self.pool.get('ir.values')
|
||||
for tax in tax_templates_load:
|
||||
# #create it
|
||||
|
@ -2861,7 +2859,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
tax_template_to_tax = {}
|
||||
context.update({'false_tax_template': False})
|
||||
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)
|
||||
taxes_ids = obj_tax_temp.generate_tax(cr, uid, ids, tax_templates, tax_code_template_ref, company_id, 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
|
||||
|
|
|
@ -38,9 +38,10 @@ class account_tax_generate(osv.osv_memory):
|
|||
|
||||
def tax_generate(self, cr, uid, ids, context=None):
|
||||
context.update({'false_tax_template': True})
|
||||
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
|
||||
obj_tax_temp = self.pool.get('account.tax.template')
|
||||
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)
|
||||
taxes_ids = obj_tax_temp.generate_tax(cr, uid, ids, tax_templates, {}, company_id, context=context)
|
||||
obj_tax_temp.write(cr, uid , taxes_ids['taxes_id'].keys(), {'installable': True})
|
||||
return {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue