[FIX] website: wrong fw-port of commit 971f324c419
Since commit [1], we should use domain instead of _get_http_domain() that was removed. [1]: https://github.com/odoo/odoo/commit/7d8a8ddea0b363732f2177ad589a3e0e10e2fb6c closes odoo/odoo#85692 X-original-commit: 82341e9bd0cad8320fd1b95f3369cf2074978cb0 Signed-off-by: Romain Derie (rde) <rde@odoo.com> Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
import logging
|
||||
import re
|
||||
|
||||
from werkzeug.urls import url_join
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.addons.website.tools import text_from_html
|
||||
from odoo.http import request
|
||||
@@ -280,6 +282,13 @@ class WebsitePublishedMultiMixin(WebsitePublishedMixin):
|
||||
else: # should be in the backend, return things that are published anywhere
|
||||
return is_published
|
||||
|
||||
def open_website_url(self):
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'url': url_join(self.website_id.domain, self.website_url) if self.website_id else self.website_url,
|
||||
'target': 'self',
|
||||
}
|
||||
|
||||
|
||||
class WebsiteSearchableMixin(models.AbstractModel):
|
||||
"""Mixin to be inherited by all models that need to searchable through website"""
|
||||
|
||||
Reference in New Issue
Block a user