[FIX] website, *: restore color edition in theme dialog

* base, web_editor

Commit https://github.com/odoo/odoo/commit/44d659d0df6b50ae230af39a0d41a46b9549e2ae
made the system work with multi-website but fetching the assets content
was unfortunately not working in multi-website...

Also restore correct search operators.
This commit is contained in:
qsm-odoo
2018-09-27 13:56:09 +02:00
parent 64719b71d5
commit 509a7f73b0
3 changed files with 7 additions and 6 deletions
+3 -3
View File
@@ -452,13 +452,13 @@ class Web_Editor(http.Controller):
self.get_custom_attachment(custom_url).unlink()
self.get_custom_view(custom_url).unlink()
def get_custom_attachment(self, custom_url, op='like'):
assert op in ('like', '=like', '='), 'Invalid operator'
def get_custom_attachment(self, custom_url, op='='):
assert op in ('=like', '='), 'Invalid operator'
IrAttachment = request.env["ir.attachment"]
return IrAttachment.search([("url", op, custom_url)])
def get_custom_view(self, custom_url, op='='):
assert op in ('like', '=ilike', '='), 'Invalid operator'
assert op in ('=like', '='), 'Invalid operator'
IrUiView = request.env["ir.ui.view"]
return IrUiView.search([("name", op, custom_url)])
+1 -1
View File
@@ -22,7 +22,7 @@ class Web_Editor(Web_Editor):
res['website_id'] = website.id
return res
def get_custom_attachment(self, custom_url, op='like'):
def get_custom_attachment(self, custom_url, op='='):
website = request.env['website'].get_current_website()
res = super(Web_Editor, self).get_custom_attachment(custom_url, op=op)
return res.with_context(website_id=website.id).filtered(lambda x: not x.website_id or x.website_id == website)
+3 -2
View File
@@ -314,7 +314,8 @@ class IrQWeb(models.AbstractModel, QWeb):
edit_translations=False, translatable=False,
rendering_bundle=True)
env = self.env(context=options)
options['website_id'] = self.env.context.get('website_id')
IrQweb = self.env['ir.qweb'].with_context(options)
def can_aggregate(url):
return not urls.url_parse(url).scheme and not urls.url_parse(url).netloc and not url.startswith('/web/content')
@@ -327,7 +328,7 @@ class IrQWeb(models.AbstractModel, QWeb):
from odoo.addons.web.controllers.main import module_boot
return json.dumps(module_boot())
return '[]'
template = env['ir.qweb'].render(xmlid, {"get_modules_order": get_modules_order})
template = IrQweb.render(xmlid, {"get_modules_order": get_modules_order})
files = []
remains = []