From 9fa7e4eba41d66d2be5c5a6588a4eea9d41d3472 Mon Sep 17 00:00:00 2001 From: Martinez Julien Date: Wed, 15 Jul 2026 14:49:41 +0200 Subject: [PATCH] [FIX] mail_brand: typo in get_base_url (website_website_id -> website_id) Fixes AttributeError: 'res.brand' object has no attribute 'website_website_id' when sending an email/message from a document linked to a brand. Also add a defensive check on website_id.domain: when the brand's website_id is set but the linked website has no domain configured (e.g. the brand's actual website is hosted outside Odoo, so website_id is left empty), get_base_url() now falls back to the default base URL instead of raising a TypeError (unsupported operand type(s) for +: 'bool' and 'str'). Closes #287 --- mail_brand/models/ir_model.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mail_brand/models/ir_model.py b/mail_brand/models/ir_model.py index 0e38a1123..78628d453 100644 --- a/mail_brand/models/ir_model.py +++ b/mail_brand/models/ir_model.py @@ -10,7 +10,11 @@ class BaseModel(models.AbstractModel): 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 + if ( + "brand_id" in self + and "website_id" in self.brand_id + and self.brand_id.website_id.domain + ): + return self.brand_id.website_id.domain else: return super().get_base_url()