欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Odoo/developer
来自开放百科 - 灰狐
(版本间的差异)
小 (→Eclipse) |
小 (→Shell) |
||
(未显示1个用户的74个中间版本) | |||
第1行: | 第1行: | ||
[[odoo]] 开发者 | [[odoo]] 开发者 | ||
+ | |||
+ | [[文件:Odoo-logo.png|right|odoo]] | ||
+ | |||
+ | ==版本== | ||
+ | *使用[http://runbot.odoo.com/runbot odoo runbot]比较odoo各个版本,包括企业版。 | ||
+ | *[https://runbot.odoo-community.org/ Odoo Community Association runbot] | ||
+ | |||
+ | ==安装== | ||
+ | [https://www.odoo.com/documentation/14.0/setup/install.html#setup-install-source 源码安装] | ||
+ | git clone https://github.com/odoo/odoo | ||
+ | apt-get install libxml2-dev libxslt1-dev | ||
+ | apt install libldap2-dev libsasl2-dev libssl-dev | ||
+ | or yum install libxml2-devel libxslt-devel openldap-devel | ||
+ | $ pip3 install -r requirements.txt | ||
+ | $ python3 odoo-bin -i base --addons-path=addons -d odoo -r odoo -w odoo // 安装设置好postgresql数据库,odoo为数据库名、用户名、密码 | ||
+ | $ /usr/bin/python3.6 odoo-bin -w odoo -r odoo --db_port 5432 --addons-path=addons | ||
+ | pg_hba.conf 可能需要加上以下信息,然后重启数据库 | ||
+ | local odoo odoo password | ||
+ | local all odoo trust | ||
+ | local all all md5 | ||
+ | http://localhost:8069 // 初始化数据库并装入数据 | ||
+ | admin/admin | ||
+ | demo/demo | ||
+ | portal/portal | ||
+ | http://localhost:8069/web/database/manager // 数据库维护 | ||
+ | |||
+ | ==例子== | ||
+ | 第一个例子:[https://github.com/Yenthe666/Odoo_Samples/tree/10.0/create_webpage_demo create_webpage_demo] | ||
+ | |||
+ | ==Shell== | ||
+ | $ odoo-bin --version | ||
+ | Odoo Server 15.0 | ||
+ | $ odoo-bin scaffold my_module | ||
+ | tree my_module/ | ||
+ | my_module/ | ||
+ | ├── controllers | ||
+ | │ ├── controllers.py | ||
+ | │ └── __init__.py | ||
+ | ├── demo | ||
+ | │ └── demo.xml | ||
+ | ├── __init__.py | ||
+ | ├── __manifest__.py | ||
+ | ├── models | ||
+ | │ ├── __init__.py | ||
+ | │ └── models.py | ||
+ | ├── security | ||
+ | │ └── ir.model.access.csv | ||
+ | └── views | ||
+ | ├── templates.xml | ||
+ | └── views.xml | ||
+ | 5 directories, 10 files | ||
+ | 使用 [[IPython]] 提供Shell交互环境: | ||
+ | $ odoo-bin shell -d odoo | ||
+ | In [1]: self | ||
+ | Out[1]: res.users(1,) | ||
+ | In [2]: self.name | ||
+ | Out[2]: u'Allen' | ||
+ | In [3]: self._name | ||
+ | Out[3]: 'res.users' | ||
+ | In [4]: self.env | ||
+ | Out[4]: <odoo.api.Environment at 0x109d7ae10> | ||
==PyCharm== | ==PyCharm== | ||
*[https://github.com/mohamedmagdy/odoo-pycharm-templates Odoo PyCharm Templates] | *[https://github.com/mohamedmagdy/odoo-pycharm-templates Odoo PyCharm Templates] | ||
+ | |||
+ | ==Module== | ||
+ | 创建一个[http://www.odoo.com/documentation/10.0/howtos/backend.html Module] | ||
+ | odoo-bin scaffold openacademy addons | ||
+ | 更多细节可参考:[http://www.jeffzhang.cn/Odoo-Official-Doc-Notes/ Odoo8.0模块开发全流程] | ||
==Eclipse== | ==Eclipse== | ||
− | ==Docker== | + | ==容器云== |
+ | *[https://www.odoo.sh/ Odoo Cloud Platform] | ||
+ | *[https://hub.docker.com/_/odoo/ Odoo @ Docker Hub] | ||
+ | docker pull odoo | ||
+ | |||
+ | ==RPC== | ||
+ | odoo支持两类[[RPC]]: | ||
+ | *[[JSON-RPC]] import jsonrpclib | ||
+ | *[[XML-RPC]] import xmlrpclib | ||
+ | 参考资料: | ||
+ | *[http://docs.huihoo.com/odoo/developer/10.0/reference/javascript.html JavasSript] | ||
+ | *[http://docs.huihoo.com/odoo/developer/10.0/api_integration.html Web Service API] | ||
+ | 核心文件: | ||
+ | *odoo-10.0/odoo/http.py | ||
+ | |||
+ | ==Hosting== | ||
+ | Odoo Hosting Providers 基础架构:[[Phusion Passenger]] + [[PostgreSQL]] + [[Redis]] ... | ||
+ | *[[werkzeug]] 默认的 Server,主要用于本地的开发与调试。 | ||
+ | *[[Phusion Passenger]] 是生产环境下的 Server | ||
==项目== | ==项目== | ||
+ | [[文件:OCA-logo.png|right|OCA]] | ||
+ | [[文件:Odoo-OpenUpgrade.png|right|OCA]] | ||
+ | *[https://odoo-debranding.com/oca/ OCA] Open Source Odoo modules made by community | ||
+ | *[https://odoo-community.org/page/List OCA Projects] | ||
+ | *[https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst OCA Guidelines (2018/08/24)] | ||
+ | *[https://github.com/OCA/runbot-addons OCA continuous integration server] | ||
+ | *[https://github.com/OCA/OpenUpgrade OCA/OpenUpgrade] | ||
+ | *[https://github.com/acsone/setuptools-odoo setuptools-odoo] Odoo addons 包管理工具 | ||
+ | *[https://github.com/cundi/Odoo-Development-Essentials 《Odoo开发入门》2015年4月,基于Odoo 8.0] | ||
+ | *[https://github.com/odoo/runbot runbot] | ||
+ | |||
+ | ==测试== | ||
+ | [https://runbot.odoo.com/ Odoo Runbot] 是用于持续集成的自动化测试平台。[https://github.com/odoo/runbot/ Runbot @ GitHub] | ||
+ | |||
+ | 在应用 -> 技术的分类里有不少用于测试的模块,大家可加以使用。 | ||
+ | *自动化测试 | ||
+ | *网站测试 | ||
+ | *邮件测试 | ||
+ | *电话号码验证 | ||
+ | *测试 API | ||
+ | *测试 RPC | ||
+ | *测试性能 | ||
+ | *... | ||
+ | |||
+ | ==文档== | ||
+ | *[https://odoo-development.readthedocs.io/ Odoo development] | ||
+ | *[http://docs.huihoo.com/odoo/training/reference-material/how-to-use-api-to-connect-external-tools.pdf How to use API to connect external tools] | ||
+ | *[http://docs.huihoocom/odoo/ERP不花钱.pdf ERP不花钱] | ||
+ | *[http://docs.huihoocom/odoo/OpenERP技术培训.pdf OpenERP技术培训] | ||
+ | *[http://docs.huihoocom/odoo/精通odoo.pdf 精通odoo] | ||
+ | *[http://docs.huihoo.com/odoo/OSCG-OpenERP-App-Dev.pdf OpenERP应用和开发基础] | ||
+ | |||
+ | ==图书== | ||
+ | *[https://www.odoobooks.com/en/15.0/ 《Odoo 15 Best Practices》] | ||
+ | |||
+ | ==激活== | ||
+ | *Activating the [https://www.odoo.com/apps/modules/10.0/base_technical_features/ Technical Features] 激活技术功能 | ||
+ | *Activating the Developer mode 激活开发者模式 | ||
+ | |||
+ | ==培训== | ||
+ | *[https://github.com/odoo/technical-training Odoo 12.0 - Technical Training] | ||
+ | |||
+ | ==开发者== | ||
+ | *[https://yelizariev.github.io/ Ivan Yelizariev] | ||
==图集== | ==图集== | ||
+ | <gallery> | ||
+ | image:Odoo-QA-Working-Approach.png|Odoo QA | ||
+ | image:odoo-module-structure.png|Module结构 | ||
+ | image:openerp-3.0.3-pom.png|Object | ||
+ | image:odoo-javascript-testing.png|运行JS测试 | ||
+ | image:Odoo-model-inheritance.png|继承与扩展 | ||
+ | image:odoo-module.png|第一个Module | ||
+ | image:odoo-module-webpage.png|页面显示 | ||
+ | image:oca-github.png|OCA | ||
+ | </gallery> | ||
+ | |||
+ | ==问题== | ||
+ | 出现类似问题 '/Users/huihoo/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. | ||
+ | sudo pip install pyparsing==2.1.10 --upgrade --ignore-installed six // 用–ignoring-installed * 选项来屏蔽已经安装过的模块。 | ||
+ | Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0 | ||
+ | pip install -U lxml | ||
==链接== | ==链接== | ||
+ | *[https://github.com/odoo odoo @ github] | ||
+ | *[http://nightly.odoo.com/ Odoo Nightly builds] | ||
+ | *[https://odoo-community.org/ Odoo Community Association官网] | ||
+ | *[https://github.com/OCA Odoo Community Association @ GitHub] | ||
+ | *[http://odooqa.com/ Odoo QA] Odoo Automated Testing services | ||
*[https://launchpad.net/openobject OpenERP在Launchpad.net] | *[https://launchpad.net/openobject OpenERP在Launchpad.net] | ||
− | *[http:// | + | *[https://github.com/odoo-cn odoo-cn @ github] |
+ | *[http://www.odoo-code-search.com/ Odoo Code Search] | ||
+ | *[http://cn.openerp.cn/odoo%e6%9e%84%e5%bb%ba%e5%ae%89%e5%85%a8%e4%bb%a3%e7%a0%81%e7%9a%84%e5%8d%81%e9%a1%b9%e8%a7%84%e5%88%99/ Odoo构建安全代码的十项规则] | ||
+ | *[http://docs.huihoo.com/odoo/developer/10.0/reference/guidelines.html Odoo Guidelines] | ||
+ | *[http://docs.huihoo.com/odoo/developer/10.0/reference/async.html Asynchronous Operations] | ||
[[category:developer]] | [[category:developer]] | ||
[[category:odoo]] | [[category:odoo]] | ||
− | [[category: | + | [[category:E3 odoo]] |
2022年3月14日 (一) 05:45的最后版本
odoo 开发者
目录 |
[编辑] 版本
- 使用odoo runbot比较odoo各个版本,包括企业版。
- Odoo Community Association runbot
[编辑] 安装
git clone https://github.com/odoo/odoo apt-get install libxml2-dev libxslt1-dev apt install libldap2-dev libsasl2-dev libssl-dev or yum install libxml2-devel libxslt-devel openldap-devel $ pip3 install -r requirements.txt $ python3 odoo-bin -i base --addons-path=addons -d odoo -r odoo -w odoo // 安装设置好postgresql数据库,odoo为数据库名、用户名、密码 $ /usr/bin/python3.6 odoo-bin -w odoo -r odoo --db_port 5432 --addons-path=addons pg_hba.conf 可能需要加上以下信息,然后重启数据库 local odoo odoo password local all odoo trust local all all md5 http://localhost:8069 // 初始化数据库并装入数据 admin/admin demo/demo portal/portal http://localhost:8069/web/database/manager // 数据库维护
[编辑] 例子
第一个例子:create_webpage_demo
[编辑] Shell
$ odoo-bin --version Odoo Server 15.0 $ odoo-bin scaffold my_module tree my_module/ my_module/ ├── controllers │ ├── controllers.py │ └── __init__.py ├── demo │ └── demo.xml ├── __init__.py ├── __manifest__.py ├── models │ ├── __init__.py │ └── models.py ├── security │ └── ir.model.access.csv └── views ├── templates.xml └── views.xml 5 directories, 10 files
使用 IPython 提供Shell交互环境:
$ odoo-bin shell -d odoo In [1]: self Out[1]: res.users(1,) In [2]: self.name Out[2]: u'Allen' In [3]: self._name Out[3]: 'res.users' In [4]: self.env Out[4]: <odoo.api.Environment at 0x109d7ae10>
[编辑] PyCharm
[编辑] Module
创建一个Module
odoo-bin scaffold openacademy addons
更多细节可参考:Odoo8.0模块开发全流程
[编辑] Eclipse
[编辑] 容器云
docker pull odoo
[编辑] RPC
odoo支持两类RPC:
参考资料:
核心文件:
- odoo-10.0/odoo/http.py
[编辑] Hosting
Odoo Hosting Providers 基础架构:Phusion Passenger + PostgreSQL + Redis ...
- werkzeug 默认的 Server,主要用于本地的开发与调试。
- Phusion Passenger 是生产环境下的 Server
[编辑] 项目
- OCA Open Source Odoo modules made by community
- OCA Projects
- OCA Guidelines (2018/08/24)
- OCA continuous integration server
- OCA/OpenUpgrade
- setuptools-odoo Odoo addons 包管理工具
- 《Odoo开发入门》2015年4月,基于Odoo 8.0
- runbot
[编辑] 测试
Odoo Runbot 是用于持续集成的自动化测试平台。Runbot @ GitHub
在应用 -> 技术的分类里有不少用于测试的模块,大家可加以使用。
- 自动化测试
- 网站测试
- 邮件测试
- 电话号码验证
- 测试 API
- 测试 RPC
- 测试性能
- ...
[编辑] 文档
[编辑] 图书
[编辑] 激活
- Activating the Technical Features 激活技术功能
- Activating the Developer mode 激活开发者模式
[编辑] 培训
[编辑] 开发者
[编辑] 图集
[编辑] 问题
出现类似问题 '/Users/huihoo/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled.
sudo pip install pyparsing==2.1.10 --upgrade --ignore-installed six // 用–ignoring-installed * 选项来屏蔽已经安装过的模块。
Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0
pip install -U lxml
[编辑] 链接
分享您的观点