From 8cc721b0843d358ee9be63c007c7d1a01c325df2 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 --- statement.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/statement.py b/statement.py index ad5938ec69..55175b5846 100644 --- a/statement.py +++ b/statement.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 decimal import Decimal from collections import namedtuple, defaultdict from itertools import groupby @@ -504,9 +503,9 @@ class Statement(Workflow, ModelSQL, ModelView): if l.invoice and l.invoice.state in {'cancelled', 'paid'}) if paid_cancelled_invoice_lines: - warning_key = ('%s.statement_paid_cancelled_invoice_lines' % - hashlib.md5(str(paid_cancelled_invoice_lines).encode( - 'utf-8')).hexdigest()) + warning_key = Warning.format( + 'statement_paid_cancelled_invoice_lines', + paid_cancelled_invoice_lines) if Warning.check(warning_key): raise StatementValidateWarning(warning_key, gettext('account_statement'