Fix Open Chart of Tax Codes when no fiscalyear is selected

issue3202
(transplanted from a230e872a27cfbeb077f9f1470351011cc267160)
This commit is contained in:
Cédric Krier committed 2013-05-04 11:55:46 +02:00
1 parent 0d824501d2
commit d125258998
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