Skip to content
Snippets Groups Projects
Unverified Commit 8f1d889e authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] tools: correctly export the non-module translations

8ac39287 introdcude a way to export the source terms not located inside an
addons module (e.g. error messages in openerp/service/models.py)

0529a7f9 fixed a bug in the get_module_from_path with addons path with similar
names.

The above commit introduced a regression making files located outside of an
addons path to be wrongly considered as a module
e.g. openerp/service/models.py used not to match any module and was considered
correctly as belonging to base module
After, 0529a7f9, '~/openerp/service' being different than '~/openerp/service/'
the module was considered as 'models.py' (which is incorrect).

Compare correctly both parent path to have a correct match

Fixes # 19907
parent 40d4cdd3
Branches
Tags
No related merge requests found
......@@ -958,7 +958,8 @@ def trans_generate(lang, modules, cr):
def get_module_from_path(path):
for (mp, rec) in path_list:
mp = os.path.join(mp, '')
if rec and path.startswith(mp) and os.path.dirname(path) != mp:
dirname = os.path.join(os.path.dirname(path), '')
if rec and path.startswith(mp) and dirname != mp:
path = path[len(mp):]
return path.split(os.path.sep)[0]
return 'base' # files that are not in a module are considered as being in 'base' module
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment