diff options
| author | Turkesh Patel (Open ERP) <tpa@tinyerp.com> | 2013-09-03 11:07:15 +0530 |
|---|---|---|
| committer | Turkesh Patel (Open ERP) <tpa@tinyerp.com> | 2013-09-03 11:07:15 +0530 |
| commit | e7ef5b87909dc6acaedf8b0660b2ba87189e1d6c (patch) | |
| tree | 4844fdf86317de7fc6ba760682d606ef0546183a | |
| parent | 34862b9d247571606b11b751542751b9720d5627 (diff) | |
[IMP] in order to set default chart which was last created set max of ids.
bzr revid: tpa@tinyerp.com-20130903053715-zyduv0q0b81lz0vq
| -rw-r--r-- | addons/account/account.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/account/account.py b/addons/account/account.py index 1a593e4ad59..9f9ee187d69 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -3072,7 +3072,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): ids = self.pool.get('account.chart.template').search(cr, uid, [('visible', '=', True)], context=context) if ids: if 'chart_template_id' in fields: - chart_id = ids[0] + #in order to get set default chart which was last created set max of ids. + chart_id = max(ids) if context.get("default_charts"): chart_id = self.pool.get('ir.model.data').search_read(cr, uid, [('model','=','account.chart.template'),('module','=',context.get("default_charts"))], ['res_id'], context=context)[0]['res_id'] res.update({'only_one_chart_template': len(ids) == 1, 'chart_template_id': chart_id}) |
