From 7efc02a6568840482014b0e3fb3af781e0691b4a Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Wed, 6 May 2026 14:24:51 +0700 Subject: [PATCH] fix: prepend absolute base URL to rating links using new helper method in helpdesk ticket --- data/mail_templates.xml | 10 +++++----- models/helpdesk_ticket.py | 12 ++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/data/mail_templates.xml b/data/mail_templates.xml index 67a32ec..5edcd49 100755 --- a/data/mail_templates.xml +++ b/data/mail_templates.xml @@ -41,31 +41,31 @@
- +
Poor
- +
Fair
- +
Good
- +
Very Good
- +
Excellent
diff --git a/models/helpdesk_ticket.py b/models/helpdesk_ticket.py index 6bfdaab..184e781 100755 --- a/models/helpdesk_ticket.py +++ b/models/helpdesk_ticket.py @@ -12,6 +12,18 @@ class HelpdeskTicket(models.Model): help='HTML representation of rating stars' ) + def get_base_url(self): + """ + Returns the base URL for the current record, prioritizing the domain + of the website associated with the helpdesk team. + """ + self.ensure_one() + # Check if website_id exists on team_id (added by website_helpdesk) + # and if it has a domain configured. + if 'website_id' in self.team_id._fields and self.team_id.website_id.domain: + return self.team_id.website_id.domain.rstrip('/') + return super().get_base_url() + @api.depends('rating_ids', 'rating_ids.rating', 'rating_ids.create_date', 'rating_count') def _compute_rating_stars_html(self): """Compute HTML representation of rating stars"""