summaryrefslogtreecommitdiff
path: root/odoo/addons/base/models/ir_fields.py
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-06-04 12:39:11 +0200
committerMartin Trigaux <mat@odoo.com>2020-06-18 13:03:34 +0200
commitba244cef01132347df4d2d9553ea3105ba13a938 (patch)
tree20cdb55afb6b9f700bfe2844a90ca8de0050c941 /odoo/addons/base/models/ir_fields.py
parent3c3b88f6768e31417263b3828a874ca204e29514 (diff)
[IMP] *: replace to new _() syntax
Using a few regex like \((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\) ($1, $3)) Old syntax is still compatible but starts the migration to the new syntax that catches error.
Diffstat (limited to 'odoo/addons/base/models/ir_fields.py')
-rw-r--r--odoo/addons/base/models/ir_fields.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/odoo/addons/base/models/ir_fields.py b/odoo/addons/base/models/ir_fields.py
index dd8375902ea..116e4c9aaa6 100644
--- a/odoo/addons/base/models/ir_fields.py
+++ b/odoo/addons/base/models/ir_fields.py
@@ -207,7 +207,7 @@ class IrFieldsConverter(models.AbstractModel):
ValueError,
_(u"'%s' does not seem to be a valid date for field '%%(field)s'"),
value,
- {'moreinfo': _(u"Use the format '%s'") % u"2012-12-31"}
+ {'moreinfo': _(u"Use the format '%s'", u"2012-12-31")}
)
@api.model
@@ -239,7 +239,7 @@ class IrFieldsConverter(models.AbstractModel):
ValueError,
_(u"'%s' does not seem to be a valid datetime for field '%%(field)s'"),
value,
- {'moreinfo': _(u"Use the format '%s'") % u"2012-12-31 23:59:59"}
+ {'moreinfo': _(u"Use the format '%s'", u"2012-12-31 23:59:59")}
)
input_tz = self._input_tz()# Apply input tz to the parsed naive datetime
@@ -363,7 +363,7 @@ class IrFieldsConverter(models.AbstractModel):
try:
id, _name = RelatedModel.name_create(name=value)
except (Exception, psycopg2.IntegrityError):
- error_msg = _(u"Cannot create new '%s' records from their name alone. Please create those records manually and try importing again.") % RelatedModel._description
+ error_msg = _(u"Cannot create new '%s' records from their name alone. Please create those records manually and try importing again.", RelatedModel._description)
else:
raise self._format_import_error(
Exception,