From 580c89eb87a7ab00cec82b03c616d0ae11e0909a Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 18 Aug 2011 17:47:58 +0530 Subject: [PATCH] [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 --- addons/account/account.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index cc9febd1f50..ae7b0ce70d4 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -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')