Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
692 Lượt xem

Hi ,

After regenerating asset bundles in Odoo 17, all report layouts (PDF/QWeb) appear completely broken – missing styles, misaligned elements, and no formatting. I’ve already Upgraded base, web, and web_editor modules

How can I Restore core report templates to their original state?


Any guidance would be greatly appreciated!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hii,

Clear All Custom Assets and Templates (if any):

If you've inherited or modified any of the following templates, they could be causing issues:

  • web.external_layout
  • web.external_layout_standard
  • web.report_layout
  • web.basic_layout
  • web.minimal_layout
  • report.external_layout

Run this SQL query to check for overridden views:

SELECT id, name, key, inherit_id, arch_db

FROM ir_ui_view

WHERE key LIKE 'web.external_layout%'

   OR key LIKE 'web.report_layout%'

   OR key LIKE 'report.external_layout%';

If you see custom/inherited views, you can temporarily disable them (set active=False) and re-test reports.

Force Rebuild Assets

Even though you've regenerated assets, do it again from a clean state:

# Stop Odoo first

./odoo-bin --stop-after-init


# Remove old assets

find ./ -name "*.assets.json" -delete

rm -rf ./odoo/addons/web/static/lib/*   # optional: reset vendored libs if changed


# Restart with assets reset

./odoo-bin -u base,web,web_editor --dev=all --stop-after-init

Also clear browser and wkhtmltopdf caches if needed.


Check PDF Engine: wkhtmltopdf

Ensure you're using a supported version of wkhtmltopdf. For Odoo 17:

  • ✅ Recommended: 0.12.6 (with patched Qt)
  • ❌ Known broken styles: 0.12.5 or default system versions

Test:

wkhtmltopdf --version

Enable Developer Mode and Test Built-in Report

Open Developer Mode and test a core report like:

  • Sales Order Report: Sales > Orders > Print > Quotation / Order

If this still fails, it's not caused by custom templates, but likely asset loading or rendering engine issues.

Verify Asset Bundles are Available

From browser DevTools (F12):

  • Go to any printable report preview.
  • Open Network tab.
  • Check if CSS files like web.assets_common.css, web.report_assets_common.css, web.report_assets_pdf.css are loading.

If they 404 or are missing, regenerate with:

./odoo-bin --dev=all -u base,web,web_editor --stop-after-init


Ảnh đại diện
Huỷ bỏ