2016年1月

参考了https://github.com/sqawasmi/odoo-docker/blob/v8/Dockerfile
以及https://hub.docker.com/r/yingliu4203/odoo8nightly/
感谢两位大神!
注:修正yingliu4203/odoo8nightly的wkhtmltox-0.12.1,因wkhtmltox-0.12.1已经从sourceforge.net移除了:
去掉:
http://sourceforge.net/projects/wkhtmltopdf/files/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
改为gna.org的下载源:

http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb

This script builds a docker image from Odoo 8.0 nightly build in Ubuntu 14.04

FROM ubuntu:14.04
MAINTAINER Byiz Liang - www.Duuge.com

This is the account name created by Odoo setup

ENV ODOO_USER odoo
ENV ODOO_HOME /home/$ODOO_USER
ENV ODOO_ADDONS_DIR $ODOO_HOME/addons

RUN echo deb http://nightly.odoo.com/8.0/nightly/deb/ ./ >> /etc/apt/sources.list

Configure locale

RUN locale-gen en_US.UTF-8 && update-locale
RUN echo 'LANG="en_US.UTF-8"' > /etc/default/locale
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

install supporting packages

RUN apt-get update
RUN apt-get upgrade -y

RUN apt-get install -y vim git wget curl

RUN apt-get install -y supervisor openssh-server

RUN apt-get install --allow-unauthenticated -y odoo

odoo need wkhtmltopdf to generate report

RUN wget http://sourceforge.net/projects/wkhtmltopdf/files/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb

RUN wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
RUN dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb

RUN mkdir -p /var/run/sshd
RUN mkdir -p /var/log/supervisor

config postgresql

RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf

there might be a docker bug that postgresql could access

/etc/ssl/private/ssl-cert-snakeoil.key

RUN sed -i "s/ssl = true/ssl = false/g" /etc/postgresql/9.3/main/postgresql.conf

start postgresql and create a role

USER postgres
RUN /etc/init.d/postgresql start &&\

psql -e --command "CREATE USER $ODOO_USER WITH SUPERUSER PASSWORD 'odoo'" &&\
/etc/init.d/postgresql stop

USER root

config odoo

Odoo setup doesn't create home directory

RUN mkdir -p $ODOO_ADDONS_DIR
RUN chown $ODOO_USER:$ODOO_USER -R $ODOO_HOME

change user shell thus a root can su to the account

RUN chsh -s /bin/bash $ODOO_USER

set Odoo user password and sudo group

RUN echo "$ODOO_USER:$ODOO_USER" | chpasswd
RUN usermod -aG sudo $ODOO_USER

configure Odoo server and addon

ENV ODOO_CONFIG /etc/odoo/openerp-server.conf
RUN sed -i "s/db_user = .*/db_user = $ODOO_USER/g" $ODOO_CONFIG
RUN echo "addons_path = $ODOO_ADDONS_DIR" >> $ODOO_CONFIG

config supervesord

ENV SUPERVISORD_CONFIG_DIR /etc/supervisor/conf.d
ENV SUPERVISORD_CONFIG_FILE $SUPERVISORD_CONFIG_DIR/supervisord.conf

RUN mkdir -p $SUPERVISORD_CONFIG_DIR
RUN echo "[supervisord]" >> $SUPERVISORD_CONFIG_FILE
RUN echo "nodaemon=true" >> $SUPERVISORD_CONFIG_FILE
RUN echo "" >> $SUPERVISORD_CONFIG_FILE
RUN echo "[program:sshd]" >> $SUPERVISORD_CONFIG_FILE
RUN echo "command = /usr/sbin/sshd -D" >> $SUPERVISORD_CONFIG_FILE

RUN echo "" >> $SUPERVISORD_CONFIG_FILE
RUN echo "[program:postgresql]" >> $SUPERVISORD_CONFIG_FILE
RUN echo "user = postgres" >> $SUPERVISORD_CONFIG_FILE
RUN echo "command = /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf" >> $SUPERVISORD_CONFIG_FILE

RUN echo "" >> $SUPERVISORD_CONFIG_FILE
RUN echo "[program:odoo]" >> $SUPERVISORD_CONFIG_FILE
RUN echo "user = odoo" >> $SUPERVISORD_CONFIG_FILE
RUN echo 'environment = USER="odoo", LOGNAME="odoo", HOME="/home/odoo"' >> $SUPERVISORD_CONFIG_FILE
RUN echo "command = /usr/bin/odoo.py --config=/etc/odoo/openerp-server.conf --logfile=/var/log/odoo/openerp-server.log" >> $SUPERVISORD_CONFIG_FILE

EXPOSE 22 5432 8069

supervisord requires CMD

CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisor/conf.d/supervisord.conf"]

最后用# docker build -t odoo8nightly .命令构建出images镜像来,请注意末尾的“.“小句点

用的是https://github.com/Dolibarr/dolibarr/blob/develop/Dockerfile这份Dockerfile,如下:
1、先创建文件夹:
sudo mkdir dolibarr
cd dolibarr
进到dolibarr文件夹后,
2、再创建Dockefile:
sudo vim Dockerfile
内容如下:




FROM php:5.6-apache

RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev \

&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd

RUN docker-php-ext-install mysqli

COPY htdocs/ /var/www/html/

RUN chown -hR www-data:www-data /var/www/html

EXPOSE 80



然后,重点来了,用docker build来创建images镜像:
3、命令如下 :
sudo docker build dolibarr .
请注意末尾有一个英文状态下的句号.句点,这个“.“小句点我之前一直没加上,所以build不下去,一直报错就是这里。


root@server:/home/liangjia/docker/dolibarr# ls
Dockerfile
root@server:/home/liangjia/docker/dolibarr# docker build -t dolibarr
docker: "build" requires 1 argument.
See 'docker build --help'.

Usage: docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile
root@server:/home/liangjia/docker/dolibarr# docker build -t dolibarr .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM php:5.6-apache
Pulling repository docker.io/library/php
88536ecbcd56: Pulling dependent layers
cb6fb082434e: Downloading 13.4 MB


转载自:http://www.oejia.net/blog/2016/01/19/oejia_wx_v01.html
Odoo 的微信模块 Oejia_wx v0.1 发布!
Oejia on 2016-01-19 00:18:56
Oejia_wx

Odoo 的微信模块,提供了对微信公众号的接入与管理,实现了微信消息与Odoo聊天的无缝对接。

特性

用户、组同步管理
用户消息对接live_chat 一对一实时聊天
全功能自定义菜单配置
各种返回消息类型的支持
灵活配置自动回复及匹配方式
项目地址

https://github.com/JoneXiong/oejia_wx

界面效果

info
info
info
info
Information

Odoo 的微信模块 Oejia_wx v0.1 发布!
http://www.oejia.net/blog/2016/01/19/oejia_wx_v01.html
http://www.oejia.net/raw/2016/01/19/oejia_wx_v01.md
Oejia on 2016-01-19 00:18:56

记录备用:
1、本机的ubuntu先安装python-pip:
apt-get install python-pip
2、再用pip来安装transifex-client:
pip install transifex-client
3、然后建个git目录给odoo或dolibarr并初始化tx的client客户端环境:
odoo的:
mkdir /git/odoo
cd git/odoo
tx init

dolibarr的:
mkdir /git/dolibarr
cd git/dolibarr
tx init

其他不动保持默认,需要的时候请输入你在transifex.com的账号和密码

Odoo多个二级域名对应多个Pgsql数据库访问【作业】

前段时间-福州小林在Jeffery群里问到说要多域名访问odoo对应多数据库,按照网上教程修改odoo源码找不到对应的修改的地方,网上教程的源码是旧源码,新版本odoo已经不需要修改源码,感谢南京CCDOS指点迷津!

举例:

想用aaa.odoo123.com访问odoo中的aaa数据库,
想用bbb.odoo123.com访问odoo中的bbb数据库。

1、修改openerp-server.conf文件,增加一行:dbfilter = ^%d$

如下图所示:

2、http://127.0.0.1:8069/web/database/manager并创建aaa和bbb两个(操作两次)数据库:

3、打开C:WINDOWSsystem32driversetchosts在此文件中增加两行:

127.0.0.1 aaa.odoo123.com
127.0.0.1 bbb.odoo123.com

效果如下图:
4、访问aaa.odoo123.com

5、访问bbb.odoo123.com

6、如果访问了一个odoo里没有的数据库那么会跳转至新创建数据库的页面:

声明:

1、以上方法基于win2003server+步科绿色版GreenOdoo,以上方法成功。
2、在阿里云服务器+LNMP(启用nginx的gzip及反向代理了odoo的8069端口)前提下,以上方法失败。