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

[UPD] contract sale report compute tags for performance

parent 6ae562e8
No related branches found
No related tags found
No related merge requests found
# Copyright 2023 Le Filament (https://le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import api, fields, models, tools
from odoo import fields, models, tools
class HallContractSaleReport(models.Model):
......@@ -88,18 +88,21 @@ class HallContractSaleReport(models.Model):
"partner_id",
"manager_id",
"commercial_name",
"tag_ids",
],
}
@api.depends("contract_id")
# ------------------------------------------------------
# Compute functions
# ------------------------------------------------------
def _compute_tags(self):
for s in self:
s.tag_ids = s.contract_id.tag_ids
self.tag_ids = self.env["hall.contract.tag"].search([])
def _search_tags(self, operator, value):
return [("contract_id.tag_ids", operator, value)]
# ------------------------------------------------------
# Query functions
# ------------------------------------------------------
def _select(self):
return """
SELECT
......
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