add website_partner_directory

This commit is contained in:
Luis 2025-08-14 18:06:43 +02:00
commit 9cabf044c8
12 changed files with 275 additions and 0 deletions

View file

@ -0,0 +1,26 @@
from odoo import http
from odoo.http import request
class DirectoryController(http.Controller):
@http.route(["/observatorio"], type="http", auth="public", website=True)
def directory(self, **kwargs):
partners = (
request.env["res.partner"]
.sudo()
.search(
[
("is_company", "=", True),
("show_in_directory", "=", True),
("partner_latitude", "!=", False),
("partner_longitude", "!=", False),
]
)
)
return request.render(
"website_partner_directory.directory_page",
{
"partners": partners,
},
)