From fa1decdc53b86d2017665ab73c9eadf49af91fbb Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Wed, 17 Mar 2021 14:36:21 +0000 Subject: [PATCH] [FIX] sale_project: clearer error message The error message raised when linking a wrong SOline and a task used unclear/incomplete information. This commit improves the displayed message, replacing: * the SO id by the SO reference, since record ids are not really useful to end users. * the product name by its display name, to include variants details. closes odoo/odoo#68041 X-original-commit: 8db6e654a50d38001c42247b33392aad90cab821 Signed-off-by: Victor Feyens (vfe) --- addons/sale_project/models/project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_project/models/project.py b/addons/sale_project/models/project.py index 8a463260bc5..2e30ae70eca 100644 --- a/addons/sale_project/models/project.py +++ b/addons/sale_project/models/project.py @@ -84,8 +84,8 @@ class ProjectTask(models.Model): if not task.sale_line_id.is_service or task.sale_line_id.is_expense: raise ValidationError(_( 'You cannot link the order item %(order_id)s - %(product_id)s to this task because it is a re-invoiced expense.', - order_id=task.sale_line_id.order_id.id, - product_id=task.sale_line_id.product_id.name, + order_id=task.sale_line_id.order_id.name, + product_id=task.sale_line_id.product_id.display_name, )) @api.ondelete(at_uninstall=False)