From be44edbd6083dde77c84427baa2de686943c6355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 17 Jun 2021 09:25:40 +0200 Subject: [PATCH] Add method to format warning name with records issue10507 review346471002 --- production.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/production.py b/production.py index 1d5d42a00a..45ddc58174 100644 --- a/production.py +++ b/production.py @@ -1,6 +1,5 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import hashlib from itertools import groupby from trytond.i18n import gettext @@ -234,8 +233,7 @@ class Production(metaclass=PoolMeta): names = ', '.join(p.rec_name for p in productions[:5]) if len(pendings) > 5: names += '...' - warning_name = '%s.pending_purchase.done' % hashlib.md5( - str(pendings).encode('utf-8')).hexdigest() + warning_name = Warning.format('pending_purchase.done', pendings) if Warning.check(warning_name): raise PurchaseWarning( warning_name,