diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-03-09 16:25:58 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-03-09 16:25:58 +0100 |
| commit | 0f57bdba72b592ca097d4cd3da99a75883d8c623 (patch) | |
| tree | 94eef0c9aaf885c7f717bab5e468ca72b59a219d /addons/base_import_module/models/ir_module.py | |
| parent | 35f0797002e44ce5673e9fab63710d2764329694 (diff) | |
| parent | 42659dc70c2b9b124e7e4fdc0449f660c3de5c76 (diff) | |
[MERGE] forward port branch saas-11.2 up to 42659dc70c2
Diffstat (limited to 'addons/base_import_module/models/ir_module.py')
| -rw-r--r-- | addons/base_import_module/models/ir_module.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/addons/base_import_module/models/ir_module.py b/addons/base_import_module/models/ir_module.py index aaa1e69946a..d9c3d4092a2 100644 --- a/addons/base_import_module/models/ir_module.py +++ b/addons/base_import_module/models/ir_module.py @@ -145,12 +145,13 @@ def _is_studio_custom(path): Returns True if any of the records contains a context with the key studio in it, False if none of the records do """ - path = os.path.join(path, 'data') - filenames = next(iter(os.walk(path)))[2] - filenames = [f for f in filenames if f.lower().endswith('.xml')] + filepaths = [] + for level in os.walk(path): + filepaths += [os.path.join(level[0], fn) for fn in level[2]] + filepaths = [fp for fp in filepaths if fp.lower().endswith('.xml')] - for filename in filenames: - root = lxml.etree.parse(os.path.join(path, filename)).getroot() + for fp in filepaths: + root = lxml.etree.parse(fp).getroot() for record in root: # there might not be a context if it's a non-studio module |
