AttributeError: module 'odoo' has no attribute 'cli' when using docker-compose volumes
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 1.2k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am using docker-compose:
services:
web:
platform: linux/x86_64
restart: always
image: odoo:13.0
#command: -d dev
depends_on:
- db
ports:
- "8069:8069"
- "8072:8072"
volumes:
- odoo-web-data:/var/lib/odoo
#- ./odoo:/usr/lib/python3/dist-packages/odoo
- ./addons:/mnt/extra-addons
- ./addons/_lib:/mnt/_lib
- ./config:/etc/odoo
- ./backups:/var/tmp
- ./debug:/usr/lib/python3.5/debug
db:
restart: always
image: postgres:10
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
Everything works fine, unless I want to map into volumes /usr/lib/python3/dist-packages/odoo:
volumes:
- ./odoo:/usr/lib/python3/dist-packages/odoo
Output from docker-compose up:
Traceback (most recent call last):
File "/usr/bin/odoo", line 8, in <module>
odoo.cli.main()
AttributeError: module 'odoo' has no attribute 'cli'
My idea is to control odoo version without creating my own image with dockerfile and changing argument ODOO_RELEASE.
Am I doing something wrong?
Thanks.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the shown docker-compose configuration and the ./odoo mount. Inspect the /usr/bin/odoo entry point and the mounted /usr/lib/python3/dist-packages/odoo path, then run docker-compose up again. Done means the volume mapping works while Odoo starts without the reported AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, python
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100