Odoo Development Documentation

2y ago
44 Views
5 Downloads
5.53 MB
191 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Jacoby Zeller
Transcription

Odoo development DocumentationRelease masterIT-Projects LLCDec 13, 2018

Contents1First steps2Module Development2.1 Docs and manifests .2.2 Guidelines . . . . .2.3 Odoo Python . . . .2.4 XML . . . . . . . .2.5 HTML . . . . . . .2.6 CSS . . . . . . . . .2.7 YAML . . . . . . .2.8 Javascript . . . . . .2.9 Frontend . . . . . .2.10 Point of Sale (POS)2.11 Access . . . . . . .2.12 Hooks . . . . . . . .2.13 Source Diving . . .2.14 Lint . . . . . . . . .2.15 Other . . . . . . . .3.552525394142424244454754575961Debugging3.1 Terminal logs . . . . . . . . . . . .3.2 Browser’s Console . . . . . . . . .3.3 Sources tab at Browser’s dev tools .3.4 Network tab at Browser’s dev tools3.5 QWeb . . . . . . . . . . . . . . . .3.6 Typical errors . . . . . . . . . . . .656566666667674Quality assurance4.1 Test automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2 Manual testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7373815Porting Modules5.1 Common Migration Helpers . . . . . . . . . . . . . . . . . . . . .5.2 11.0- 12.0 . . . . . . . . . . . . . . . . . . . . . . . . . .5.3 10.0- 11.0 , py2 py3, shared Settings, sudo.get param() .5.4 9.0- 10.0 , openerp .py manifest .py . . . . . . .5.5 7.0- 8.0 , (cr, uid, ids, context) self.env8585868788893.i

67User documentation6.1 Module releasing checklist . .6.2 static/description/index.html .6.3 Screenshots tools . . . . . . .6.4 Module description . . . . . .6.5 Contact us block . . . . . . .6.6 JS Tour . . . . . . . . . . . .6.7 Preview module on App Store6.8 Image sizes . . . . . . . . . .91. 91. 93. 97. 98. 98. 98. 105. 107Git and Github7.1 Initial git & github configuration . . . . . .7.2 Porting . . . . . . . . . . . . . . . . . . .7.3 Conflict resolving . . . . . . . . . . . . .7.4 Multi Pull Request . . . . . . . . . . . . .7.5 Cancel lame commit . . . . . . . . . . . .7.6 Pull request from console . . . . . . . . .7.7 Check remote bundings . . . . . . . . . .7.8 Files relocation . . . . . . . . . . . . . . .7.9 Git stash . . . . . . . . . . . . . . . . . .7.10 Update Git . . . . . . . . . . . . . . . . .7.11 Squash commits into one . . . . . . . . . .7.12 Create branch from another’s Pull ntinuous Integration1238.1 Runbot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1238.2 Odoo Travis Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258.3 Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1259Odoo1279.1 Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1279.2 How to use Odoo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13710 Odoo administration10.1 Odoo installation . . . . .10.2 Longpolling . . . . . . .10.3 About longpolling . . . .10.4 --workers . . . . . . .10.5 --db maxconn . . . .10.6 --max-cron-threads10.7 --addons-path . . . .10.8 --log-handler . . . .10.9 --db-filter . . . . .10.10 --load . . . . . . . . .10.11 PosBox . . . . . . . . . .11 Continuous Delivery.14714715315315415415615615615715815816312 Maintenance16512.1 Data Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16513 IDE16713.1 Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16713.2 PyCharm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16913.3 Tmux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171ii

13.4 Visual Studio Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17314 Remote Development17714.1 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17714.2 Containers administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17915 Other18315.1 RST format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18315.2 Adjust chromium window size script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184iii

iv

Odoo development Documentation, Release masterJoin our telegram group: https://t.me/odoo talksContents1

Odoo development Documentation, Release master2Contents

CHAPTER1First steps Install odoo take the course Bulding a module read the article Source diving Configure git read Company rules (For IT-Projects LLC employees only) Get tasks from your Guru! Fork repo, clone repo to you machine, make commits, push updates, create Pull Request3

Odoo development Documentation, Release master4Chapter 1. First steps

CHAPTER2Module Development2.1 Docs and manifests2.1.1 FilesAll files from this section ought to be fully*0 prepared before any other files in new module. It helps you to reviewrequirements again before you start.README.rst Guidlines– OCA’s README Demo– addons-dev HTML Description Usage instructions Changelog Tested on0The only exception could be made for lists of files in manifest .py (“data”, “qweb”, “demo” fields).5

Odoo development Documentation, Release masterGuidlines. image:: png:target: https://www.gnu.org/licenses/lgpl:alt: License: LGPL-3 {MODULE NAME} {Put some short introduction first.}{Then add more detailed description, technical specifications, any other information that could be interested for other developers. Don't forget that Usage instructions is a separated and has to be located in doc/index.rst file.}Credits Contributors-----------* {DEVELOPER NAME} https://it-projects.info/team/{DEVELOPER GITHUB USERNAME} Sponsors-------* IT-Projects LLC https://it-projects.info Maintainers----------* IT-Projects LLC https://it-projects.info To get a guaranteed supportyou are kindly requested to purchase the moduleat odoo apps store NICAL NAME}/ .Thank you for understanding! IT-Projects Team https://www.it-projects.info/team Further information Demo: http://runbot.it-projects.info/demo/{REPO NAME}/{BRANCH}HTML Description: NICAL NAME}/Usage instructions: doc/index.rst Changelog: doc/changelog.rst Notifications on updates: via Atom https://github.com/it-projects-llc/{REPO NAME}/ commits/{BRANCH}/{TECHNICAL NAME}.atom , by Email https://blogtrottr.com/? subscribe https://github.com/it-projects-llc/{REPO NAME}/commits/{BRANCH}/ {TECHNICAL NAME}.atom Tested on Odoo {VERSION} {ODOO COMMIT SHA TO BE UPDATED}6Chapter 2. Module Development

Odoo development Documentation, Release masterOCA’s README ools/master/template/module/README.rstDemoLink to the runbot. Supported repo names are below. Change branche name if ons-dev/misc-addons-10.0-some cts.info/demo/website-addons/10.0addons-devIn most cases, if you work in addons-dev, you shall not use demo link to addons-dev (e.g. c-addons-10.0-some feature). Use a link for targetrepo instead (e.g. .0). You can use linksto addons-dev only if you know who will use it.HTML DescriptionLink to app store, e.g.HTML Description: https://apps.odoo.com/apps/modules/10.0/web debranding/You have to prepare this link even if the module is not published yet, i.e. link returns 404 error.Usage instructions doc/index.rstChangelog doc/changelog.rstTested onTested on Odoo 10.0 03bc8c5f9ac53a3349c1caac222f7619a632ccd8commit sha can be found as following2.1. Docs and manifests7

Odoo development Documentation, Release mastercd /path/to/odoogit rev-parse HEADdoc/index.rst {MODULE NAME} Installation {Instruction about things to do before actual installation}* {OPTIONAL } Activate longpolling https://odoo-development.readthedocs.io/en/latest/ admin/longpolling.html * {Additional notes if any}* Install odoo/usage/install module.html this module in a usual wayConfiguration {Instruction how to configure the module before start to use it}* Log in as SUPERUSER odoo/usage/ login-as-superuser.html * Activate Developer Mode odoo/ usage/debug-mode.html * Open menu [[ {Menu} ]] {Submenu} {Subsubmenu} * Click [{Button Name}] Usage {Instruction for daily usage. It should describe how to check that module works. What shall user do and what would user get.}* Open menu [[ {Menu} ]] {Submenu} {Subsubmenu} * Click [{Button Name}] * RESULT: {what user gets, how the modules changes default behaviour}Uninstallation {Optional section for uninstallation notes. Delete it if you don't have notes for uninstallation.}This description will be available at app store under Documentation tab. Example: https://www.odoo.com/apps/modules/8.0/pos multi session/manifest .py ( openerp .py)8Chapter 2. Module Development

Odoo development Documentation, Release master Filename Template name summary category– Hidden version author– author in OCA website license external dependenciesFilename Use openerp .py for odoo 9.0 and earler versions. Use manifest .py for odoo 10.0 and later versions, but don’t rename filename on porting module fromone version to anotherTemplateUse example below as template. What are important here: order of attributes not used attributes are represented quote characters (", """) empty lines no description attribute price and currency attributes are commented-out if not used comma after last item in list (e.g. in ‘depends’ attribute) add new line symbol at the end of file (i.e. right after last })# Copyright 2018 {DEVELOPER NAME} https://it-projects.info/team/{DEVELOPER GITHUB USERNAME} # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).{"name": """{MODULE NAME}""","summary": """{SHORT DESCRIPTION OF THE MODULE}""","category": "{MODULE CATEGORY}",# "live test url": L?version {ODOO BRANCH}","images": [],(continues on next page)2.1. Docs and manifests9

Odoo development Documentation, Release master(continued from previous page)"version": "{ODOO BRANCH}.1.0.0","application": False,"author": "IT-Projects LLC, {DEVELOPER NAME}","support": "apps@it-projects.info","website": "https://it-projects.info/team/{DEVELOPER GITHUB USERNAME}","license": "LGPL-3",# "price": 9.00,# "currency": "EUR","depends": ["{DEPENDENCY1}","{DEPENDENCY2}",],"external dependencies": {"python": [], "bin": []},"data": ["{FILE1}.xml","{FILE2}.xml",],"demo": ["demo/{DEMOFILE1}.xml",],"qweb": ["static/src/xml/{QWEBFILE1}.xml",],"post load": None,"pre init hook": None,"post init hook": None,"uninstall hook": None,"auto install": False,"installable": True,##########"demo title": "{MODULE NAME}","demo addons": [],"demo addons hidden": [],"demo url": "DEMO-URL","demo summary": "{SHORT DESCRIPTION OF THE MODULE}","demo images": ["images/MAIN IMAGE",]}10Chapter 2. Module Development

Odoo development Documentation, Release masterSee also: OCA’s template: r/template/module/ openerp .pynameIt must be non-technical name of the modulesummaryShort description of the module. E.g. you can describe here which problem is solved by the module. It could sound asa slogan.categoryCategories from the list below are preferred. Accounting Discuss Document Management eCommerce Human Resources Industries Localization Manufacturing Marketing Point of Sale Productivity Project Purchases Sales Warehouse Website Extra ToolsHiddenFor technical modules Hidden category can be used:"category": "Hidden",Such modules are excluded from search results on app store.2.1. Docs and manifests11

Odoo development Documentation, Release masterversionNote: whenever you change version, you have to add a record in changelog.rstThe version number in the module manifest should be the Odoo major version (e.g. 8.0) followed by the module x.y.zversion numbers. For example: 8.0.1.0.0 is expected for the first release of an 8.0 module.The x.y.z version numbers follow the semantics breaking.feature.fix: x increments when the data model or the views had significant changes. Data migration might be needed, ordepending modules might be affected. y increments when non-breaking new features are added. A module upgrade will probably be needed. z increments when bugfixes were made. Usually a server restart is needed for the fixes to be made available.If applicable, breaking changes are expected to include instructions or scripts to perform migration on current installations.If a module ported to different odoo versions (e.g. 8 and 9) and some update is added only to one version (e.g. 9), thenversion is changed as in example below: init– 8.0.1.0.0– 9.0.1.0.0 feature added to 8.0 and ported to 9.0– 8.0.1.1.0– 9.0.1.1.0 feature added to 9.0 only and not going to be ported to 8.0:– 8.0.1.1.0– 9.0.1.2.0 fix made in 9.0 only and not going to be ported to 8.0:– 8.0.1.1.0– 9.0.1.2.1 fix made in 8.0 and ported to 9.0– 8.0.1.2.2– 9.0.1.2.2i.e. two module branches cannot have same versions with a different meaningauthorUse company first and then developer(s):"author": "IT-Projects LLC, Developer Name",In the main, if module already exists and you make small updatesfixes, you should not add your name to authors.12Chapter 2. Module Development

Odoo development Documentation, Release masterauthor in OCAFor OCA’s repositories put company name first, then OCA. Developers are listed in README file:"author": "IT-Projects LLC, Odoo Community Association (OCA)",websiteUrl to personal page at company’s website (e.g. IT-Projects LLC uses following licences: "GPL-3" for odoo 8.0 and below "LGPL-3" for odoo 9.0 and aboveFor OCA’s repositories use "AGPL-3".external dependenciesCheck if some python library exists:"external dependencies": {"python" : ["openid"]}Check if some sytem application exists:"external dependencies": {"bin" : ["libreoffice"]}See also: External dependencies in odoodoc/changelog.rstChangelog must answer a question: What is changed, do I need those updates?Note: Don’t use too technical description of the updates. For fixes, describe which error fixed, when the errorhappened, but without diving too much in technical detailsTemplateUse this for new modules 1.0.0 ------- **Init version**2.1. Docs and manifests13

Odoo development Documentation, Release masterGuidlines 2.0.0 ------- **New:** absolutely new way of . 1.2.0 ------- **New:** new interface for .- **Improvement:** better way to do . 1.0.1 ------- **Fix:** issue about .- **Fix:** another issue about . 1.0.0 ------- **Init version**icon.pngFile icon.png must be located at /static/description/icon.pngIT-Projects LLCIcons for IT-Projects LLC modules:TODO SaaS Telegram Access Barcode Mail Pos Stock Website Website Sale Misc14Chapter 2. Module Development

Odoo development Documentation, Release 1. Docs and manifests15

Odoo development Documentation, Release ter 2. Module Development

Odoo development Documentation, Release masterStockDownloadWebsiteDownloadWebsite SaleDownload2.1. Docs and manifests17

Odoo development Documentation, Release masterMiscDownload2.1.2 NotesRST RequirementsDon’t forget to keep correct rst format. Extra lines References to menu Fields Checkboxes Buttons Selections Titles and sectionsExtra linesDont’ forget about additional lines for correct formattingRaw RSTThis and next sentences are joined together.To split sentences to paragraphs you must add add empty line.Splited sentence 1.Splited sentence 2.Lists below doesn't rendered correctly, because extra line is required:* 1* 2* 3(continues on next page)18Chapter 2. Module Development

Odoo development Documentation, Release master(continued from previous page)The same for sublist:* 1* 1.1* 1.2* 1.3* 2Correctly formated lists:* 1* 2* 3* 3.1* 3.2* 3.3* 4Rendered RSTThis and next sentences are joined together. To split sentences to paragraphs you must add add empty line.Splited sentence 1.Splited sentence 2.Lists below doesn’t rendered correctly, because extra line is required: * 1 * 2 * 3The same for sublist: 1 * 1.1 * 1.2 * 1.3 2Correctly formated lists: 1 2 3– 3.1– 3.2– 3.3 4References to menuFor menus use double back-quotes with spaced slash and with top menu surrounded by double square brackets :2.1. Docs and manifests19

Odoo development Documentation, Release masterOK:* Open menu [[ Settings ]] Parameters System Parameters BAD* Open* Open* Open* Open* Openmenumenumenumenumenu

Odoo development Documentation, Release master cd/path/to/odoo git rev-parse

Related Documents:

Globalteckz - Official Odoo Partners www.globalteckz.com Odoo Insurance Management Insurance Management Module with Odoo version 9 Below is the list of features you gain from our Insurance management module in Odoo Insurance Management module Overview from Menu View. Insura

companies is Odoo. Odoo is a modern ERP application that has been used by 4 million users worldwide and equipped with 38 open-source modules in Odoo version 11.0. There are four modules used in this research, such as Sales, Invoicing, Inventory, and Purchase. Odoo has a user-friendly an

Check your Odoo add-ons path. It should be same as defined in the Odoo Config file. Config files are mostly saved in/etc folder. For e.g. /etc/odoo.conf Open Config file: Give the command: sudo/etc/odoo.conf Config file content: addons_path /opt/odoo

He's worked with Odoo solutions (formerly OpenERP) since 2010, and he is an active contributor in the Odoo community association projects. He has been a speaker at the Open Days annual conference and other open source events. He is the author of the first Odoo development boo

Dec 08, 2014 · When I joined Odoo in 2009, my first task was to deliver training courses for consultants, including technical sessions for new Odoo developers. Daniel's Odoo 10 Development Essentials is the realization of my wishes from these sessions; the companion book I wish I could have given to the participants, to k

Odoo Odoo is an open-source suite of business apps. It is built on a modular structure in which each app covers one business function and each app is installed as needed. Odoo is available to be installed on-premises as well as in the cloud. Odoo

Odoo Online Odoo is an open source software that is available in three versions, two of which are local while the other is hosted in the cloud. More than 26,100 apps are available thanks to the multiple develop- ments made by Odoo S.A. and its community. 5 million users 120 countries 26,130 apps in

Sep 18, 2019 · When an invoice/memo is synced from Magento to Odoo, its payment entity will be linked to an Odoo journal based on mapping of payment methods Magento. On the backend, navigate to Odoo Mapping Payment Journals. Step 1: Click Add