温斯顿吴的博客 适道而后济

Odoo开发环境部署(Mac)

2022-03-03

Install

odoo

源码下载:

https://www.odoo.com/zh_CN/page/download

直接下载源码,缺少odoo-bin文件:

https://raw.githubusercontent.com/odoo/odoo/15.0/odoo-bin

Postgres.app

https://postgresapp.com/


sudo mkdir -p /etc/paths.d &&
echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp


CREATE USER odoo WITH PASSWORD '888888';

CREATE DATABASE db_odoo OWNER odoo;

pgAdmin

https://www.pgadmin.org/
$ cd /CommunityPath
$ pip3 install setuptools wheel
$ pip3 install -r requirements.txt
  • Error: pg_config executable not found.
    export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
    

配置文件


mkdir config
vi config/odoo.conf

config内容:

[options]
db_host=127.0.0.1
db_port=5432
db_user=odoo
db_password=888888
db_name=db_odoo

Run

初次启动

./odoo-bin --config=config/odoo.conf -i base

初始账户名和密码都是admin,之后启动只需要:

./odoo-bin --config=config/odoo.conf

url:

localhost:8069

其他

  • 查看Mac端口占用
    lsof -i tcp:5432
    
  • 查看PostgreSQL用户:
    psql
    \du
    
  • 给PostgreSQL用户授予数据库权限
    grant all privileges on database db_odoo to odoo;
    
  • 强制更新所有依赖包
    pip3 install --upgrade --force-reinstall -r requirements.txt
    

文章目录