Skip to content

Commit c08ae62

Browse files
committed
[FIX] server: allow odoo and addon paths to end with a /
Ending the path to odoo or to any addon path with a / should not make the extension crash or unable to detect the workspace.
1 parent 2a94ce4 commit c08ae62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/core/odoo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def initialize(ls:LanguageServer = None):
160160
# add stubs for not installed packages
161161
Odoo.instance.grammar = parso.load_grammar()
162162
Odoo.instance.start_build_time = time.time()
163-
Odoo.instance.odooPath = odooConfig.odooPath
163+
Odoo.instance.odooPath = odooConfig.odooPath.rstrip('/')
164164
if os.name == "nt":
165165
Odoo.instance.odooPath = Odoo.instance.odooPath[0].capitalize() + Odoo.instance.odooPath[1:]
166166
Odoo.instance.load_builtins(ls)
@@ -248,7 +248,8 @@ def build_base(self, ls, used_config):
248248
else:
249249
ls.show_message_log("Odoo addons not found at " + os.path.join(self.odooPath, "addons"), MessageType.Error)
250250
return False
251-
addonsSymbol.paths += used_config.addons
251+
for addon in used_config.addons:
252+
addonsSymbol.paths.append(addon.rstrip('/'))
252253
return True
253254
else:
254255
ls.show_message_log("Odoo not found at " + self.odooPath, MessageType.Error)

0 commit comments

Comments
 (0)