From c5f14c3a45548c361a934e01586b6ab73cf18eb5 Mon Sep 17 00:00:00 2001 From: Ronald Portier Date: Thu, 20 Aug 2020 14:19:38 +0200 Subject: [PATCH] [MIG] base_external_system Migration to 13.0 --- base_external_system/__manifest__.py | 4 ++-- base_external_system/models/external_system.py | 5 +---- base_external_system/models/external_system_adapter.py | 8 +------- base_external_system/models/external_system_os.py | 4 +--- base_external_system/readme/CONTRIBUTORS.rst | 1 + base_external_system/views/external_system_view.xml | 1 - 6 files changed, 6 insertions(+), 17 deletions(-) diff --git a/base_external_system/__manifest__.py b/base_external_system/__manifest__.py index acc80c05..ca837198 100644 --- a/base_external_system/__manifest__.py +++ b/base_external_system/__manifest__.py @@ -4,14 +4,14 @@ { "name": "Base External System", "summary": "Data models allowing for connection to external systems.", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "category": "Base", "website": "https://github.com/OCA/server-backend", "author": "LasLabs, " "Odoo Community Association (OCA)", "license": "LGPL-3", "application": False, "installable": True, - "depends": ["base",], + "depends": ["base"], "data": [ "demo/external_system_os_demo.xml", "security/ir.model.access.csv", diff --git a/base_external_system/models/external_system.py b/base_external_system/models/external_system.py index d3e96bd7..7b7acd8a 100644 --- a/base_external_system/models/external_system.py +++ b/base_external_system/models/external_system.py @@ -74,7 +74,6 @@ class ExternalSystem(models.Model): adapter = self.env["external.system.adapter"] return [(m, self.env[m]._description) for m in adapter._inherit_children] - @api.multi @api.constrains("fingerprint", "ignore_fingerprint") def check_fingerprint_ignore_fingerprint(self): """Do not allow a blank fingerprint if not set to ignore.""" @@ -87,7 +86,6 @@ class ExternalSystem(models.Model): ) ) - @api.multi @contextmanager def client(self): """Client object usable as a context manager to include destruction. @@ -107,11 +105,10 @@ class ExternalSystem(models.Model): """Create the interface for the record and assign to ``interface``.""" record = super(ExternalSystem, self).create(vals) if not self.env.context.get("no_create_interface"): - interface = self.env[vals["system_type"]].create({"system_id": record.id,}) + interface = self.env[vals["system_type"]].create({"system_id": record.id}) record.interface = interface return record - @api.multi def action_test_connection(self): """Test the connection to the external system.""" self.ensure_one() diff --git a/base_external_system/models/external_system_adapter.py b/base_external_system/models/external_system_adapter.py index dc44cedf..a1781267 100644 --- a/base_external_system/models/external_system_adapter.py +++ b/base_external_system/models/external_system_adapter.py @@ -24,7 +24,6 @@ class ExternalSystemAdapter(models.AbstractModel): ondelete="cascade", ) - @api.multi @contextmanager def client(self): """Client object usable as a context manager to include destruction. @@ -42,12 +41,10 @@ class ExternalSystemAdapter(models.AbstractModel): finally: self.external_destroy_client(client) - @api.multi def external_get_client(self): """Return a usable client representing the remote system.""" self.ensure_one() - @api.multi def external_destroy_client(self, client): """Perform any logic necessary to destroy the client connection. @@ -57,7 +54,6 @@ class ExternalSystemAdapter(models.AbstractModel): """ self.ensure_one() - @api.multi def external_test_connection(self): """Adapters should override this method, then call super if valid. @@ -72,9 +68,7 @@ class ExternalSystemAdapter(models.AbstractModel): @api.model def create(self, vals): context_self = self.with_context(no_create_interface=True) - vals.update( - {"system_type": self._name,} - ) + vals.update({"system_type": self._name}) record = super(ExternalSystemAdapter, context_self).create(vals) record.system_id.interface = record return record diff --git a/base_external_system/models/external_system_os.py b/base_external_system/models/external_system_os.py index 7e644a71..8ff2a501 100644 --- a/base_external_system/models/external_system_os.py +++ b/base_external_system/models/external_system_os.py @@ -3,7 +3,7 @@ import os -from odoo import api, models +from odoo import models class ExternalSystemOs(models.Model): @@ -19,7 +19,6 @@ class ExternalSystemOs(models.Model): previous_dir = None - @api.multi def external_get_client(self): """Return a usable client representing the remote system.""" super(ExternalSystemOs, self).external_get_client() @@ -28,7 +27,6 @@ class ExternalSystemOs(models.Model): os.chdir(self.system_id.remote_path) return os - @api.multi def external_destroy_client(self, client): """Perform any logic necessary to destroy the client connection. diff --git a/base_external_system/readme/CONTRIBUTORS.rst b/base_external_system/readme/CONTRIBUTORS.rst index 2a95bd4b..5a590489 100644 --- a/base_external_system/readme/CONTRIBUTORS.rst +++ b/base_external_system/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Dave Lasley * Alexandre Díaz +* Ronald Portier diff --git a/base_external_system/views/external_system_view.xml b/base_external_system/views/external_system_view.xml index bbefb00d..ada662a2 100755 --- a/base_external_system/views/external_system_view.xml +++ b/base_external_system/views/external_system_view.xml @@ -97,7 +97,6 @@ External Systems external.system ir.actions.act_window - form tree,form