[FIX] ir.qweb: use options instead of context to load asset content
The _get_asset_content is cached in function of the template option, don't use context to load content because we must load the asset in function of the compiled caller template.
This commit is contained in:
@@ -157,8 +157,7 @@ class IrQWeb(models.AbstractModel, QWeb):
|
||||
|
||||
@tools.ormcache('xmlid', 'options.get("lang", "en_US")')
|
||||
def _get_asset_content(self, xmlid, options):
|
||||
options = dict(self.env.context)
|
||||
options.update(options,
|
||||
options = dict(options,
|
||||
inherit_branding=False, inherit_branding_auto=False,
|
||||
edit_translations=False, translatable=False,
|
||||
rendering_bundle=True)
|
||||
|
||||
@@ -20,7 +20,7 @@ class TestJavascriptAssetsBundle(TransactionCase):
|
||||
|
||||
def _get_asset(self, xmlid, env=None):
|
||||
env = (env or self.env)
|
||||
files, remains = env['ir.qweb']._get_asset_content(xmlid, {})
|
||||
files, remains = env['ir.qweb']._get_asset_content(xmlid, env.context)
|
||||
return AssetsBundle(xmlid, files, remains, env=env)
|
||||
|
||||
def _any_ira_for_bundle(self, type):
|
||||
|
||||
Reference in New Issue
Block a user