odoo-testing-addons/read_arch.py

31 lines
1.0 KiB
Python

print("--- READING HOMEPAGE ARCH ---")
try:
homepage = env.ref('website.homepage')
print(f"Generic Homepage ID: {homepage.id}")
print(f"Arch:\n{homepage.arch}")
print("-" * 20)
current_website = env['website'].get_current_website()
print(f"Current Website ID: {current_website.id}")
# Check if this website has a specific homepage view set
# (some versions use homepage_view_id)
if 'homepage_id' in current_website._fields:
print(f"Website.homepage_id: {current_website.homepage_id}")
else:
print("Field homepage_id does not exist on website model.")
# Check for any view that inherits website.homepage and is active
inherits = env['ir.ui.view'].search([
('inherit_id', '=', homepage.id),
('active', '=', True)
])
print(f"Active Inheriting Views ({len(inherits)}):")
for v in inherits:
print(f" - {v.name} (ID: {v.id}, Key: {v.key}, Priority: {v.priority})")
except Exception as e:
print(f"Error: {e}")