diff options
| author | Jairo Llopis <yajo.sk8@gmail.com> | 2016-06-13 13:53:48 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2016-07-12 17:21:50 +0200 |
| commit | ee365bbf98fb1edbc9860c6302bbd8e0d376ef72 (patch) | |
| tree | 48ae04a464d7c60e0a4a2ad4eae310c9d12f6527 /addons/website/static/src/xml/website.contentMenu.xml | |
| parent | d7d07810aa3b567a4258ea97d14aa43ddb49e9c7 (diff) | |
[FIX] modules: choose the right addons path
When launching a server with two similar addons path, e.g.:
- /home/alice/dev
- /home/alice/devodoo
launching the server in dev mode may crash due to the poor matching using
`path.startswith(...)` method which may make `/home/alice/devodoo/bob/main.xml`
match in addons folder `/home/alice/dev` and with a non-exitant local path
`odoo/bob/main.xml`.
Instead of relying on the name, use the `os.path.commonprefix()` method to match
on real paths and avoid partial matching.
commonprefix will only work if the folder name ends with the appropriate
separator (which is not guarantee for a user provided addons-path) so force a
trailing `/` using os.path.join(..., '')`.
Closes #12359
Diffstat (limited to 'addons/website/static/src/xml/website.contentMenu.xml')
0 files changed, 0 insertions, 0 deletions
