merge file

production
watcha.h 2015-12-11 15:43:01 +07:00
parent 5d1a7ba4f1
commit a10b7017a5
4 changed files with 9 additions and 3 deletions

View File

@ -238,11 +238,10 @@ class PrintLaborCost(Model):
for line in obj.lines:
staff=line.staff_id
for report_line in report_lines:
#name=staff.number or staff.name or staff.id
name=staff.number+"-"+(staff.name or staff.id)
name='%s-%s'%(staff.first_name,staff.number)
name=name.replace(" ","-")
fname='%s-%s.xlsx'%(name,report_line['report_file'])
print('fname ---> ', fname)
#report_file=report_line['report_file']
report_model=report_line['model']
report_template=report_model.replace(".","_").replace("clinic_","")
report_id=report_line['report_id']
@ -282,11 +281,18 @@ class PrintLaborCost(Model):
db.commit()
os.system("cp -rf %s ."%tmp_dir)
os.system("cp merge.py labor_cost/")
os.system("python labor_cost/merge.py labor_cost")
os.system("rm labor_cost/*.py")
os.system("rm labor_cost/*.xlsx")
os.system("mv labor_cost %s"%obj.name)
os.system("zip %s.zip %s/*"%(obj.name,obj.name))
os.system("mv %s.zip %s/"%(obj.name,fdir))
os.system("rm -r %s*"%(obj.name))
os.system("rm %s/*"%tmp_dir)
obj.write({
'zip_file': '%s.zip'%obj.name,
'state': 'done',