odoo_clicks2cart/fix_homepage.py
2026-03-02 21:31:24 +05:30

9 lines
353 B
Python

p = env['website.page'].search([('url', '=', '/'), ('website_id', '=', 6)], limit=1)
v = env.ref('theme_clicks2cart.clicks2cart_homepage_v17', False)
print('Current page view:', p.view_id.id if p else 'No page found')
print('Custom view:', v.id if v else 'Not found')
if p and v:
p.view_id = v
env.cr.commit()
print('Updated successfully!')