fixed null issue in update_cp

This commit is contained in:
Nabin Hait 2011-09-08 17:58:54 +05:30
parent 269115f191
commit a06c2ceaff

View File

@ -29,7 +29,7 @@ class DocType:
set_default(defkey, defvalue)
if defkey == 'fiscal_year':
ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", defvalue)
ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", cstr(defvalue))
ysd = ysd and ysd[0][0] or ''
if ysd:
set_default('year_start_date', ysd.strftime('%Y-%m-%d'))