mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_m2x_options_manager: Migration to 15.0
- Fix postprocess inherit (removed from v15), and use _postprocess_tag_field for create/edit options: In v14 it worked with inheriting the "postprocess" method because in each recursive call it passed a section of the view, in the way that it went through all the child nodes of the root node, and passed through the fields, and now in v15 the method "_postprocess_view "it just does the while, and we never go through the nodes. - Fix pylint errors: xml-deprecated-tree-attributte, attribute-string-redundant, translation-positional-used
This commit is contained in:
@@ -36,7 +36,6 @@ class M2xCreateEditOption(models.Model):
|
||||
compute="_compute_model_name",
|
||||
inverse="_inverse_model_name",
|
||||
store=True,
|
||||
string="Model Name",
|
||||
)
|
||||
|
||||
option_create = fields.Selection(
|
||||
@@ -125,8 +124,12 @@ class M2xCreateEditOption(models.Model):
|
||||
def _check_field_in_model(self):
|
||||
for opt in self:
|
||||
if opt.field_id.model_id != opt.model_id:
|
||||
msg = _("'%s' is not a valid field for model '%s'!")
|
||||
raise ValidationError(msg % (opt.field_name, opt.model_name))
|
||||
msg = _(
|
||||
"%(field)s is not a valid field for model %(model)s!",
|
||||
field=opt.field_name,
|
||||
model=opt.model_name,
|
||||
)
|
||||
raise ValidationError(msg)
|
||||
|
||||
@api.constrains("field_id")
|
||||
def _check_field_type(self):
|
||||
|
||||
Reference in New Issue
Block a user