[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) <vfe@odoo.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user