Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Visit module: manage odoo subdirectories #275

Merged

Conversation

ThomasBinsfeld
Copy link
Contributor

@ThomasBinsfeld ThomasBinsfeld commented Mar 17, 2020

Better way to check whether a path is a path of a subdirectoy of a Odoo module.
Before, '/a/b/cc/d' was considered as a subdirectoy of '/a/b/c' because '/a/b/c' in '/a/b/cc/d' == True.

Now:

os.path.commonprefix(["/a/b/c", "/a/b/cc/d"]) == "/a/b"  # not a subdirectory
os.path.commonprefix(["/a/b/c", "/a/b/c/d"]) == "/a/b/c"  # subdirectory

Copy link
Contributor

@acsonefho acsonefho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code seems ok and seems working!
Good job!

Better way to check whether a path is a path of a subdirectoy of a Odoo module.
Before, '/a/b/cc/d' was considered as a subdirectoy of '/a/b/c' because '/a/b/c' in '/a/b/cc/d' == True
@ThomasBinsfeld ThomasBinsfeld force-pushed the fix_visit_module_odoo_module_subdirectory_tbi branch from 356ed4b to 4bf9c87 Compare March 17, 2020 12:47
@moylop260 moylop260 merged commit bd195b2 into OCA:master Jun 12, 2020
@ThomasBinsfeld ThomasBinsfeld deleted the fix_visit_module_odoo_module_subdirectory_tbi branch June 15, 2020 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants