mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-18 04:52:06 +02:00
Fix _NamespacePath concatenation error in file_path function
Convert odoo.addons.__path__ to list before concatenation with [root_path]
to fix TypeError when using Python 3.7+ namespace packages.
Error: unsupported operand type(s) for +: '_NamespacePath' and 'list'
Location: odoo/tools/misc.py:169
Added documentation explaining the fix in docs/PATCH_ADDONS_PATH.md
🤖 assisted by claude
This commit is contained in:
parent
8c653da57a
commit
dd3f495ba4
2 changed files with 49 additions and 1 deletions
|
|
@ -166,7 +166,7 @@ def file_path(file_path, filter_ext=('',), env=None):
|
|||
:raise ValueError: if the file doesn't have one of the supported extensions (`filter_ext`)
|
||||
"""
|
||||
root_path = os.path.abspath(config['root_path'])
|
||||
addons_paths = odoo.addons.__path__ + [root_path]
|
||||
addons_paths = list(odoo.addons.__path__) + [root_path]
|
||||
if env and hasattr(env.transaction, '__file_open_tmp_paths'):
|
||||
addons_paths += env.transaction.__file_open_tmp_paths
|
||||
is_abs = os.path.isabs(file_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue