Remove temporary debug scripts and add .gitignore to prevent future commits of similar files.
This commit is contained in:
parent
e1a84ff327
commit
2f9eef9536
60
.gitignore
vendored
Normal file
60
.gitignore
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
# Python artifacts
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# Odoo artifacts
|
||||
*.log
|
||||
odoo.conf
|
||||
/data/
|
||||
/filestore/
|
||||
/sessions/
|
||||
|
||||
# OS artifacts
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
|
||||
# IDEs
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# Debug/Temp scripts found in project
|
||||
inspect_*.py
|
||||
dump_*.py
|
||||
debug_*.py
|
||||
read_arch.py
|
||||
resolve_homepage.py
|
||||
fix_homepage.py
|
||||
force_inherit.py
|
||||
txt.py
|
||||
update_error.txt
|
||||
update_log.txt
|
||||
addons/*.png
|
||||
|
||||
# Local config/environment
|
||||
.env
|
||||
.venv
|
||||
docker-compose.override.yml
|
||||
@ -1,38 +0,0 @@
|
||||
from odoo import env
|
||||
|
||||
def check_about_views():
|
||||
# Find the main About Us view
|
||||
about_view = env.ref('website.aboutus', raise_if_not_found=False)
|
||||
if not about_view:
|
||||
print("CRITICAL: 'website.aboutus' view not found!")
|
||||
return
|
||||
|
||||
print(f"Base View: {about_view.name} (ID: {about_view.id}, Key: {about_view.key})")
|
||||
print(f"Arch Updated: {about_view.arch_updated}")
|
||||
|
||||
# Check for specific views affecting this
|
||||
views = env['ir.ui.view'].search([('key', '=', 'website.aboutus')])
|
||||
for v in views:
|
||||
print(f"Found View with key='website.aboutus': {v.name} (ID: {v.id}, Model: {v.model}) - Active: {v.active}")
|
||||
|
||||
# Check for inheriting views
|
||||
inheriting_views = env['ir.ui.view'].search([('inherit_id', '=', about_view.id)])
|
||||
print(f"\nInheriting Views ({len(inheriting_views)}):")
|
||||
for v in inheriting_views:
|
||||
print(f" - {v.name} (ID: {v.id}, Key: {v.key}, Priority: {v.priority}) - Active: {v.active}")
|
||||
|
||||
# Check if there is a specific page record
|
||||
page = env['website.page'].search([('url', '=', '/aboutus')])
|
||||
if page:
|
||||
print(f"\nPage '/aboutus' found: {page.name} (View ID: {page.view_id.id})")
|
||||
if page.view_id != about_view:
|
||||
print(f"WARNING: Page is using a different view: {page.view_id.name} (ID: {page.view_id.id}, Key: {page.view_id.key})")
|
||||
else:
|
||||
print("\nPage '/aboutus' NOT found in website.page!")
|
||||
|
||||
# Check /about just in case
|
||||
page_custom = env['website.page'].search([('url', '=', '/about')])
|
||||
if page_custom:
|
||||
print(f"\nPage '/about' found: {page_custom.name} (View ID: {page_custom.view_id.id})")
|
||||
|
||||
check_about_views()
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
@ -1,48 +0,0 @@
|
||||
|
||||
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('dine360_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 'dine360_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()
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
v = env['ir.ui.view'].browse(3221)
|
||||
with open('/mnt/extra-addons/dine360_theme_chennora/view_3221.xml', 'w') as f:
|
||||
f.write(str(v.arch_db))
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
|
||||
import logging
|
||||
from odoo import http, tools, _
|
||||
from odoo.http import request
|
||||
|
||||
def check_render(dbname):
|
||||
try:
|
||||
registry = odoo.registry(dbname)
|
||||
with registry.cursor() as cr:
|
||||
env = odoo.api.Environment(cr, odoo.SUPERUSER_ID, {})
|
||||
# Try to render the contactus page view
|
||||
# Typically 'website.contactus' is the template
|
||||
print("Attempting to render website.contactus...")
|
||||
try:
|
||||
view_id = env.ref('website.contactus')
|
||||
print(f"View ID: {view_id.id}")
|
||||
# We need a website context
|
||||
website = env['website'].browse(1)
|
||||
|
||||
# Mock request object if needed, or just use context
|
||||
# Rendering view directly
|
||||
arch = env['ir.ui.view']._render_template(view_id.id, {'main_object': view_id})
|
||||
print("Render SUCCESS (length: {})".format(len(arch)))
|
||||
except Exception as e:
|
||||
print("Render FAILED:")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
print("-" * 20)
|
||||
print("Checking for broken XPaths specifically on this view inheritance...")
|
||||
# List inherited views
|
||||
for inherit in view_id.inherit_children_ids:
|
||||
print(f"Child View: {inherit.id} {inherit.name} (Active: {inherit.active})")
|
||||
|
||||
except Exception as e:
|
||||
print(f"General failure: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_render('FOODIES-DELIGHT')
|
||||
18
dump_view.py
18
dump_view.py
@ -1,18 +0,0 @@
|
||||
|
||||
print("--- DUMPING THEME VIEW ---")
|
||||
try:
|
||||
theme_view = env.ref('dine360_theme_chennora.custom_homepage')
|
||||
print(f"Name: {theme_view.name}")
|
||||
print(f"ID: {theme_view.id}")
|
||||
print(f"Type: {theme_view.type}")
|
||||
print(f"Mode: {theme_view.mode}")
|
||||
print(f"Active: {theme_view.active}")
|
||||
print(f"Priority: {theme_view.priority}")
|
||||
print(f"Inherit ID: {theme_view.inherit_id.id if theme_view.inherit_id else 'None'}")
|
||||
print(f"Website ID: {theme_view.website_id.id if theme_view.website_id else 'None'}")
|
||||
print(f"Key: {theme_view.key}")
|
||||
print("Arch Snippet:")
|
||||
print(theme_view.arch[:200])
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
|
||||
print("--- STARTING HOMEPAGE REPAIR ---")
|
||||
try:
|
||||
website = env['website'].get_current_website()
|
||||
print(f"Target Website: {website.name}")
|
||||
|
||||
# 1. Find and Archive COW (Customized) Homepage Views
|
||||
# These are usually created when you 'Edit' the homepage in the UI.
|
||||
# They shadow the underlying theme/generic view.
|
||||
cow_views = env['ir.ui.view'].search([
|
||||
('key', '=', 'website.homepage'),
|
||||
('website_id', '=', website.id),
|
||||
('type', '=', 'qweb')
|
||||
])
|
||||
|
||||
if cow_views:
|
||||
print(f"Found {len(cow_views)} Blocking Custom View(s). Archiving them...")
|
||||
for cv in cow_views:
|
||||
print(f" -> Archiving View: {cv.name} (ID: {cv.id})")
|
||||
cv.write({'active': False, 'key': cv.key + '.archived.' + str(cv.id)}) # Change key to stop it from matching
|
||||
else:
|
||||
print("No Blocking Custom Views (COW) found.")
|
||||
|
||||
# 2. Ensure Theme View is Active
|
||||
theme_view = env.ref('dine360_theme_chennora.custom_homepage', raise_if_not_found=False)
|
||||
if theme_view:
|
||||
print(f"Theme View found: {theme_view.name}")
|
||||
if not theme_view.active:
|
||||
theme_view.write({'active': True})
|
||||
print(" -> Activated Theme View")
|
||||
else:
|
||||
print(" -> Theme View is already active")
|
||||
|
||||
# Optional: Force priority check
|
||||
if theme_view.priority < 50:
|
||||
theme_view.write({'priority': 50})
|
||||
print(" -> Enforced Priority 50")
|
||||
|
||||
else:
|
||||
print("ERROR: Theme View 'dine360_theme_chennora.custom_homepage' NOT FOUND. Please upgrade the module.")
|
||||
|
||||
env.cr.commit()
|
||||
print("--- REPAIR COMPLETE. PLEASE REFRESH HOMEPAGE ---")
|
||||
|
||||
except Exception as e:
|
||||
print(f"ERROR: {e}")
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
|
||||
print("--- FORCING INHERITANCE ---")
|
||||
try:
|
||||
# 1. Get the Generic Homepage
|
||||
homepage = env.ref('website.homepage')
|
||||
print(f"Generic Homepage: {homepage.name} (ID: {homepage.id})")
|
||||
|
||||
# 2. Get the Theme View
|
||||
theme_view = env.ref('dine360_theme_chennora.custom_homepage', raise_if_not_found=False)
|
||||
|
||||
if not theme_view:
|
||||
print("Theme view not found by XMLID! Searching by name...")
|
||||
theme_view = env['ir.ui.view'].search([('name', '=', 'Chennora Homepage')], limit=1)
|
||||
|
||||
if theme_view:
|
||||
print(f"Theme View Found: {theme_view.name} (ID: {theme_view.id})")
|
||||
print(f" - Current Inherit ID: {theme_view.inherit_id.id if theme_view.inherit_id else 'None'}")
|
||||
print(f" - Current Active: {theme_view.active}")
|
||||
print(f" - Current Mode: {theme_view.mode}")
|
||||
|
||||
# 3. FORCE UPDATES
|
||||
theme_view.write({
|
||||
'inherit_id': homepage.id,
|
||||
'active': True,
|
||||
'mode': 'extension',
|
||||
'priority': 50
|
||||
})
|
||||
print(" -> UPDATED: Assigned inherit_id, Active=True, Mode=extension")
|
||||
|
||||
else:
|
||||
print("CRITICAL ERROR: Theme view could not be found via XMLID or Name.")
|
||||
|
||||
env.cr.commit()
|
||||
print("--- FIX COMPLETE ---")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
|
||||
print("--- INSPECTING HOMEPAGE VIEWS ---")
|
||||
try:
|
||||
website = env['website'].get_current_website()
|
||||
print(f"Current Website: {website.name} (ID: {website.id})")
|
||||
|
||||
# Check what view is being used for homepage
|
||||
homepage_view = website.homepage_id or env.ref('website.homepage')
|
||||
print(f"Homepage View: {homepage_view.name} (ID: {homepage_view.id}, Key: {homepage_view.key})")
|
||||
print(f"Active: {homepage_view.active}")
|
||||
|
||||
# Check inheritance
|
||||
print("Inherited Views:")
|
||||
for view in homepage_view.inherit_children_ids:
|
||||
print(f" - {view.name} (ID: {view.id}, Key: {view.key}, Active: {view.active}, Priority: {view.priority})")
|
||||
if 'chennora' in view.key:
|
||||
print(" ^^^ THIS IS YOUR THEME VIEW")
|
||||
|
||||
# Check for COW views (Specific views for this website that override the generic one)
|
||||
cow_views = env['ir.ui.view'].search([
|
||||
('key', '=', homepage_view.key),
|
||||
('website_id', '=', website.id),
|
||||
('type', '=', 'qweb')
|
||||
])
|
||||
|
||||
if cow_views:
|
||||
print("\nFound COW Views (Customized overrides):")
|
||||
for cv in cow_views:
|
||||
print(f" - {cv.name} (ID: {cv.id}, Active: {cv.active})")
|
||||
print(" ARCH Content (first 100 chars):")
|
||||
print(f" {cv.arch[:100]}...")
|
||||
|
||||
# Check if our theme view is actually in the db
|
||||
theme_view = env.ref('dine360_theme_chennora.custom_homepage', raise_if_not_found=False)
|
||||
if theme_view:
|
||||
print(f"\nTheme View Record: {theme_view.name} (ID: {theme_view.id}, Active: {theme_view.active}, Priority: {theme_view.priority})")
|
||||
else:
|
||||
print("\nTheme View 'dine360_theme_chennora.custom_homepage' NOT FOUND in DB.")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
|
||||
print("--- INSPECTING HOMEPAGE VIEWS (V2) ---")
|
||||
try:
|
||||
website = env['website'].get_current_website()
|
||||
print(f"Current Website: {website.name} (ID: {website.id})")
|
||||
|
||||
# Standard Odoo Homepage View
|
||||
generic_homepage_view = env.ref('website.homepage')
|
||||
print(f"Generic Homepage View: {generic_homepage_view.name} (ID: {generic_homepage_view.id})")
|
||||
|
||||
# Check for COW views (Specific views for this website that override the generic one)
|
||||
# COW views usually have the same key but a specific website_id
|
||||
cow_views = env['ir.ui.view'].search([
|
||||
('key', '=', 'website.homepage'),
|
||||
('website_id', '=', website.id)
|
||||
])
|
||||
|
||||
if cow_views:
|
||||
print(f"\n[!] WARNING: Found {len(cow_views)} COW (Customized) Views for this website.")
|
||||
for cv in cow_views:
|
||||
print(f" - View Name: {cv.name} (ID: {cv.id}, Active: {cv.active}, Priority: {cv.priority})")
|
||||
print(f" Mode: {cv.mode}")
|
||||
print(f" Inherit ID: {cv.inherit_id.name if cv.inherit_id else 'None'}")
|
||||
print(" This view is likely BLOCKING your theme changes.")
|
||||
|
||||
# Check our theme view
|
||||
theme_view = env.ref('dine360_theme_chennora.custom_homepage', raise_if_not_found=False)
|
||||
if theme_view:
|
||||
print(f"\nTheme View Record: {theme_view.name} (ID: {theme_view.id})")
|
||||
print(f" - Active: {theme_view.active}")
|
||||
print(f" - Priority: {theme_view.priority}")
|
||||
print(f" - Inherit ID: {theme_view.inherit_id.name if theme_view.inherit_id else 'None'}")
|
||||
|
||||
# Check if it is applied
|
||||
if theme_view.id in generic_homepage_view.inherit_children_ids.ids:
|
||||
print(" - Theme View IS in the inheritance tree of the generic homepage.")
|
||||
else:
|
||||
print(" - Theme View is NOT in the inheritance tree of the generic homepage.")
|
||||
|
||||
# If COW view exists, check if theme view is inherited by the COW view?
|
||||
# Usually COW views replace the whole structure or inherit from the generic one but ignore other inherits if not careful.
|
||||
else:
|
||||
print("\n[!] ERROR: Theme View 'dine360_theme_chennora.custom_homepage' NOT FOUND in DB.")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
30
read_arch.py
30
read_arch.py
@ -1,30 +0,0 @@
|
||||
|
||||
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}")
|
||||
@ -1,27 +0,0 @@
|
||||
|
||||
print("--- RESOLVING HOMEPAGE ---")
|
||||
try:
|
||||
website = env['website'].get_current_website()
|
||||
print(f"Current Website: {website.name} (ID: {website.id})")
|
||||
|
||||
# Resolve the view as Odoo does during rendering
|
||||
resolved_view = website.viewref('website.homepage')
|
||||
print(f"Resolved Homepage View: {resolved_view.name} (ID: {resolved_view.id}, Key: {resolved_view.key})")
|
||||
print(f" - Website ID of View: {resolved_view.website_id.id}")
|
||||
|
||||
generic_view = env.ref('website.homepage')
|
||||
print(f"Generic View ID: {generic_view.id}")
|
||||
|
||||
if resolved_view.id != generic_view.id:
|
||||
print("!!! ALERT: Output resolves to a DIFFERENT view than the generic one. !!!")
|
||||
print("This is a COW view masking your theme.")
|
||||
print("Archiving this masking view now...")
|
||||
resolved_view.write({'active': False, 'key': resolved_view.key + '.archived'})
|
||||
print(" -> Archived masking view.")
|
||||
else:
|
||||
print("Resolved view IS the generic view.")
|
||||
|
||||
env.cr.commit()
|
||||
print("--- CHECK COMPLETE ---")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
BIN
update_error.txt
BIN
update_error.txt
Binary file not shown.
BIN
update_log.txt
BIN
update_log.txt
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user