Fix Open Chart of Tax Codes when no fiscalyear is selected

issue3202
This commit is contained in:
Cédric Krier committed 2013-05-04 11:55:46 +02:00
1 parent db88ee3e1d
commit 6017f5714c
1 file changed
+2 -1
+2 -1
View File
@@ -318,7 +318,8 @@ class OpenChartTaxCode(Wizard):
def do_open_(self, action):
if self.start.method == 'fiscalyear':
action['pyson_context'] = PYSONEncoder().encode({
'fiscalyear': self.start.fiscalyear.id,
'fiscalyear': (self.start.fiscalyear.id
if self.start.fiscalyear else None),
})
if self.start.fiscalyear:
action['name'] += ' - %s' % self.start.fiscalyear.rec_name