Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3882 Vizualizări

I want to run coverage test for my odoo module in docker, but I get the error. 

first I run coverage test with command in docker :

coverage run /usr/bin/odoo -d odoo --db_host=db --db_user=odoo --db_password=odoo --stop-after-init --test-enable --init "My Library"


and the result :

Traceback (most recent call last):

    file "/usr/bin/odoo", line 5, in <module>

        import odoo

impostError: No module named odoo



what I should do?

Imagine profil
Abandonează
Cel mai bun răspuns

Hello,

You need to add odoo path on environment variables.

  1. Locate the directory containing Odoo, e.g., /path/to/odoo.

  2. Add the Odoo directory to the PYTHONPATH environment variable by running the following command:

    PYTHONPATH=$PYTHONPATH:/path/to/odoo
    

    Replace /path/to/odoo with the actual path to the Odoo directory on your system.

  3. To make this change permanent, add the command above to your shell profile file (.bashrc, .bash_profile, or .zshrc, depending on the shell you use). Open the profile file with a text editor, add the command at the end of the file, and save the changes.


Or you can use Pycharm with "env"

Configure a Python interpreter | PyCharm Documentation (jetbrains.com)


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iul. 25
2149
2
iul. 25
7657
2
iul. 25
4084
2
iul. 25
3830
2
iun. 25
2436