[ADD]: account: l10n fullness and inheritancy : Create new common fucntion _install_template() for install templates like recursively. If you selected a COA template with a parent, you must first load the parent then load the templates define in the selected COA

bzr revid: ron@tinyerp.com-20110818121758-g0poj5544dte66lo
This commit is contained in:
ron@tinyerp.com 2011-08-18 17:47:58 +05:30
parent 44fda7dea5
commit 580c89eb87
1 changed files with 6 additions and 0 deletions

View File

@ -3035,6 +3035,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
return True
def _install_template(self, cr, uid, ids, template_id, context=None):
template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context)
if template.parent_id:
self._install_template(cr, uid, ids, template.parent_id.id, context=context)
return self._load_template(cr, uid, ids, template_id, context=context)
def execute(self, cr, uid, ids, context=None):
obj_multi = self.browse(cr, uid, ids[0])
obj_acc = self.pool.get('account.account')