1- # Copyright NuoBiT Solutions, S.L. (<https://www. nuobit.com>)
2- # Frank Cespedes <fcespedes @nuobit.com>
3- # Eric Antones <eatones @nuobit.com>
1+ # Copyright NuoBiT Solutions - Frank Cespedes <fcespedes@ nuobit.com>
2+ # Copyright NuoBiT Solutions - Eric Antones <eatones @nuobit.com>
3+ # Copyright 2025 NuoBiT Solutions - Deniz Gallo <dgallo @nuobit.com>
44# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
55
6+
67from odoo import _ , api , models
78from odoo .exceptions import ValidationError
89
@@ -21,16 +22,24 @@ def _check_lot_id_by_tracking(self):
2122 if not rec .lot_id and rec .product_id .tracking != "none" :
2223 raise ValidationError (
2324 _ (
24- "The product %s with tracking '%s' only "
25+ "The product %(product_name)s with tracking "
26+ "'%(tracking)s' only "
2527 "can have movements with a lot number."
2628 )
27- % (rec .product_id .display_name , tracking_label )
29+ % {
30+ "product_name" : rec .product_id .display_name ,
31+ "tracking" : tracking_label ,
32+ }
2833 )
2934 if rec .lot_id and rec .product_id .tracking == "none" :
3035 raise ValidationError (
3136 _ (
32- "The product %s with tracking '%s' only "
37+ "The product %(product_name)s with tracking "
38+ "'%(tracking)s' only "
3339 "can have movements without a lot number."
3440 )
35- % (rec .product_id .display_name , tracking_label )
41+ % {
42+ "product_name" : rec .product_id .display_name ,
43+ "tracking" : tracking_label ,
44+ }
3645 )
0 commit comments