[FIX] tools: correctly export the non-module translations
8ac39287introdcude a way to export the source terms not located inside an addons module (e.g. error messages in openerp/service/models.py)0529a7f9fixed 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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user