Skip to content
Snippets Groups Projects
Commit a1e77f1c authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[update] dashboard data single contract

parent 5a82d9d6
No related branches found
No related tags found
No related merge requests found
......@@ -153,10 +153,17 @@ class HallContract(models.Model):
def _get_revenue_detail(self):
if len(self) != 1:
return False
today = fields.Date.today()
start = today.replace(day=1) - relativedelta(months=12)
end = today.replace(day=1)
target_report_ids = self.env["hall.contract.target.report"].search(
[
("contract_id", "=", self.id),
("day_date", ">=", start),
("day_date", "<=", end),
],
order="day_date",
limit=12,
)
return target_report_ids
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment