Skip to content
Snippets Groups Projects
Commit 0c2f83f4 authored by 张文广's avatar 张文广 Committed by Martin Trigaux
Browse files

[FIX] base: return all the css attachments


When detecting if the assets where already preprocessed, the method
only the last asset type matching was returned and deleted.
In standard, it should not have any impact as all assets are of the
same type but it may be possible to mix it with external modules.

Sign CLA

closes odoo/odoo#79755

X-original-commit: 3a98996e
Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
parent 3f15355c
Branches
Tags
No related merge requests found
......@@ -422,7 +422,7 @@ class AssetsBundle(object):
def is_css_preprocessed(self):
preprocessed = True
attachments = None
old_attachments = self.env['ir.attachment']
asset_types = [SassStylesheetAsset, ScssStylesheetAsset, LessStylesheetAsset]
if self.user_direction == 'rtl':
asset_types.append(StylesheetAsset)
......@@ -433,6 +433,7 @@ class AssetsBundle(object):
if assets:
assets_domain = self._get_assets_domain_for_already_processed_css(assets)
attachments = self.env['ir.attachment'].sudo().search(assets_domain)
old_attachments += attachments
for attachment in attachments:
asset = assets[attachment.url]
if asset.last_modified > attachment['__last_update']:
......@@ -449,7 +450,7 @@ class AssetsBundle(object):
if outdated:
preprocessed = False
return preprocessed, attachments
return preprocessed, old_attachments
def preprocess_css(self, debug=False, old_attachments=None):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment