get lasted period

production
watcha.h 2016-01-06 11:58:58 +07:00
parent 9f1fe78829
commit bb21f53e42
1 changed files with 3 additions and 1 deletions

View File

@ -41,7 +41,9 @@ class ReportLaborCost(Model):
report_type=defaults.get("report_type","cross")
print('defaults ', defaults)
yearnow=date_from.split("-")[0]
for period in get_model('clinic.period').search_browse([['name','=',yearnow]]):
period_id=None
#for period in get_model('clinic.period').search_browse([['name','=',yearnow]]):
for period in get_model('clinic.period').search_browse([[]]):
for line in period.lines:
if line.state=='open':
period_id=line.id