*bugfix: the chart wasn't openning if here were no fiscal year selected
authorqdp <qdp@tinyerp.com>
Tue, 16 Sep 2008 09:00:05 +0000 (11:00 +0200)
committerqdp <qdp@tinyerp.com>
Tue, 16 Sep 2008 09:00:05 +0000 (11:00 +0200)
bzr revid: qdp@tinyerp.com-20080916090005-d9mrxuj168qgsj9o

addons/account/wizard/wizard_account_chart.py

index 1a0e0dc..1a1dcd5 100644 (file)
@@ -69,7 +69,8 @@ class wizard_account_chart(wizard.interface):
         id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
         result = act_obj.read(cr, uid, [id])[0]
         result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'target_move':data['form']['target_move']})
-        result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code']
+        if data['form']['fiscalyear']:
+            result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code']
         return result
 
     states = {