changeset cb8e5f799999 in modules/account_payment:default
details: 
https://hg.tryton.org/modules/account_payment?cmd=changeset&node=cb8e5f799999
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 9feb4c7497a0 -r cb8e5f799999 account.py
--- a/account.py        Fri May 28 09:06:51 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 decimal import Decimal
 
 from sql import Null
@@ -268,9 +267,8 @@
                         continue
                     lines = [l for l in types[kind]['lines']
                         if l.party == party]
-                    warning_name = '%s:%s:%s' % (
-                        reverse[kind], party,
-                        hashlib.md5(str(lines).encode('utf-8')).hexdigest())
+                    warning_name = Warning.format(
+                        '%s:%s' % (reverse[kind], party), lines)
                     if Warning.check(warning_name):
                         names = ', '.join(l.rec_name for l in lines[:5])
                         if len(lines) > 5:

Reply via email to