Skip to content

Commit

Permalink
[FIX] base_external_system: previous_dir now also property
Browse files Browse the repository at this point in the history
  • Loading branch information
NL66278 committed Oct 22, 2024
1 parent 1ab1dee commit cd60c41
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion base_external_system/models/external_system_adapter_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@ class ExternalSystemAdapterOs(models.AbstractModel):
_inherit = "external.system.adapter"
_description = "External System OS"

previous_dir = None
def get_previous_dir(self):
"""Get previous_dir from adapter_memory."""
return self.env.context["adapter_memory"].get("previous_dir", None)

def set_previous_dir(self, value):
"""Store previous_dir in adapter_memor."""
self.env.context["adapter_memory"]["previous_dir"] = value

def del_previous_dir(self):
"""Get system from environment."""
if "previous_dir" in self.env.context["adapter_memory"]:
del self.env.context["adapter_memory"]["previous_dir"]

previous_dir = property(get_previous_dir, set_previous_dir, del_previous_dir)

@api.model
def external_get_client(self):
Expand Down

0 comments on commit cd60c41

Please sign in to comment.