mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
@@ -199,12 +199,16 @@ class ContractLine(models.Model):
|
|||||||
today = fields.Date.context_today(self)
|
today = fields.Date.context_today(self)
|
||||||
if state == "upcoming":
|
if state == "upcoming":
|
||||||
return [
|
return [
|
||||||
|
"&",
|
||||||
|
("display_type", "=", False),
|
||||||
"&",
|
"&",
|
||||||
("date_start", ">", today),
|
("date_start", ">", today),
|
||||||
("is_canceled", "=", False),
|
("is_canceled", "=", False),
|
||||||
]
|
]
|
||||||
if state == "in-progress":
|
if state == "in-progress":
|
||||||
return [
|
return [
|
||||||
|
"&",
|
||||||
|
("display_type", "=", False),
|
||||||
"&",
|
"&",
|
||||||
"&",
|
"&",
|
||||||
"&",
|
"&",
|
||||||
@@ -217,10 +221,14 @@ class ContractLine(models.Model):
|
|||||||
("is_auto_renew", "=", True),
|
("is_auto_renew", "=", True),
|
||||||
"&",
|
"&",
|
||||||
("is_auto_renew", "=", False),
|
("is_auto_renew", "=", False),
|
||||||
|
"|",
|
||||||
|
("termination_notice_date", "=", False),
|
||||||
("termination_notice_date", ">", today),
|
("termination_notice_date", ">", today),
|
||||||
]
|
]
|
||||||
if state == "to-renew":
|
if state == "to-renew":
|
||||||
return [
|
return [
|
||||||
|
"&",
|
||||||
|
("display_type", "=", False),
|
||||||
"&",
|
"&",
|
||||||
"&",
|
"&",
|
||||||
("is_canceled", "=", False),
|
("is_canceled", "=", False),
|
||||||
@@ -233,6 +241,8 @@ class ContractLine(models.Model):
|
|||||||
]
|
]
|
||||||
if state == "upcoming-close":
|
if state == "upcoming-close":
|
||||||
return [
|
return [
|
||||||
|
"&",
|
||||||
|
("display_type", "=", False),
|
||||||
"&",
|
"&",
|
||||||
"&",
|
"&",
|
||||||
"&",
|
"&",
|
||||||
@@ -247,6 +257,8 @@ class ContractLine(models.Model):
|
|||||||
]
|
]
|
||||||
if state == "closed":
|
if state == "closed":
|
||||||
return [
|
return [
|
||||||
|
"&",
|
||||||
|
("display_type", "=", False),
|
||||||
"&",
|
"&",
|
||||||
"&",
|
"&",
|
||||||
"&",
|
"&",
|
||||||
@@ -260,7 +272,7 @@ class ContractLine(models.Model):
|
|||||||
("manual_renew_needed", "=", False),
|
("manual_renew_needed", "=", False),
|
||||||
]
|
]
|
||||||
if state == "canceled":
|
if state == "canceled":
|
||||||
return [("is_canceled", "=", True)]
|
return ["&", ("display_type", "=", False), ("is_canceled", "=", True)]
|
||||||
if not state:
|
if not state:
|
||||||
return [("display_type", "!=", False)]
|
return [("display_type", "!=", False)]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user