diff --git a/addons/debug_view.py b/addons/debug_view.py new file mode 100644 index 0000000..263c5fc --- /dev/null +++ b/addons/debug_view.py @@ -0,0 +1,47 @@ + +print("--- STARTING FIX SCRIPT ---") +try: + # In odoo shell, 'env' is available. + # Find active website (or first one) + websites = env['website'].search([]) + for w in websites: + print(f"Checking website: {w.name} (ID: {w.id})") + + # Check for COW view for this website + homepage_key = 'website.homepage' + cow_views = env['ir.ui.view'].search([ + ('key', '=', homepage_key), + ('website_id', '=', w.id) + ]) + + if cow_views: + print(f"Found {len(cow_views)} custom homepage views (COW) for {w.name}. Archiving them...") + for view in cow_views: + print(f" - Archiving view {view.name} (ID: {view.id})") + view.write({'active': False}) + else: + print(f"No custom homepage views found for {w.name}.") + + # Check theme view logic + # The theme view should replace website.homepage + theme_view = env.ref('theme_chennora.custom_homepage', raise_if_not_found=False) + if theme_view: + print(f"Theme view found: {theme_view.name} (ID: {theme_view.id}, Priority: {theme_view.priority})") + # Ensure it's active + if not theme_view.active: + theme_view.write({'active': True}) + print(" - Activated theme view") + + # Ensure priority is high enough to beat default but usually COW is the issue + if theme_view.priority < 50: + theme_view.write({'priority': 50}) + print(" - Updated priority to 50") + else: + print("WARNING: Theme view 'theme_chennora.custom_homepage' not found! Make sure the module is upgraded.") + + env.cr.commit() + print("--- FIX COMPLETE ---") +except Exception as e: + print(f"ERROR: {e}") + import traceback + traceback.print_exc() diff --git a/addons/home_dashboard/controllers/__pycache__/main.cpython-310.pyc b/addons/home_dashboard/controllers/__pycache__/main.cpython-310.pyc index aaae469..245d943 100644 Binary files a/addons/home_dashboard/controllers/__pycache__/main.cpython-310.pyc and b/addons/home_dashboard/controllers/__pycache__/main.cpython-310.pyc differ diff --git a/addons/home_dashboard/controllers/main.py b/addons/home_dashboard/controllers/main.py index 4c83f7e..f0dc179 100644 --- a/addons/home_dashboard/controllers/main.py +++ b/addons/home_dashboard/controllers/main.py @@ -28,4 +28,4 @@ class ImageHome(Website): @http.route('/home', type='http', auth="public", website=True, sitemap=True) def website_home(self, **kw): # Explicit route for standard Website Homepage - return super(ImageHome, self).index(**kw) \ No newline at end of file + return request.render('website.homepage') \ No newline at end of file diff --git a/addons/theme_chennora/__manifest__.py b/addons/theme_chennora/__manifest__.py index 861a159..c564731 100644 --- a/addons/theme_chennora/__manifest__.py +++ b/addons/theme_chennora/__manifest__.py @@ -4,7 +4,7 @@ 'category': 'Theme/Website', 'version': '1.0', 'author': 'Your Company', - 'depends': ['website', 'website_sale'], + 'depends': ['website', 'website_sale', 'website_crm'], 'data': [ 'views/layout.xml', # Header, Footer, and Global Layout changes 'views/pages.xml', # specific page content (Home, About, etc.) diff --git a/addons/theme_chennora/dump_home.py b/addons/theme_chennora/dump_home.py new file mode 100644 index 0000000..8c467f3 --- /dev/null +++ b/addons/theme_chennora/dump_home.py @@ -0,0 +1,3 @@ +v = env['ir.ui.view'].browse(3221) +with open('/mnt/extra-addons/theme_chennora/view_3221.xml', 'w') as f: + f.write(str(v.arch_db)) diff --git a/addons/theme_chennora/views/layout.xml b/addons/theme_chennora/views/layout.xml index 7580c46..7afbcf8 100644 --- a/addons/theme_chennora/views/layout.xml +++ b/addons/theme_chennora/views/layout.xml @@ -5,12 +5,12 @@ - + - + @@ -178,16 +178,16 @@ - + - + - + @@ -208,7 +208,7 @@ - + @@ -217,12 +217,12 @@ - - '1' if 'header_visible' in main_object and not main_object.header_visible else None + + '1' if main_object and 'header_visible' in main_object and not main_object.header_visible else None - - '1' if 'footer_visible' in main_object and not main_object.footer_visible else None + + '1' if main_object and 'footer_visible' in main_object and not main_object.footer_visible else None diff --git a/addons/theme_chennora/views/pages.xml b/addons/theme_chennora/views/pages.xml index 533b1d0..90eb717 100644 --- a/addons/theme_chennora/views/pages.xml +++ b/addons/theme_chennora/views/pages.xml @@ -5,9 +5,9 @@ -