From bb21f53e42e53cf0cc76b87dc6f8c5d28cb69ad5 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Wed, 6 Jan 2016 11:58:58 +0700 Subject: [PATCH] get lasted period --- netforce_clinic/models/report_labor_cost.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netforce_clinic/models/report_labor_cost.py b/netforce_clinic/models/report_labor_cost.py index 80f064c..2fe7531 100644 --- a/netforce_clinic/models/report_labor_cost.py +++ b/netforce_clinic/models/report_labor_cost.py @@ -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