问题描述
我正在尝试使用docker进行odoo模块开发.我有以下docker-compose.yml
文件
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
该模块仅包含一个__openerp__.py
文件,但即使使用--update=tutorial
选项,odoo也不会显示我对其所做的更改
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"],
}
此文件位于extra-addons
中一个名为tutorial的文件夹中,我尝试停止并启动容器,甚至删除并重新创建它们.
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.
推荐答案
就像shodowsjedi已经说过的那样,您需要创建一个__init__.py
文件(请参阅模块结构: https://www.odoo.com/documentation/8.0/howtos/backend.html#module-structure ).
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 ).
此外,检查odoo容器中的权限,odoo卷中的文件将在容器(可以与其他用户关联)中包含系统(主机)的uid和gid.要检查这一点,您可以使用docker exec:
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
最后一个,也许也是最重要的一个,请使用以下命令检查odoo日志:
Last and probably the most important one, check odoo logs by using :
docker-compose logs
并在Odoo的配置页面中(或在服务器启动时)更新模块
and update your module in the configuration page of Odoo (or at the startup of the server)
这篇关于在Docker上进行Odoo开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!