FIX Print wizard labor cost (check : period_id)

fix1
SPP 2018-01-22 15:40:56 +07:00
parent b5e3900156
commit 43466e07f9
1 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class PrintLaborCost(Model):
date_to=defaults.get("date_to", self._get_date_to())
print('defaults ', defaults)
yearnow=date_from.split("-")[0]
if len(get_model('clinic.period').search_browse([['name','=',yearnow]]))==0:
period_id=None
for period in get_model('clinic.period').search_browse([['name','=',yearnow]]):
for line in period.lines:
if line.state=='open':
@ -96,6 +98,8 @@ class PrintLaborCost(Model):
dbname=get_active_db()
fdir=os.path.join("static","db",dbname,"files")
tmp_dir='/tmp/wizard_lc'
print('majins',fdir)
print('majins',tmp_dir)
if not os.path.isdir(tmp_dir):
os.system("mkdir %s"%(tmp_dir))
#Create File Name