请提前准备:Linux(ubuntu 14.04)、Anaconda3、Git
Linux安装基础组建:
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev获取Odoo源码
git clone https://github.com/odoo/odoo.git用anaconda安装一个python3.5的虚拟环境
conda create -n py35 python=3.5切换到对应的虚拟环境
source activate py35创建odoo用户
adduser odoo
passwd odoo
连续两次输入密码(例如:odoo)切换到pull下的odoo文件夹,安装odoo提供的requirements
pip install -r requirements.txt如果报错:
Found existing installation: pytz 2017.2
Cannot uninstall 'pytz'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
手动删除pytz库,举个栗子:
cd /home/root/anaconda3/envs/py35/lib/python3.5/site-packages
rm -rf pytz*
然后在安装一次依赖:
pip install -r requirements.txt运行./odoo-bin -s
如果报错: ValueError: unknown locale: UTF-8
解决:sudo vim ~/.zshrc
正文输入:export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
保存后编译:source ~/.zshrc-
找到-s自动生成的配置文件
odoo: Using configuration file at /home/odoo/.odoorc
-
修改并移动配置文件
mv /home/odoo/.odoorc /home/odoo/odoo12.conf
vim /home/odoo/odoo12.conf
大致修改一下几个参数来配置psql数据库:
- ./odoo-bin -c odoo12.conf
如果启动没有问题,访问localhost:8069,创建数据库,如果出现scss的界面报错,请安装:
pip3 install libsass
再次重启 ./odoo-bin -c odoo12.conf
启动后样式请参看:Demo环境访问测试 admin/admin