[MIG] base_external_system: Migration to 16.0

This commit is contained in:
ntsirintanis
2023-02-06 16:34:30 +01:00
parent b330ddba76
commit 14666c8c5b
7 changed files with 31 additions and 17 deletions

View File

@@ -65,10 +65,13 @@ class ExternalSystemAdapter(models.AbstractModel):
"""
raise UserError(_("The connection was a success."))
@api.model
def create(self, vals):
@api.model_create_multi
def create(self, vals_list):
context_self = self.with_context(no_create_interface=True)
vals.update({"system_type": self._name})
record = super(ExternalSystemAdapter, context_self).create(vals)
record.system_id.interface = record
return record
records = self.browse([])
for vals in vals_list:
vals.update({"system_type": self._name})
record = super(ExternalSystemAdapter, context_self).create(vals)
record.system_id.interface = record
records += record
return records