From 5c89795e307eb67a95196db6f0c796a39c1a0f42 Mon Sep 17 00:00:00 2001 From: snt Date: Wed, 18 Feb 2026 17:46:38 +0100 Subject: [PATCH] [IMP] website_sale_aplicoop: Fix mandatory translation linting errors - Added self.env._() translation to ValidationError in _check_company_groups - Added self.env._() translation to ValidationError in _check_dates - Replaced f-strings with .format() for proper lazy translation --- website_sale_aplicoop/models/group_order.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/website_sale_aplicoop/models/group_order.py b/website_sale_aplicoop/models/group_order.py index 05f6444..2bfbd9e 100644 --- a/website_sale_aplicoop/models/group_order.py +++ b/website_sale_aplicoop/models/group_order.py @@ -269,8 +269,14 @@ class GroupOrder(models.Model): for group in record.group_ids: if group.company_id and group.company_id != record.company_id: raise ValidationError( - f"Group {group.name} belongs to company " - f"{group.company_id.name}, not to {record.company_id.name}." + self.env._( + "Group {group} belongs to company {group_company}, " + "not to {record_company}." + ).format( + group=group.name, + group_company=group.company_id.name, + record_company=record.company_id.name, + ) ) @api.constrains("start_date", "end_date") @@ -278,7 +284,9 @@ class GroupOrder(models.Model): for record in self: if record.start_date and record.end_date: if record.start_date > record.end_date: - raise ValidationError("Start date cannot be greater than end date") + raise ValidationError( + self.env._("Start date cannot be greater than end date") + ) def action_open(self): """Open order for purchases."""