Add method to format warning name with records

issue10507
review346471002
This commit is contained in:
Cédric Krier
2021-06-17 09:25:40 +02:00
parent 212181ded1
commit f6e320efd1
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add method to format warning name with records
* Add option to trytond-console to start a readonly transaction
* Add support for werkzeug 2.0
* Combine search and get_keys in DictSchemaMixin
+5
View File
@@ -1011,6 +1011,11 @@ class Warning_(ModelSQL, ModelView):
name = fields.Char('Name', required=True, select=True)
always = fields.Boolean('Always')
@classmethod
def format(cls, name, records):
return '%s.%s' % (
hashlib.md5(str(records).encode('utf-8')).hexdigest(), name)
@classmethod
def check(cls, warning_name):
transaction = Transaction()