add website_partner_directory
This commit is contained in:
commit
9cabf044c8
12 changed files with 275 additions and 0 deletions
26
website_partner_directory/controllers/directory.py
Normal file
26
website_partner_directory/controllers/directory.py
Normal 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,
|
||||
},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue