changeset 7efdcedc37a0 in modules/account_tax_cash:default
details: 
https://hg.tryton.org/modules/account_tax_cash?cmd=changeset&node=7efdcedc37a0
description:
        Add method to format warning name with records

        issue10507
        review346471002
diffstat:

 account.py |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (22 lines):

diff -r 9e5452dc4a29 -r 7efdcedc37a0 account.py
--- a/account.py        Mon May 03 15:52:17 2021 +0200
+++ b/account.py        Thu Jun 17 09:25:40 2021 +0200
@@ -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 collections import defaultdict
 from itertools import groupby
 
@@ -71,9 +70,8 @@
                             ],
                         ])
                 if move_lines:
-                    warning_name = (
-                        'period_close_line_payment.%s' % hashlib.md5(
-                            str(move_lines).encode('utf-8')).hexdigest())
+                    warning_name = Warning.format(
+                        'period_close_line_payment', move_lines)
                     if Warning.check(warning_name):
                         raise ClosePeriodWarning(warning_name,
                             gettext('account_tax_cash'

Reply via email to