env = env # noqa # Force generation of both bundles for bundle_name in ('web.assets_backend', 'web.assets_web_dark'): bundle = env['ir.qweb']._get_asset_bundle(bundle_name) css = bundle.css() # this materializes the attachment print(f'{bundle_name}: triggered, css() type={type(css).__name__}') env.cr.commit() # Now find them attachs = env['ir.attachment'].sudo().search( [('url', 'like', '/web/assets/%')], order='id desc', ) print(f'\\n{len(attachs)} asset attachments after force-compile:') for a in attachs: raw_size = len(a.raw or b'') print(f' [{a.id}] {a.name} ({raw_size} bytes)') # Check the dark one for our marker dark = attachs.filtered(lambda a: 'web.assets_web_dark' in (a.name or '')) if dark: text = (dark[0].raw or b'').decode('utf-8', errors='ignore') print(f'\\ndark bundle markers:') print(f' o-mail-Message-actions: {text.count("o-mail-Message-actions")} occurrences') print(f' #2b2f33 marker : {text.count("#2b2f33")} occurrences') print(f' rgba(255, 255, 255, 0.10) marker: {text.count("rgba(255, 255, 255, 0.10)")} occurrences') if '#2b2f33' in text: idx = text.find('#2b2f33') print(f'\\ncontext around our color:') print(text[max(0, idx-300):idx+300])