Commit deb54845 by François C.

#1828 Fix history bug

parent a6493b55
Pipeline #1656 passed with stage
in 1 minute 34 seconds
...@@ -36,7 +36,7 @@ class CagetteMembersSpace(models.Model): ...@@ -36,7 +36,7 @@ class CagetteMembersSpace(models.Model):
try: try:
cond = [ cond = [
['partner_id', '=', partner_id], ['partner_id', '=', partner_id],
['create_date', '>', date_from], ['date_begin', '>', date_from],
['date_begin', '<', today], ['date_begin', '<', today],
['state', '!=', 'draft'], ['state', '!=', 'draft'],
['state', '!=', 'open'], ['state', '!=', 'open'],
...@@ -88,10 +88,10 @@ class CagetteMembersSpace(models.Model): ...@@ -88,10 +88,10 @@ class CagetteMembersSpace(models.Model):
res = res + [] res = res + []
# Add amnesty line # Add amnesty line
is_amnesty = getattr(settings, 'AMNISTIE_DATE', 'false') is_amnesty = getattr(settings, 'AMNISTIE_DATE', False)
company_code = getattr(settings, 'COMPANY_CODE', '') company_code = getattr(settings, 'COMPANY_CODE', '')
if is_amnesty and company_code == "lacagette": if is_amnesty and company_code == "lacagette":
amnesty={} amnesty = {}
amnesty['is_amnesty'] = True amnesty['is_amnesty'] = True
amnesty['create_date'] = is_amnesty amnesty['create_date'] = is_amnesty
amnesty['date_begin'] = is_amnesty amnesty['date_begin'] = is_amnesty
...@@ -107,7 +107,7 @@ class CagetteMembersSpace(models.Model): ...@@ -107,7 +107,7 @@ class CagetteMembersSpace(models.Model):
paginated_res = res[offset:end_index] paginated_res = res[offset:end_index]
except Exception as e: except Exception as e:
print(str(e)) coop_logger.error("get_shifts_history : %s", str(e))
return paginated_res return paginated_res
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment