camptocamp / pytest-odoo

pytest plugin to run Odoo tests
GNU Affero General Public License v3.0
68 stars 44 forks source link

Fix module name when custom modules are under default odoo addons folder #29

Closed lck closed 5 years ago

lck commented 5 years ago

Hi, We have custom modules installed under ./addons folder together with default odoo modules. This fixes the invalid module path with duplicated "addons.addons": Invalid name "openerp.addons.addons.xyz_mod" becomes "openerp.addons.xyz_mod" Thanks R.

guewen commented 5 years ago

Thanks for contributing. I wonder what is the reason to use a sub-package addons in the addons package though. Are you able to import your custom addons from Odoo's code? (there is no special code to handle this use case in odoo's import system AFAIK) MO you should probably change your files organization.

lck commented 5 years ago

Hi, I understand that this is not a good practice, but the decission about the project structure was not mine, and I can not change it, this is why I had to fix the module path. On the other hand, this fix enables to run the buildin odoo modules tests in ./addons folder.

guewen commented 5 years ago

On the other hand, this fix enables to run the buildin odoo modules tests in ./addons folder.

Do you mean the core addons? If so, there are already supported, we don't need any change.

I'm sorry, but I can't include a change to support a disputable structure.