Add method to format warning name with records
issue10507 review346471002
This commit is contained in:
1 parent
c2dedbf2f8
commit
8cc721b084
1 file changed
+3
-4
+3
-4
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user