[MIG] base_external_system: Migration to 15.0

This commit is contained in:
Cesar Andres Sanchez
2022-07-14 00:00:17 +02:00
committed by Pedro M. Baeza
parent 2f3f56d476
commit f46233eb16
5 changed files with 14 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
{ {
"name": "Base External System", "name": "Base External System",
"summary": "Data models allowing for connection to external systems.", "summary": "Data models allowing for connection to external systems.",
"version": "13.0.1.0.0", "version": "15.0.1.0.0",
"category": "Base", "category": "Base",
"website": "https://github.com/OCA/server-backend", "website": "https://github.com/OCA/server-backend",
"author": "LasLabs, " "Odoo Community Association (OCA)", "author": "LasLabs, " "Odoo Community Association (OCA)",

View File

@@ -23,7 +23,7 @@ class ExternalSystemOs(models.Model):
"""Return a usable client representing the remote system.""" """Return a usable client representing the remote system."""
super(ExternalSystemOs, self).external_get_client() super(ExternalSystemOs, self).external_get_client()
if self.system_id.remote_path: if self.system_id.remote_path:
self.previous_dir = os.getcwd() ExternalSystemOs.previous_dir = os.getcwd()
os.chdir(self.system_id.remote_path) os.chdir(self.system_id.remote_path)
return os return os
@@ -34,7 +34,8 @@ class ExternalSystemOs(models.Model):
client (mixed): The client that was returned by client (mixed): The client that was returned by
``external_get_client``. ``external_get_client``.
""" """
super(ExternalSystemOs, self).external_destroy_client(client) result = super(ExternalSystemOs, self).external_destroy_client(client)
if self.previous_dir: if ExternalSystemOs.previous_dir:
os.chdir(self.previous_dir) os.chdir(ExternalSystemOs.previous_dir)
self.previous_dir = None ExternalSystemOs.previous_dir = None
return result

View File

@@ -1,3 +1,6 @@
* Dave Lasley <dave@laslabs.com> * Dave Lasley <dave@laslabs.com>
* Alexandre Díaz <alexandre.diaz@tecnativa.com>
* Ronald Portier <ronald@therp.nl> * Ronald Portier <ronald@therp.nl>
* `Tecnativa <https://www.tecnativa.com>`__:
* Alexandre Díaz
* César A. Sánchez

View File

@@ -16,8 +16,9 @@ class TestExternalSystemOs(Common):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
"""Set the working dir back to origin, just in case.""" """Set the working dir back to origin, just in case."""
super(TestExternalSystemOs, cls).tearDownClass() result = super(TestExternalSystemOs, cls).tearDownClass()
os.chdir(cls.working_dir) os.chdir(cls.working_dir)
return result
def setUp(self): def setUp(self):
super(TestExternalSystemOs, self).setUp() super(TestExternalSystemOs, self).setUp()

View File

@@ -53,7 +53,7 @@
<field name="name">external.system.view.tree</field> <field name="name">external.system.view.tree</field>
<field name="model">external.system</field> <field name="model">external.system</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="External Systems"> <tree>
<field name="name" /> <field name="name" />
<field name="host" /> <field name="host" />
<field name="port" /> <field name="port" />