[IMP] set defalut cot as per last configuration wizard.
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Mon, 2 Sep 2013 10:36:29 +0000 (16:06 +0530)
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Mon, 2 Sep 2013 10:36:29 +0000 (16:06 +0530)
bzr revid: tpa@tinyerp.com-20130902103629-9d1joumo51b7w8qg

addons/account/account.py
addons/account/account_installer.xml

index 33b52b6..4773547 100644 (file)
@@ -3076,7 +3076,10 @@ 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:
-                res.update({'only_one_chart_template': len(ids) == 1, 'chart_template_id': ids[0]})
+                chart_id = ids[0]
+                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})
             if 'sale_tax' in fields:
                 sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id"
                                               , "=", ids[0]), ('type_tax_use', 'in', ('sale','all'))], order="sequence")
index b03babc..8d1b25b 100644 (file)
@@ -10,7 +10,7 @@
                 </form>
                 <footer position="replace">
                     <footer>
-                      <button name="action_next" type="object" string="Continue" class="oe_highlight"/>
+                      <button name="action_next" context="{'default_charts':charts}" type="object" string="Continue" class="oe_highlight"/>
                     </footer>
                 </footer>
                 <separator string="title" position="replace">