Skip to content
Browse files

[FIX] website: language in url like in 10.0 WIP

With 9cd982b some improvments were done to CDN but this also breaks
our automatic URL rewritting to include the language code.

This PR is a WIP (draft) to include the language code like before.

closes #31792
  • Loading branch information...
nle-odoo committed Mar 12, 2019
1 parent a11147a commit 0abad90d97b75924a3dc998395b9830e5840f768
Showing with 8 additions and 1 deletion.
  1. +8 −1 addons/website/models/
@@ -6,6 +6,7 @@
from odoo import models
from odoo.http import request

from odoo.addons.http_routing.models.ir_http import url_for

re_background_image = re.compile(r"(background-image\s*:\s*url\(\s*['\"]?\s*)([^)'\"]+)")

@@ -37,10 +38,16 @@ def _post_processing_att(self, tagName, atts, options):
if not website and options.get('website_id'):
website = self.env['website'].browse(options['website_id'])

if not website or not website.cdn_activated:
if not website:
return atts

name = self.URL_ATTRS.get(tagName)
if request and name and name in atts:
atts[name] = url_for(atts[name])

if not website.cdn_activated:
return atts

if name and name in atts:
atts = OrderedDict(atts)
atts[name] = website.get_cdn_url(atts[name])

0 comments on commit 0abad90

Please sign in to comment.
You can’t perform that action at this time.