Files
odoo_source/openerp/modules
Jairo Llopis ee365bbf98 [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
2016-07-12 17:21:50 +02:00
..