Bug Description
The get_base_url method in mail_brand has a typo that causes an AttributeError when sending emails or messages.
Error:
AttributeError: 'res.brand' object has no attribute 'website_website_id'. Did you mean: 'website_message_ids'?
File: mail_brand/models/ir_model.py, line 14
Current Code (broken)
def get_base_url(self):
if not self:
return super().get_base_url()
if "brand_id" in self and "website_id" in self.brand_id:
return self.brand_id.website_website_id.domain # <-- typo: website_website_id
else:
return super().get_base_url()
Proposed Fix
def get_base_url(self):
if not self:
return super().get_base_url()
if "brand_id" in self and "website_id" in self.brand_id:
return self.brand_id.website_id.domain # <-- fix: website_id
else:
return super().get_base_url()
Environment
- Odoo version: 18.0
brand repository: 18.0 branch (as of 2025-12-18, no fix in repo)