mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: import json for similar_ids
And small fix in fstring.
This commit is contained in:
parent
03a20398a1
commit
a2afd57149
@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -686,9 +687,9 @@ class ErrorQualifyRegex(models.Model):
|
|||||||
for field in list(re.compile(rec.regex).groupindex.keys()):
|
for field in list(re.compile(rec.regex).groupindex.keys()):
|
||||||
existing = self.env['ir.model.fields'].search([('model', '=', 'runbot.build.error.content'), ('name', '=', f'x_{field}')])
|
existing = self.env['ir.model.fields'].search([('model', '=', 'runbot.build.error.content'), ('name', '=', f'x_{field}')])
|
||||||
if existing:
|
if existing:
|
||||||
_logger.info(f"Field x_%s already exists", field)
|
_logger.info("Field x_%s already exists", field)
|
||||||
else:
|
else:
|
||||||
_logger.info(f"Creating field x_%s", field)
|
_logger.info("Creating field x_%s", field)
|
||||||
self.env['ir.model.fields'].create({
|
self.env['ir.model.fields'].create({
|
||||||
'model_id': self.env['ir.model']._get('runbot.build.error.content').id,
|
'model_id': self.env['ir.model']._get('runbot.build.error.content').id,
|
||||||
'name': f'x_{field}',
|
'name': f'x_{field}',
|
||||||
|
Loading…
Reference in New Issue
Block a user