Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Odoo development on Docker

I'm trying to use docker for odoo module developement. I have the following docker-compose.yml file

db:
  image: postgres
  environment:
    POSTGRES_USER: odoo
    POSTGRES_PASSWORD: odoo
  volumes:
    - data:/var/lib/postgresql/data/

odoo:
  image: odoo
  links:
    - db:db
  ports:
    - "127.0.0.1:8069:8069"
  volumes:
    - extra-addons:/mnt/extra-addons
  command: -- --update=tutorial

The module contains only an __openerp__.py file but odoo doesn't show the changes I make to it even with --update=tutorial option

{
    'name': "tutorial",

    'summary': """Hello world!!""",

    'description': """
        This is the new description
    """,

    'author': "ybouhjira",
    'website': "ybouhjira.com",

    'category': 'Technical Settings',
    'version': '0.1',
    'depends': ["base"],
}

this file is in a folder named tutorial located in extra-addons, and I tried stop and starting the containers even removing and recreating them.

like image 605
Youssef Bouhjira Avatar asked Aug 05 '15 12:08

Youssef Bouhjira


2 Answers

Like shodowsjedi already said, you need to create a __init__.py file (see module structure : https://www.odoo.com/documentation/8.0/howtos/backend.html#module-structure ).

Also, check permissions in your odoo containers, your files in the odoo volume will have uid and gid of your system (the host) in the container (that can be associated to a different user). To check this you can use docker exec :

docker exec docker_odoo_1 ls -la /mnt/extra-addons

If you don't know the docker name of your container you can retrieve it by using :

docker-compose ps

Last and probably the most important one, check odoo logs by using :

docker-compose logs

and update your module in the configuration page of Odoo (or at the startup of the server)

like image 165
Vorex Avatar answered Nov 16 '22 00:11

Vorex


You have to add own config file. first in docker-compose.yml mount /etc/odoo

odoo:
 image: odoo
 links:
  - db:db
 ports:
  - "127.0.0.1:8069:8069"
 volumes:
  - extra-addons:/mnt/extra-addons
  - ./config:/etc/odoo

Then create "odoo.conf" in ./config and add configuration options like below.

[options]
addons_path = /mnt/extra-addons,/usr/lib/python2.7/dist- packages/odoo/addons
data_dir = /var/lib/odoo
auto_reload = True

restart odoo, go to debug mode then apps->update module list

If still not works, then check access rights on addons directories and check if group and others can read them

like image 6
Lesser Avatar answered Nov 15 '22 23:11

Lesser