Odoo modules related to events management
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
798 B

  1. from odoo import models, fields, api
  2. class EventEvent(models.Model):
  3. _inherit = "event.event"
  4. website_indexed = fields.Boolean(
  5. string="Indexed in website",
  6. default=True,
  7. help="This event cannot be found by website suearch if unindexed.",
  8. )
  9. @api.model
  10. def _search_build_domain(self, domain_list, search, fields, extra=None):
  11. if isinstance(domain_list, (list, tuple)):
  12. if not any(
  13. any(term[0] == "website_indexed" for term in domain)
  14. for domain in domain_list
  15. ):
  16. domain_list.append([("website_indexed", "=", True)])
  17. else:
  18. domain_list = [[("website_indexed", "=", True)]]
  19. return super()._search_build_domain(domain_list, search, fields, extra)