diff --git a/content/administration/install/deploy.rst b/content/administration/install/deploy.rst index e4c7d8c64..c135574d8 100644 --- a/content/administration/install/deploy.rst +++ b/content/administration/install/deploy.rst @@ -516,6 +516,7 @@ security-related topics: Blocking Brute Force Attacks ---------------------------- + For internet-facing deployments, brute force attacks on user passwords are very common, and this threat should not be neglected for Odoo servers. Odoo emits a log entry whenever a login attempt is performed, and reports the result: success or failure, along with the target login and source IP. diff --git a/content/administration/install/email_gateway.rst b/content/administration/install/email_gateway.rst index 5d0ca237d..c05437007 100644 --- a/content/administration/install/email_gateway.rst +++ b/content/administration/install/email_gateway.rst @@ -4,19 +4,22 @@ Email gateway The Odoo mail gateway allows you to inject directly all the received emails in Odoo. -Its principle is straightforward: your SMTP server executes the "mailgate" script for every new incoming email. +Its principle is straightforward: your SMTP server executes the "mailgate" script for every new +incoming email. The script takes care of connecting to your Odoo database through XML-RPC, and send the emails via the `MailThread.message_process()` feature. Prerequisites ------------- + - Administrator access to the Odoo database. - Your own mail server such as Postfix or Exim. - Technical knowledge on how to configure an email server. For Postfix ----------- + In you alias config (:file:`/etc/aliases`): .. code-block:: text @@ -33,6 +36,7 @@ In you alias config (:file:`/etc/aliases`): For Exim -------- + .. code-block:: text *: |/odoo-directory/addons/mail/static/scripts/odoo-mailgate.py -d -u -p diff --git a/content/administration/install/install.rst b/content/administration/install/install.rst index 106355c3a..1a52d8a64 100644 --- a/content/administration/install/install.rst +++ b/content/administration/install/install.rst @@ -105,13 +105,13 @@ Linux ----- Debian/Ubuntu -''''''''''''' +~~~~~~~~~~~~~ Odoo {CURRENT_MAJOR_VERSION} 'deb' package currently supports `Debian Buster`_, `Ubuntu 18.04`_ or above. Prepare -^^^^^^^ +******* Odoo needs a `PostgreSQL`_ server to run properly. The default configuration for the Odoo 'deb' package is to use the PostgreSQL server on the same host as your @@ -127,7 +127,7 @@ Odoo instance. Execute the following command in order to install the PostgreSQL details on the various versions. Repository -^^^^^^^^^^ +********** Odoo S.A. provides a repository that can be used with Debian and Ubuntu distributions. It can be used to install *Odoo Community Edition* by executing the following commands **as root**: @@ -143,7 +143,7 @@ You can then use the usual `apt-get upgrade` command to keep your installation u At this moment, there is no nightly repository for the Enterprise Edition. Deb Package -^^^^^^^^^^^ +*********** Instead of using the repository as described above, the 'deb' packages for both the *Community* and *Enterprise* editions can be downloaded from the `official download page `_. @@ -179,12 +179,13 @@ and automatically start the server. $ sudo pip3 install num2words Fedora -'''''' +~~~~~~ Odoo {CURRENT_MAJOR_VERSION} 'rpm' package supports Fedora 30. Prepare -^^^^^^^ +******* + Odoo needs a `PostgreSQL`_ server to run properly. Make sure that the `sudo` command is available and well configured and, only then, execute the following command in order to install the PostgreSQL server: @@ -202,7 +203,7 @@ server: details on the various versions. Repository -^^^^^^^^^^ +********** Odoo S.A. provides a repository that can be used with the Fedora distributions. It can be used to install *Odoo Community Edition* by executing the following @@ -216,7 +217,7 @@ commands: $ sudo systemctl start odoo RPM package -^^^^^^^^^^^ +*********** Instead of using the repository as described above, the 'rpm' packages for both the *Community* and *Enterprise* editions can be downloaded from the `official download page `_. @@ -254,12 +255,12 @@ Windows ------- Fetch the sources -''''''''''''''''' +~~~~~~~~~~~~~~~~~ There are two ways to obtain the source code of Odoo: as a zip **archive** or through **git**. Archive -^^^^^^^ +******* Community Edition: @@ -275,7 +276,7 @@ Enterprise Edition: .. _setup/install/source/windows/git: Git -^^^ +*** The following requires `Git `_ to be installed on your machine and that you have basic knowledge of Git commands. To clone a Git repository, you must choose between cloning with HTTPS or @@ -310,10 +311,10 @@ on contributing to Odoo source code, choose SSH. .. _setup/install/source/windows/prepare: Prepare -''''''' +~~~~~~~ Python -^^^^^^ +****** Odoo requires Python 3.6 or later to run. Visit `Python's download page `_ to download and install the latest version of Python 3 on your machine. @@ -335,7 +336,7 @@ sure that **pip** is checked. C:\> pip --version PostgreSQL -^^^^^^^^^^ +********** Odoo uses PostgreSQL as database management system. `Download and install PostgreSQL `_ (supported version: 10.0 and later). @@ -356,7 +357,7 @@ create a new PostgreSQL user: `Yes`. Dependencies -^^^^^^^^^^^^ +************ Before installing the dependencies, you must download and install the `Build Tools for Visual Studio `_. @@ -396,7 +397,7 @@ needed: (typically: `C:\\Users\\\\AppData\\Roaming\\npm\\`). Running Odoo -'''''''''''' +~~~~~~~~~~~~ Once all dependencies are set up, Odoo can be launched by running `odoo-bin`, the command-line interface of the server. It is located at the root of the Odoo Community directory. @@ -444,12 +445,12 @@ Linux ----- Fetch the sources -''''''''''''''''' +~~~~~~~~~~~~~~~~~ There are two ways to obtain the source code of Odoo: as a zip **archive** or through **git**. Archive -^^^^^^^ +******* Community Edition: @@ -465,7 +466,7 @@ Enterprise Edition: .. _setup/install/source/linux/git: Git -^^^ +*** The following requires `Git `_ to be installed on your machine and that you have basic knowledge of Git commands. To clone a Git repository, you must choose between cloning with HTTPS or @@ -500,10 +501,10 @@ on contributing to Odoo source code, choose SSH. .. _setup/install/source/linux/prepare: Prepare -''''''' +~~~~~~~ Python -^^^^^^ +****** Odoo requires Python 3.6 or later to run. Use your package manager to download and install Python 3 on your machine if it is not already done. @@ -522,7 +523,7 @@ on your machine if it is not already done. $ pip3 --version PostgreSQL -^^^^^^^^^^ +********** Odoo uses PostgreSQL as database management system. Use your package manager to download and install PostgreSQL (supported version: 10.0 and later). @@ -545,7 +546,7 @@ create a new PostgreSQL user: connect to the database without password. Dependencies -^^^^^^^^^^^^ +************ For libraries using native code, it is necessary to install development tools and native dependencies before the Python dependencies of Odoo. They are available in `-dev` or `-devel` @@ -590,7 +591,7 @@ needed: $ sudo npm install -g rtlcss Running Odoo -'''''''''''' +~~~~~~~~~~~~ Once all dependencies are set up, Odoo can be launched by running `odoo-bin`, the command-line interface of the server. It is located at the root of the Odoo Community directory. @@ -639,12 +640,12 @@ Mac OS ------ Fetch the sources -''''''''''''''''' +~~~~~~~~~~~~~~~~~ There are two ways to obtain the source code of Odoo: as a zip **archive** or through **git**. Archive -^^^^^^^ +******* Community Edition: @@ -660,7 +661,7 @@ Enterprise Edition: .. _setup/install/source/mac_os/git: Git -^^^ +*** The following requires `Git `_ to be installed on your machine and that you have basic knowledge of Git commands. To clone a Git repository, you must choose between cloning with HTTPS or @@ -695,10 +696,10 @@ on contributing to Odoo source code, choose SSH. .. _setup/install/source/mac_os/prepare: Prepare -''''''' +~~~~~~~ Python -^^^^^^ +****** Odoo requires Python 3.6 or later to run. Use your preferred package manager (homebrew_, macports_) to download and install Python 3 on your machine if it is not already done. @@ -717,7 +718,7 @@ to download and install Python 3 on your machine if it is not already done. $ pip3 --version PostgreSQL -^^^^^^^^^^ +********** Odoo uses PostgreSQL as database management system. Use `postgres.app `_ to download and install PostgreSQL (supported version: 10.0 and later). @@ -739,7 +740,7 @@ create a new PostgreSQL user: connect to the database without password. Dependencies -^^^^^^^^^^^^ +************ Odoo dependencies are listed in the `requirements.txt` file located at the root of the Odoo community directory. @@ -783,7 +784,7 @@ needed: $ sudo npm install -g rtlcss Running Odoo -'''''''''''' +~~~~~~~~~~~~ Once all dependencies are set up, Odoo can be launched by running `odoo-bin`, the command-line interface of the server. It is located at the root of the Odoo Community directory. diff --git a/content/administration/maintain/on_premise.rst b/content/administration/maintain/on_premise.rst index a484c983e..ff72dbe20 100644 --- a/content/administration/maintain/on_premise.rst +++ b/content/administration/maintain/on_premise.rst @@ -19,12 +19,12 @@ If you are unable to register your database, you will likely encounter this message: .. image:: on_premise/error_message_sub_code.png - :align: center - :alt: Something went wrong while registering your database, - you can try again or contact Odoo Help + :align: center + :alt: Something went wrong while registering your database, you can try again or contact Odoo + Help Solutions -''''''''' +~~~~~~~~~ * Do you have a valid Enterprise subscription? @@ -42,15 +42,13 @@ Solutions `__ with the button "Unlink database" .. image:: on_premise/unlink_single_db.png - :align: center - + :align: center A confirmation message will appear; make sure this is the correct database as it will be deactivated shortly: .. image:: on_premise/unlink_confirm_enterprise_edition.png - :align: center - + :align: center * Do you have the updated version of Odoo 9? @@ -63,8 +61,7 @@ Solutions specifying which database is problematic: .. image:: on_premise/unlink_db_name_collision.png - :align: center - + :align: center In this case, you need to change the UUID on your test databases to solve this issue. You will find more information about this in :ref:`this section `. @@ -85,8 +82,6 @@ Solutions * Once you activated your database, you must keep these ports open, as the Update notification runs once a week. - - Error message due to too many users ----------------------------------- @@ -94,16 +89,15 @@ If you have more users in your local database than provisionned in your Odoo Enterprise subscription, you may encounter this message: .. image:: on_premise/add_more_users.png - :align: center - :alt: This database will expire in X days, you - have more users than your subscription allows + :align: center + :alt: This database will expire in X days, you have more users than your subscription allows When the message appears you have 30 days before the expiration. The countdown is updated everyday. Solutions -''''''''' +~~~~~~~~~ - **Add more users** on your subscription: follow the link and Validate the upsell quotation and pay for the extra users. @@ -123,15 +117,14 @@ If your database reaches its expiration date before your renew your subscription you will encounter this message: .. image:: on_premise/database_expired.png - :align: center - :alt: This database has expired. - + :align: center + :alt: This database has expired. This **blocking** message appears after a non-blocking message that lasts 30 days. If you fail to take action before the end of the countdown, the database is expired. Solutions -''''''''' +~~~~~~~~~ * Renew your subscription: follow the link and renew your subscription - note that if you wish to pay by Wire Transfer, your subscription will effectively be renewed @@ -142,7 +135,6 @@ Solutions None of those solutions worked for you? Please contact our `Support `__ - .. _force_ping: .. _duplicate_premise: @@ -155,8 +147,7 @@ server (/web/database/manager). In this page, you can easily duplicate your database (among other things). .. image:: on_premise/db_manager.gif - :align: center - + :align: center When you duplicate a local database, it is **strongly** advised to change the duplicated database's uuid (Unniversally Unique Identifier), since this @@ -164,8 +155,9 @@ uuid is how your database identifies itself with our servers. Having two databases with the same uuid could result in invoicing problems or registration problems down the line. -.. note:: From July 2016 onward, Odoo 9 now automatically change the uuid of a - duplicated database; a manual operation is no longer required. +.. note:: + From July 2016 onward, Odoo 9 now automatically change the uuid of a duplicated database; a + manual operation is no longer required. The database uuid is currently accessible from the menu :menuselection:`Settings --> Technical --> System Parameters`, we advise you to use a `uuid generator `_ or to @@ -173,4 +165,4 @@ use the unix command ``uuidgen`` to generate a new uuid. You can then simply rep other record by clicking on it and using the edit button. .. image:: on_premise/db_uuid.png - :align: center + :align: center diff --git a/content/administration/maintain/update.rst b/content/administration/maintain/update.rst index bbf993e35..a51b5ad22 100644 --- a/content/administration/maintain/update.rst +++ b/content/administration/maintain/update.rst @@ -104,6 +104,7 @@ and you're all set. Source Install (Tarball) ------------------------ + If you have originally installed Odoo with the "tarball" version (source code archive), you have to replace the installation directory with a newer version. First download the latest tarball from Odoo.com. They are updated daily and include the latest security fixes (see step #1) @@ -123,6 +124,7 @@ Finally, restart the Odoo service or reboot the machine, and you are all set. Source Install (Github) ----------------------- + If you have originally installed Odoo with a full Github clone of the official repositories, the update procedure requires you to pull the latest source code via git. Change into the directory for each repository (the main Odoo repository, and the Enterprise diff --git a/content/applications/finance/accounting/receivables/customer_invoices/credit_notes.rst b/content/applications/finance/accounting/receivables/customer_invoices/credit_notes.rst index 7a5495533..edbb87afb 100644 --- a/content/applications/finance/accounting/receivables/customer_invoices/credit_notes.rst +++ b/content/applications/finance/accounting/receivables/customer_invoices/credit_notes.rst @@ -1,6 +1,7 @@ ======================== Credit notes and refunds ======================== + A **credit note**, or **credit memo**, is a document issued to a customer that notifies them that they have been credited a certain amount. @@ -18,6 +19,7 @@ There are several reasons that can lead to a credit note, such as: Issue a Credit Note =================== + You can create a credit note from scratch by going to :menuselection:`Accounting --> Customers --> Credit Notes`, and by clicking on *Create*. Filling the Credit Note’s form @@ -42,6 +44,7 @@ You can choose between three options: Partial Refund -------------- + Odoo creates a draft credit note already prefilled with all the necessary information from the original invoice. @@ -53,6 +56,7 @@ want to modify any detail on the credit note. Full Refund ----------- + Odoo creates a credit note, automatically validates it, and reconciles the original invoice with it. @@ -64,6 +68,7 @@ a validated invoice. Full refund and new draft invoice --------------------------------- + Odoo creates a credit note, automatically validates it, reconciles the original invoice with it, and open a new draft invoice prefilled with the same details from the original invoice. @@ -72,6 +77,7 @@ This is the option to choose to modify the content of a validated invoice. Record a Vendor Refund ====================== + **Vendor Refunds** are recorded the same way you would do with invoices’ credit notes: You can either create a credit note from scratch by going @@ -81,6 +87,7 @@ and clicking on *Add Credit Note*. Journal Entries =============== + Issuing a credit note from an invoice creates a **reverse entry** that zeroes out the journal items generated by the original invoice. diff --git a/content/applications/finance/accounting/receivables/customer_invoices/epc_qr_code.rst b/content/applications/finance/accounting/receivables/customer_invoices/epc_qr_code.rst index 980ecf327..43009484a 100644 --- a/content/applications/finance/accounting/receivables/customer_invoices/epc_qr_code.rst +++ b/content/applications/finance/accounting/receivables/customer_invoices/epc_qr_code.rst @@ -1,6 +1,7 @@ ============================ Add EPC QR Codes to invoices ============================ + European Payments Council Quick Response Code, or **EPC QR Code**, are two-dimensional barcodes that customers can scan with their **mobile banking @@ -18,6 +19,7 @@ make for payment issues. Configuration ============= + Go to :menuselection:`Accounting --> Configuration --> Settings` and activate the **SEPA QR Code** feature. @@ -26,6 +28,7 @@ and activate the **SEPA QR Code** feature. Configure your Bank Account’s journal ------------------------------------- + Make sure that your *Bank Account* is correctly configured on Odoo with your IBAN and BIC. @@ -38,6 +41,7 @@ To do so, go to :menuselection:`Accounting --> Configuration Issue Invoices with EPC QR Codes ================================ + EPC QR Codes are added automatically to your invoices, as long as you issue them to customers that are located in a country where this feature is available. diff --git a/content/applications/finance/fiscal_localizations/argentina.rst b/content/applications/finance/fiscal_localizations/argentina.rst index a020feed7..a7c07c213 100644 --- a/content/applications/finance/fiscal_localizations/argentina.rst +++ b/content/applications/finance/fiscal_localizations/argentina.rst @@ -87,6 +87,7 @@ Go to :menuselection:`Accounting --> Settings --> Argentinian Localization` to s AFIP Certificates ***************** + The electronic invoice and other afip services work with WebServices (WS) provided by the AFIP. In order to enable communication with the AFIP, the first step is to request a Digital Certificate @@ -245,6 +246,7 @@ defines as well: Web Services ************ + - ``wsfev1: Electronic Invoice.`` This is the most common service, is used to generated invoices for document types A, B, C, M with no detail per item. - ``wsbfev1: Electronic Fiscal Bond.`` For those who invoice capital goods and wish @@ -274,6 +276,7 @@ with the same letter will share the same sequence. For example: Sequences ~~~~~~~~~ + In case that you want to synchronize the next number in the sequence in Odoo based on the next number in the AFIP POS, the next button that is visible under :ref:`developer mode ` can be used: @@ -282,9 +285,9 @@ can be used: :align: center .. note:: - When creating the Purchase journals, it's possible to define if they can be related to document - types or not. In case that the option to use documents is selected, there is no need to manually - associate the document type sequences as the document number is provided by the vendor. + When creating the Purchase journals, it's possible to define if they can be related to document + types or not. In case that the option to use documents is selected, there is no need to manually + associate the document type sequences as the document number is provided by the vendor. Usage and testing @@ -323,9 +326,9 @@ given by the document type. The most common document type will be defined automatically for the different combinations of AFIP responsibility type but it can be updated manually by the user. - Electronic Invoice elements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + When using electronic invoice, if all the information is correct the Invoice is posted in the standard way, in case that something needs to be addressed (check the section common errors for more detail), an error message is raised indicating the issue/proposed solution and the invoice remains @@ -371,12 +374,12 @@ Responsibility types: .. image:: argentina/argentina15.png :align: center - Special Use Cases ~~~~~~~~~~~~~~~~~ Invoices for Services ********************* + For electronic invoices that include Services, the AFIP requires to report the service starting and ending date, this information can be filled in the tab “Other Info”: @@ -386,12 +389,12 @@ and ending date, this information can be filled in the tab “Other Info”: If the dates are not selected manually before the invoice is validated, the values will be filled automatically considering the beginning and day of the invoice month: - .. image:: argentina/argentina_edi_07.png :align: center Exportation Invoices ******************** + The invoices related to Exportation transactions required a Journal that used the AFIP POS System “Expo Voucher - Web Service” so the proper document type be associated: @@ -416,9 +419,9 @@ Proveedor del Exterior” or “IVA Liberado – Ley Nº 19.640”, Odoo automat .. image:: argentina/argentina_edi_13.png :align: center - Fiscal Bond *********** + The Electronic Fiscal bond is used for those who invoice capital goods and wish to access the benefit of the Electronic Tax Bonds granted by the Ministry of Economy. @@ -437,7 +440,6 @@ For these transactions it’s important to have into consideration the next requ - Bonus. - VAT rate. - Electronic Credit Invoice MiPyme (FCE) ************************************** @@ -484,6 +486,7 @@ In the workflow we can have two scenarios: Invoice printed report ~~~~~~~~~~~~~~~~~~~~~~ + The PDF report related to electronic invoices that have been validated by the AFIP includes a barcode at the bottom of the format which represent the CAE number, the Expiration Date is also displayed as it’s legal requirement: @@ -491,9 +494,9 @@ also displayed as it’s legal requirement: .. image:: argentina/argentina_edi_14.png :align: center - Troubleshooting and Auditing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + For auditing and troubleshooting purposes you can get the detailed information of an invoice number that has been previously sent to the AFIP, @@ -503,14 +506,12 @@ invoice number that has been previously sent to the AFIP, .. image:: argentina/argentina_edi_24.png :align: center - You can also get the last number used in AFIP for a specific Document Type and POS Number as support for any possible issues on the sequence synchronization between Odoo and AFIP. .. image:: argentina/argentina_edi_22.png :align: center - Vendor Bills ------------ @@ -531,9 +532,9 @@ expected. The vendor bill number is structured in the same way that the invoices with the difference that the document sequence is input by the user: “Document Prefix - Letter - Document number". - Validate Vendor Bill number in AFIP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + As most companies have internal controls to verify that the vendor bill is related to an AFIP valid document, an automatic validation can be set in :menuselection:`Accounting --> Settings --> Argentinian Localization --> Validate document in the AFIP`, considering the following levels: @@ -549,6 +550,7 @@ Argentinian Localization --> Validate document in the AFIP`, considering the fol How to use it in Odoo ********************* + This tool incorporates in the vendor bill a new "Verify on AFIP" button located next to the AFIP Authorization code. @@ -561,11 +563,12 @@ displayed and the details of the validation will be added to the chatter. .. image:: argentina/argentina_edi_18.png :align: center - Special Use cases ~~~~~~~~~~~~~~~~~ + Untaxed Concepts **************** + There are some transactions that include items that are not part of the VAT base amount, this is commonly used in fuel and gasoline invoices. @@ -577,6 +580,7 @@ base amount and an additional item to register the amount of the Exempt concept Perception Taxes **************** + The vendor bill will be registered using 1 item for each product that is part of the VAT base amount, the perception tax can be added in any of the product lines, as result we will have one tax group for the VAT and one for the perception, the perception default @@ -593,7 +597,6 @@ and set the correct amount. After this is done the invoice can be validated. - Reports ======= diff --git a/content/applications/finance/fiscal_localizations/colombia.rst b/content/applications/finance/fiscal_localizations/colombia.rst index 70862b7de..760837841 100644 --- a/content/applications/finance/fiscal_localizations/colombia.rst +++ b/content/applications/finance/fiscal_localizations/colombia.rst @@ -22,14 +22,12 @@ requires the next modules: required for the Integration with Carvajal and generate the electronic invoice, based on the DIAN legal requirements. - Workflow ======== .. image:: colombia/colombia01.png :align: center - Configuration ============= @@ -42,7 +40,6 @@ filter and search for "Colombia". Then click on *Install* for the first two modu .. image:: colombia/colombia02.png :align: center - Configure credentials for Carvajal web service ---------------------------------------------- @@ -72,7 +69,6 @@ CSC is the default for new databases. Once that Odoo and Carvajal are fully configured and ready for production the testing environment can be disabled. - Configure your report data -------------------------- @@ -86,7 +82,6 @@ look for the *Colombian Electronic Invoice* section. .. image:: colombia/colombia04.png :align: center - Configure data required in the XML ---------------------------------- @@ -94,7 +89,7 @@ Partner ~~~~~~~ Identification -^^^^^^^^^^^^^^ +************** As part of the Colombian Localization, the document types defined by the DIAN are now available on the Partner form. Colombian partners @@ -108,9 +103,8 @@ have to have their identification number and document type set: will split this number when the data to the third party vendor is sent. - Fiscal structure (RUT) -^^^^^^^^^^^^^^^^^^^^^^ +********************** The partner's responsibility codes (section 53 in the RUT document) are included as part of the electronic invoice module given that is @@ -125,7 +119,6 @@ Purchase Tab --> Fiscal Information` Additionally two booleans fields were added in order to specify the fiscal regimen of the partner. - Taxes ~~~~~ @@ -143,7 +136,6 @@ to correctly display taxes in the invoice PDF. .. image:: colombia/colombia08.png :align: center - Journals ~~~~~~~~ @@ -162,7 +154,6 @@ should be configured and synchronized with the CEN Financiero. .. image:: colombia/colombia10.png :align: center - Users ~~~~~ @@ -173,7 +164,6 @@ configured: .. image:: colombia/colombia11.png :align: center - Usage and testing ================= @@ -183,7 +173,6 @@ Invoice When all your master data and credentials has been configured, it's possible to start testing the electronic invoice workflow. - Invoice creation ~~~~~~~~~~~~~~~~ @@ -206,7 +195,6 @@ There are three types of documents: this invoice is added to the ERP, this invoice type should be selected. - Invoice validation ~~~~~~~~~~~~~~~~~~ @@ -224,7 +212,6 @@ displayed with the Electronic Invoice status, with the initial value .. image:: colombia/colombia14.png :align: center - Reception of legal XML and PDF ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -247,7 +234,6 @@ After this: - The Electronic Invoice status changes to "Accepted" - Common errors ~~~~~~~~~~~~~ @@ -268,7 +254,6 @@ button: .. image:: colombia/colombia19.png :align: center - Additional use cases -------------------- diff --git a/content/applications/finance/fiscal_localizations/italy.rst b/content/applications/finance/fiscal_localizations/italy.rst index 98e369b7e..c7ab9788e 100644 --- a/content/applications/finance/fiscal_localizations/italy.rst +++ b/content/applications/finance/fiscal_localizations/italy.rst @@ -60,6 +60,7 @@ section, click :guilabel:`Update info`. From here, fill out the fields: PEC mail -------- + The **PEC email** is a specific type of **certified** email providing a legal equivalent to the traditional registered mail. The **PEC email** of the main company must be the same as the one registered by the **Agenzia delle Entrate** authorities. diff --git a/content/applications/finance/fiscal_localizations/netherlands.rst b/content/applications/finance/fiscal_localizations/netherlands.rst index df962850b..d86cb68d0 100644 --- a/content/applications/finance/fiscal_localizations/netherlands.rst +++ b/content/applications/finance/fiscal_localizations/netherlands.rst @@ -1,8 +1,9 @@ +=========== Netherlands =========== XAF Export ----------- +========== With the Dutch accounting localization installed, you will be able to export all your accounting entries in XAF format. For this, you have to @@ -11,13 +12,11 @@ define the entries you want to export using the filters (period, journals, ...) and then you click on the button **EXPORT (XAF)**. Dutch Accounting Reports ------------------------- +======================== If you install the Dutch accounting localization, you will have access to some reports that are specific to the Netherlands such as : - Profit & Loss - - Tax Report (Aangifte omzetbelasting) - - Intrastat Report (ICP) diff --git a/content/applications/finance/fiscal_localizations/peru.rst b/content/applications/finance/fiscal_localizations/peru.rst index d9ffaa62e..6768bd0ba 100644 --- a/content/applications/finance/fiscal_localizations/peru.rst +++ b/content/applications/finance/fiscal_localizations/peru.rst @@ -534,9 +534,8 @@ Advance Payments #. Reconcile the Credit note with the final invoice. #. The remaining balance on the final invoice should be paid with a regular payment transaction. - Detraction Invoices -******************** +******************* When creating invoices that is subject to Detractions, take into account the next considerations: @@ -579,9 +578,8 @@ To finish the workflow please follow the instructions on :doc:`our page about Cr .. note:: The EDI workflow for the Credit notes works in the same way as the invoices. - Debit Notes ------------- +----------- As part of the Peruvian localization, besides creating credit notes from an existing document you can also create debit Notes. For this just use the button “Add Debit Note”. diff --git a/content/applications/general/voip/asterisk.rst b/content/applications/general/voip/asterisk.rst index 7ecbb1f9b..7fbe2b77b 100644 --- a/content/applications/general/voip/asterisk.rst +++ b/content/applications/general/voip/asterisk.rst @@ -6,7 +6,7 @@ Installing Asterisk server ========================== Dependencies -~~~~~~~~~~~~ +------------ Before installing Asterisk you need to install the following dependencies: @@ -32,7 +32,8 @@ In order to install libsrtp, follow the instructions below: ./configure CFLAGS=-fPIC --prefix=/usr/local/lib make && make install -You also need to install PJSIP, you can download the source `here `_. Once the source directory is extracted: +You also need to install PJSIP, you can download the source `here +`_. Once the source directory is extracted: - **Change to the pjproject source directory:** @@ -83,9 +84,10 @@ You also need to install PJSIP, you can download the source `here /usr/lib/libpj.so Asterisk -~~~~~~~~ +-------- -- In order to install Asterisk 13.7.0, you can download the source directly `there `_. +- In order to install Asterisk 13.7.0, you can download the source directly `there + `_. - Extract Asterisk: @@ -111,7 +113,9 @@ Asterisk make menuselect -- In the menuselect, go to the resources option and ensure that res_srtp is enabled. If there are 3 x’s next to res_srtp, there is a problem with the srtp library and you must reinstall it. Save the configuration (press x). You should also see stars in front of the res_pjsip lines. +- In the menuselect, go to the resources option and ensure that res_srtp is enabled. If there are + 3 x’s next to res_srtp, there is a problem with the srtp library and you must reinstall it. Save + the configuration (press x). You should also see stars in front of the res_pjsip lines. - Compile and install Asterisk: @@ -119,10 +123,11 @@ Asterisk make && make install -- If you need the sample configs you can run 'make samples' to install the sample configs. If you need to install the Asterisk startup script you can run 'make config'. +- If you need the sample configs you can run 'make samples' to install the sample configs. If you + need to install the Asterisk startup script you can run 'make config'. DTLS Certificates -~~~~~~~~~~~~~~~~~ +----------------- - After you need to setup the DTLS certificates. @@ -136,7 +141,8 @@ DTLS Certificates cd /asterisk*/contrib/scripts -- Create the DTLS certificates (replace pbx.mycompany.com with your ip address or dns name, replace My Super Company with your company name): +- Create the DTLS certificates (replace pbx.mycompany.com with your ip address or dns name, replace + My Super Company with your company name): .. code-block:: console @@ -145,7 +151,9 @@ DTLS Certificates Configure Asterisk server ========================= -For WebRTC, a lot of the settings that are needed MUST be in the peer settings. The global settings do not flow down into the peer settings very well. By default, Asterisk config files are located in /etc/asterisk/. Start by editing http.conf and make sure that the following lines are uncommented: +For WebRTC, a lot of the settings that are needed MUST be in the peer settings. The global settings +do not flow down into the peer settings very well. By default, Asterisk config files are located in +/etc/asterisk/. Start by editing http.conf and make sure that the following lines are uncommented: .. code-block:: console @@ -155,7 +163,10 @@ For WebRTC, a lot of the settings that are needed MUST be in the peer settings. bindaddr=127.0.0.1 ; Replace this with your IP address bindport=8088 ; Replace this with the port you want to listen on -Next, edit sip.conf. The WebRTC peer requires encryption, avpf, and icesupport to be enabled. In most cases, directmedia should be disabled. Also under the WebRTC client, the transport needs to be listed as ‘ws’ to allow websocket connections. All of these config lines should be under the peer itself; setting these config lines globally might not work: +Next, edit sip.conf. The WebRTC peer requires encryption, avpf, and icesupport to be enabled. In +most cases, directmedia should be disabled. Also under the WebRTC client, the transport needs to be +listed as ‘ws’ to allow websocket connections. All of these config lines should be under the peer +itself; setting these config lines globally might not work: .. code-block:: console @@ -207,11 +218,13 @@ In Odoo, the configuration should be done in the user's preferences. .. image:: asterisk/voip_config01.png :align: center -- The SIP Login/Browser's Extension is the number you configured previously in the sip.conf file (in our example: 1060). +- The SIP Login/Browser's Extension is the number you configured previously in the sip.conf file (in + our example: 1060). - The SIP Password is the secret you chose in the sip.conf file. -- The extension of your office's phone is not a required field but it is used if you want to transfer your call from Odoo to an external phone also configured in the sip.conf file. +- The extension of your office's phone is not a required field but it is used if you want to + transfer your call from Odoo to an external phone also configured in the sip.conf file. The configuration should also be done in the General Settings under the "Integrations" section. @@ -221,4 +234,5 @@ The configuration should also be done in the General Settings under the "Integra - The PBX Server IP should be the same as the IP you define in the http.conf file. -- The WebSocket should be: ws://localhost:XXXX/ws where "localhost" needs to be the same as the IP defined previously and "XXXX" needs to be the port defined in the http.conf file. +- The WebSocket should be: ws://localhost:XXXX/ws where "localhost" needs to be the same as the IP + defined previously and "XXXX" needs to be the port defined in the http.conf file. diff --git a/content/applications/inventory_and_mrp/inventory/routes/concepts/cross_dock.rst b/content/applications/inventory_and_mrp/inventory/routes/concepts/cross_dock.rst index 35a0006ec..f2ff32ff6 100644 --- a/content/applications/inventory_and_mrp/inventory/routes/concepts/cross_dock.rst +++ b/content/applications/inventory_and_mrp/inventory/routes/concepts/cross_dock.rst @@ -15,7 +15,7 @@ to reorganize products and load another truck. `_ Configuration -============== +============= In the *Inventory* app, open :menuselection:`Configuration --> Settings` and activate the *Multi-Step Routes*. diff --git a/content/applications/inventory_and_mrp/inventory/routes/strategies/putaway.rst b/content/applications/inventory_and_mrp/inventory/routes/strategies/putaway.rst index 3a0b12b78..66de3e101 100644 --- a/content/applications/inventory_and_mrp/inventory/routes/strategies/putaway.rst +++ b/content/applications/inventory_and_mrp/inventory/routes/strategies/putaway.rst @@ -12,7 +12,7 @@ products are not stored close to each other because of a potential chemical reac putaway rules intervene, to avoid storing products wrongly. Configuration -============== +============= In the *Inventory* app, go to :menuselection:`Configuration --> Settings` and activate the *Multi-Step Routes*. By doing so, the *Storage Locations* will be automatically activated. @@ -21,7 +21,7 @@ In the *Inventory* app, go to :menuselection:`Configuration --> Settings` and ac :align: center Setting up a Putaway Rule -========================== +========================= In some cases, like for a retail shop storing vegetables and fruits, we have to store products in different locations to maintain product quality. diff --git a/content/applications/inventory_and_mrp/inventory/shipping/operation/labels.rst b/content/applications/inventory_and_mrp/inventory/shipping/operation/labels.rst index 3a3ded4ff..648626b90 100644 --- a/content/applications/inventory_and_mrp/inventory/shipping/operation/labels.rst +++ b/content/applications/inventory_and_mrp/inventory/shipping/operation/labels.rst @@ -81,8 +81,8 @@ Open the products you want to ship and set a weight on it. Don't forget to do the conversion if you are used to the imperial measurement system. -How to print shipping labels ? -=============================== +How to print shipping labels? +============================= The delivery order created from the sale order will take the shipping information from it, but you can change the carrier if you want to. diff --git a/content/applications/productivity/iot/config/connect.rst b/content/applications/productivity/iot/config/connect.rst index 4ec080244..1b1b472ba 100644 --- a/content/applications/productivity/iot/config/connect.rst +++ b/content/applications/productivity/iot/config/connect.rst @@ -18,18 +18,18 @@ Follow the steps to connect your IoT Box. :align: center Ethernet Connection -~~~~~~~~~~~~~~~~~~~ +=================== -1. Connect to the IoT Box all the devices that have to be connected with +#. Connect to the IoT Box all the devices that have to be connected with cables (ethernet, usb devices, etc.). -2. Power on the IoT Box. +#. Power on the IoT Box. -3. Read the Pairing Code from a screen or a receipt printer connected to the IoT Box. +#. Read the Pairing Code from a screen or a receipt printer connected to the IoT Box. .. image:: connect/connect04.png -4. Input the Pairing Code and click on the Pair button. +#. Input the Pairing Code and click on the Pair button. .. note:: Recent changes in modern web browsers forced us to modify the connection wizard. @@ -37,20 +37,20 @@ Ethernet Connection ``iot_pairing`` module is installed. WiFi Connection -~~~~~~~~~~~~~~~ +=============== -1. Power on the IoT Box +#. Power on the IoT Box -2. Copy the token +#. Copy the token .. image:: connect/connect05.png -3. Connect to the IoT Box WiFi Network (make sure there is no ethernet +#. Connect to the IoT Box WiFi Network (make sure there is no ethernet cable plugged in your computer). .. image:: connect/connect06.png -4. You will be redirected to the IoT Box Homepage (if it doesn't work, +#. You will be redirected to the IoT Box Homepage (if it doesn't work, connect to the IP address of the box). Give a name to your IoT Box (not required) and paste the token, then click on next. @@ -63,7 +63,7 @@ WiFi Connection should become **http://375228-saas-11-5-iot-f3f920-all.runbot16.odoo.com\|4957098401**). -5. Choose the WiFi network you want to connect with (enter the password +#. Choose the WiFi network you want to connect with (enter the password if there is one) and click on Submit. Wait a few seconds before being redirected to your database. @@ -75,7 +75,7 @@ You should now see the IoT Box. :align: center IoT Box Schema -~~~~~~~~~~~~~~ +============== .. image:: connect/connect10.png :align: center diff --git a/content/applications/productivity/iot/config/pos.rst b/content/applications/productivity/iot/config/pos.rst index 1d58960e3..4f9d804ef 100644 --- a/content/applications/productivity/iot/config/pos.rst +++ b/content/applications/productivity/iot/config/pos.rst @@ -3,10 +3,10 @@ Use the IoT Box for the PoS =========================== .. image:: pos/pos01.png - :align: center + :align: center Prerequisites -~~~~~~~~~~~~~ +============= Before starting, make sure you have the following: @@ -27,7 +27,7 @@ Before starting, make sure you have the following: page `__ Set Up -~~~~~~~ +====== To connect hardware to the PoS, the first step is to connect an IoT Box to your database. For this, follow this @@ -62,6 +62,6 @@ and select the devices you want to use in this Point of Sale. Save the changes. .. image:: pos/pos02.png - :align: center + :align: center Set up is done, you can launch a new PoS Session. diff --git a/content/applications/productivity/iot/config/troubleshooting.rst b/content/applications/productivity/iot/config/troubleshooting.rst index 6a41b6951..ecd655755 100644 --- a/content/applications/productivity/iot/config/troubleshooting.rst +++ b/content/applications/productivity/iot/config/troubleshooting.rst @@ -6,7 +6,7 @@ IoT Box Connection ================== I can't find the pairing code to connect my IoT Box -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------------------- The pairing code should be printed on receipt printers connected to the IoT Box and should also be displayed on connected monitors. @@ -30,7 +30,7 @@ has correctly started, by checking that a fixed green LED is showing next to the micro-USB port. I've connected my IoT Box but it's not showing in my database -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------------------------------------------- When you connect an IoT Box to a database, the IoT Box might restart, if that is the case, it might take up to one minute before appearing in your @@ -39,7 +39,7 @@ your database can be reached from the IoT Box and that your server doesn't use a multi-database environment. My IoT Box is connected to my database, but cannot be reached -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------------------------------------------- Make sure that the IoT Box and the device running the browser are located on the same network as the IoT Box cannot be reached from outside the local @@ -49,7 +49,7 @@ Printer ======= My printer is not detected -~~~~~~~~~~~~~~~~~~~~~~~~~~ +-------------------------- If one of your printers doesn't show up in your devices list, go to the IoT Box homepage and make sure that it is listed under *Printers*. @@ -63,7 +63,7 @@ If your printer is not present on the IoT Box homepage, hit not connected properly. My printer outputs random text -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------------ For most printers, the correct driver should be automatically detected and selected. However, in some cases, the automatic detection mechanism @@ -85,7 +85,7 @@ corresponding to your printer. printers. My Zebra Printer doesn't print anything -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------- Zebra printers are quite sensitive to the format of the ZPL code that is printed. If nothing comes out of the printer or blank labels are printed, @@ -97,7 +97,7 @@ Barcode Scanner =============== The characters read by the barcode scanner don't match the barcode -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------------------------------------------------ By default, we assume that your barcode scanner is configured in US QWERTY. This is the default configuration of most barcode readers. @@ -105,14 +105,14 @@ If your barcode scanner uses a different layout, please go to the form view of your device and select the correct one. Nothing happens when a barcode is scanned -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +----------------------------------------- Make sure that the correct device is selected in your Point of Sale configuration and that your barcode is configured to send an ENTER character (keycode 28) at the end of every barcode. The barcode scanner is detected as a keyboard -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------------- Some poorly built barcode scanners do not advertise themselves as barcode scanners but as a USB keyboard instead, and will not be @@ -128,7 +128,7 @@ Cashdrawer ========== The cashdrawer does not open -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +---------------------------- The cashdrawer should be connected to the printer and the *Cashdrawer* checkbox should be ticked in the POS configuration. diff --git a/content/applications/productivity/iot/devices/screen.rst b/content/applications/productivity/iot/devices/screen.rst index 99ef72652..189d533fa 100644 --- a/content/applications/productivity/iot/devices/screen.rst +++ b/content/applications/productivity/iot/devices/screen.rst @@ -10,9 +10,8 @@ connected, the screen can be used to display a :abbr:`PoS (Point of Sale)` order :alt: An example of a PoS (point of sale) order on a screen display. .. note:: - Access the customer display from any other computer by going to the :abbr:`IoT (Internet of Things)` - Box homepage and clicking on the :guilabel:`POS Display` button. - + Access the customer display from any other computer by going to the :abbr:`IoT (Internet of + Things)` Box homepage and clicking on the :guilabel:`POS Display` button. Connection ========== @@ -24,21 +23,22 @@ on the model. .. tab:: IoT Box model 4 - Connect up to two screens with Micro-HDMI cables on the side of the :abbr:`IoT (Internet of Things)` - Box. If two screens are connected, they can display distinct content (see usage below). + Connect up to two screens with Micro-HDMI cables on the side of the :abbr:`IoT (Internet of + Things)` Box. If two screens are connected, they can display distinct content (see usage + below). .. tab:: IoT Box model 3 Connect the screen with an HDMI cable on the side of the :abbr:`IoT (Internet of Things)` Box. .. important:: - Screen(s) should be connected before the :abbr:`IoT (Internet of Things)` Box is switched on. If it - is already on, connect the screen(s), and then restart the :abbr:`IoT (Internet of Things)` Box by - unplugging it and plugging it back into its power source. + Screen(s) should be connected before the :abbr:`IoT (Internet of Things)` Box is switched on. If + it is already on, connect the screen(s), and then restart the :abbr:`IoT (Internet of Things)` + Box by unplugging it and plugging it back into its power source. .. warning:: - The usage of HDMI/Micro-HDMI adapters may cause issues which will result in a blank, black screen on - the screen display. Cable usage is recommended. + The usage of HDMI/Micro-HDMI adapters may cause issues which will result in a blank, black screen + on the screen display. Cable usage is recommended. If the connection was successful, the screen should display the :guilabel:`POS Client display` screen. @@ -56,7 +56,8 @@ Things)` Box homepage. :alt: An example of a screen display name shown on the IoT Box homepage. .. note:: - If no screen is detected, a default display named :guilabel:`Distant Display` will be used instead. + If no screen is detected, a default display named :guilabel:`Distant Display` will be used + instead. .. image:: screen/screen-no-screen.png :align: center @@ -66,7 +67,7 @@ Usage ===== Show Point of Sales orders to customers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------- To use the screen in the :guilabel:`Point of Sale` app, go to :menuselection:`Point of Sale --> Configuration --> Point of Sale`, open the desired screen, click on :guilabel:`Edit`, and enable the @@ -84,17 +85,18 @@ in the top bar to inform the connection status with the screen. .. image:: screen/screen-pos-icon.png :align: center - :alt: The "screen" icon on the Point of Sale display shows the connection status with the screen. + :alt: The "screen" icon on the Point of Sale display shows the connection status with the + screen. -The screen will automatically show the :abbr:`PoS (Point of Sale)` orders and update when changes are -performed on the order. +The screen will automatically show the :abbr:`PoS (Point of Sale)` orders and update when changes +are performed on the order. .. image:: screen/screen-pos-client-display.png :align: center :alt: An example of a PoS order on a screen display. Display a website -~~~~~~~~~~~~~~~~~ +----------------- Opening the screen form view at :menuselection:`IoT --> Devices --> (screen device)` allows the user to choose a particular website URL to display on the screen with the :guilabel:`Screen URL` field. diff --git a/content/applications/productivity/studio/concepts/understanding_automated_actions.rst b/content/applications/productivity/studio/concepts/understanding_automated_actions.rst index 12a7bc12f..1170e04a2 100644 --- a/content/applications/productivity/studio/concepts/understanding_automated_actions.rst +++ b/content/applications/productivity/studio/concepts/understanding_automated_actions.rst @@ -53,7 +53,7 @@ For every Trigger option, **conditions** can be applied, such as: - *Send SMS Text Message*: sends an :doc:`SMS `. Example -~~~~~~~ +======= This is the process of which the update of the *Email* field on the Lead/Opportunity *Model*, with a *Trigger Condition* set to *On Update*, goes through: diff --git a/content/applications/sales/point_of_sale/payment/six.rst b/content/applications/sales/point_of_sale/payment/six.rst index 09dc060cd..0e42fd2b0 100644 --- a/content/applications/sales/point_of_sale/payment/six.rst +++ b/content/applications/sales/point_of_sale/payment/six.rst @@ -1,6 +1,6 @@ -==== +=== SIX -==== +=== Connecting a SIX payment terminal allows you to offer a fluid payment flow to your customers and ease the work of your cashiers. diff --git a/content/applications/sales/sales/advanced/portal.rst b/content/applications/sales/sales/advanced/portal.rst index 6e96aeb30..e46204499 100644 --- a/content/applications/sales/sales/advanced/portal.rst +++ b/content/applications/sales/sales/advanced/portal.rst @@ -1,6 +1,6 @@ -------------- +============= Portal access -------------- +============= Portal access is given to users who need the ability to view certain documents or information within an Odoo database. @@ -24,7 +24,8 @@ all of the following in Odoo: database. Provide portal access to customers ----------------------------------- +================================== + From the main Odoo dashboard, select the :guilabel:`Contacts` application. If the contact is not yet created in the database, click on the :guilabel:`Create` button, enter the details of the contact, and then click :guilabel:`Save`. Otherwise, choose an existing contact, and then click on diff --git a/content/applications/sales/sales/products_prices/prices/pricing.rst b/content/applications/sales/sales/products_prices/prices/pricing.rst index 306e835a0..8fa826ffc 100644 --- a/content/applications/sales/sales/products_prices/prices/pricing.rst +++ b/content/applications/sales/sales/products_prices/prices/pricing.rst @@ -4,7 +4,8 @@ How to adapt your prices to your customers and apply discounts Odoo has a powerful pricelist feature to support a pricing strategy tailored to your business. A pricelist is a list of prices or price rules that Odoo searches to determine the suggested price. -You can set several critarias to use a specific price: periods, min. sold quantity (meet a minimum order quantity and get a price break), etc. +You can set several critarias to use a specific price: periods, min. sold quantity (meet a minimum +order quantity and get a price break), etc. As pricelists only suggest prices, they can be overridden by vendors completing sales orders. Choose your pricing strategy from :menuselection:`Sales --> Settings`. @@ -14,10 +15,10 @@ Choose your pricing strategy from :menuselection:`Sales --> Settings`. :align: center .. note:: - - * *A single sale price per product :* doesn't let you adapt prices, it use default product price ; - * *Different prices per customer segment :* you will set several prices per products ; - * *Advanced pricing based on formula :* will let you apply discounts, margins and roundings. + * *A single sale price per product:* doesn't let you adapt prices, it use default product + price ; + * *Different prices per customer segment:* you will set several prices per products ; + * *Advanced pricing based on formula:* will let you apply discounts, margins and roundings. Several prices per product ========================== @@ -81,16 +82,16 @@ use e-Commerce). .. image:: pricing/pricing_formula.png :align: center -Each pricelist item can be associated to either all products, to a product internal category (set of products) or to a specific product. Like in second option, you can set dates and minimum quantities. +Each pricelist item can be associated to either all products, to a product internal category (set of +products) or to a specific product. Like in second option, you can set dates and minimum quantities. .. image:: pricing/pricelist_apply.png :align: center .. note:: - - * Once again the system is smart. If a rule is set for a particular item and another one for its category, Odoo will take the rule of the item. - - * Make sure at least one pricelist item covers all your products. + * Once again the system is smart. If a rule is set for a particular item and another one for its + category, Odoo will take the rule of the item. + * Make sure at least one pricelist item covers all your products. There are 3 modes of computation: fix price, discount & formula. @@ -117,8 +118,10 @@ e.g. sale price = 2*cost (100% markup) with $5 of minimal margin. Prices per country ================== -Pricelists can be set by countries group. -Any new customer recorded in Odoo gets a default pricelist, i.e. the first one in the list matching the country. In case no country is set for the customer, Odoo takes the first pricelist without any country group. + +Pricelists can be set by countries group. Any new customer recorded in Odoo gets a default +pricelist, i.e. the first one in the list matching the country. In case no country is set for the +customer, Odoo takes the first pricelist without any country group. The default pricelist can be replaced when creating a sales order. @@ -127,9 +130,11 @@ The default pricelist can be replaced when creating a sales order. Compute and show discount % to customers ======================================== -In case of discount, you can show the public price and the computed discount % on printed sales orders and in your eCommerce catalog. To do so: +In case of discount, you can show the public price and the computed discount % on printed sales +orders and in your eCommerce catalog. To do so: -* Check *Allow discounts on sales order lines* in :menuselection:`Sales --> Configuration --> Settings --> Quotations & Sales --> Discounts`. +* Check *Allow discounts on sales order lines* in :menuselection:`Sales --> Configuration --> + Settings --> Quotations & Sales --> Discounts`. * Apply the option in the pricelist setup form. .. image:: pricing/discount_options.png diff --git a/content/applications/services/fsm/helpdesk/plan_onsite.rst b/content/applications/services/fsm/helpdesk/plan_onsite.rst index bcba22eac..8e42a55c5 100644 --- a/content/applications/services/fsm/helpdesk/plan_onsite.rst +++ b/content/applications/services/fsm/helpdesk/plan_onsite.rst @@ -1,11 +1,13 @@ -================================================ +=============================================== Plan onsite interventions from helpdesk tickets -================================================ +=============================================== + The integration with the Helpdesk app lets your helpdesk team manage intervention requests directly. Planning field service tasks from tickets speeds up your processes. Configure the helpdesk team =========================== + Go to :menuselection:`Helpdesk --> Configuration --> Helpdesk Teams`. Select a team and enable *Onsite Interventions*. diff --git a/content/applications/services/fsm/sales/onsite_tasks_from_sales_orders.rst b/content/applications/services/fsm/sales/onsite_tasks_from_sales_orders.rst index fbb92b22e..ec887759c 100644 --- a/content/applications/services/fsm/sales/onsite_tasks_from_sales_orders.rst +++ b/content/applications/services/fsm/sales/onsite_tasks_from_sales_orders.rst @@ -1,21 +1,19 @@ ============================================= Create onsite interventions from sales orders ============================================= + Allowing your sales team to open onsite interventions creates a seamless experience for your customers. They can receive a quotation they first have to approve before the work even starts. Configure a product =================== + Go to :menuselection:`Field Service --> Configuration --> Products` and create or edit a product. #. Under the *General Information* tab, select *Service* as *Product Type*. - #. Under the *Sales* tab, select *Timesheets on tasks* as *Service Invoicing Policy*. - #. Select *Create a task in an existing project* as *Service Tracking*. - #. Select your *Project*. - #. If you use them, select your *Worksheet Template* and then click on *Save*. .. image:: onsite_tasks_from_sales_orders/product-configuration-tasks-from-sales-orders.png diff --git a/content/applications/services/helpdesk/overview/reports.rst b/content/applications/services/helpdesk/overview/reports.rst index 183e8946b..f9494eb72 100644 --- a/content/applications/services/helpdesk/overview/reports.rst +++ b/content/applications/services/helpdesk/overview/reports.rst @@ -7,7 +7,7 @@ track trends, identify areas for improvement, manage employees’ workloads and, meet your customer’s expectations. Cases -~~~~~ +===== Some examples of the reports Odoo Helpdesk can generate include: @@ -45,7 +45,7 @@ customers not only expect fast responses but they also want their issues to be h Odoo Helpdesk Save filters -~~~~~~~~~~~~ +============ Save the filters you use the most and avoid having to reconstruct them every time they are needed. To do so, set the groups, filters, and measures needed. Then, go to *Favorites*. diff --git a/content/applications/websites/ecommerce/getting_started.rst b/content/applications/websites/ecommerce/getting_started.rst index 86028aff6..006df7d3a 100644 --- a/content/applications/websites/ecommerce/getting_started.rst +++ b/content/applications/websites/ecommerce/getting_started.rst @@ -1,8 +1,8 @@ :nosearch: -================= +=========== Get started -================= +=========== .. toctree:: :titlesonly: diff --git a/content/applications/websites/ecommerce/getting_started/catalog.rst b/content/applications/websites/ecommerce/getting_started/catalog.rst index 30da338b0..7d7ac60e2 100644 --- a/content/applications/websites/ecommerce/getting_started/catalog.rst +++ b/content/applications/websites/ecommerce/getting_started/catalog.rst @@ -1,6 +1,6 @@ -================================== +================================ How to customize my catalog page -================================== +================================ Product Catalog =============== diff --git a/content/applications/websites/ecommerce/getting_started/product_page.rst b/content/applications/websites/ecommerce/getting_started/product_page.rst index c3266c241..198acca29 100644 --- a/content/applications/websites/ecommerce/getting_started/product_page.rst +++ b/content/applications/websites/ecommerce/getting_started/product_page.rst @@ -1,6 +1,6 @@ -============================ +=========================== How to build a product page -============================ +=========================== On the website click *New Page* in the top-right corner. @@ -23,9 +23,9 @@ See how to configure your products from links here below. .. seealso:: - * :doc:`../managing_products/variants` - * :doc:`/applications/sales/sales/products_prices/taxes` - * :doc:`../maximizing_revenue/cross_selling` - * :doc:`../maximizing_revenue/reviews` - * :doc:`../maximizing_revenue/pricing` - * :doc:`../../website/optimize/seo` + - :doc:`../managing_products/variants` + - :doc:`/applications/sales/sales/products_prices/taxes` + - :doc:`../maximizing_revenue/cross_selling` + - :doc:`../maximizing_revenue/reviews` + - :doc:`../maximizing_revenue/pricing` + - :doc:`../../website/optimize/seo` diff --git a/content/applications/websites/ecommerce/shopper_experience/portal.rst b/content/applications/websites/ecommerce/shopper_experience/portal.rst index 00b7b15ce..820dc6346 100644 --- a/content/applications/websites/ecommerce/shopper_experience/portal.rst +++ b/content/applications/websites/ecommerce/shopper_experience/portal.rst @@ -1,6 +1,6 @@ -================================================= +=============================================== How customers can access their customer account -================================================= +=============================================== It has never been so easy for your customers to access their customer account. Forget endless signup forms, diff --git a/content/applications/websites/ecommerce/taxes.rst b/content/applications/websites/ecommerce/taxes.rst index be7c9e72d..d5928eb26 100644 --- a/content/applications/websites/ecommerce/taxes.rst +++ b/content/applications/websites/ecommerce/taxes.rst @@ -1,8 +1,8 @@ :nosearch: -================= +============= Collect taxes -================= +============= .. toctree:: :titlesonly: diff --git a/content/applications/websites/website/optimize/seo.rst b/content/applications/websites/website/optimize/seo.rst index 4151d7102..c6cfbd09f 100644 --- a/content/applications/websites/website/optimize/seo.rst +++ b/content/applications/websites/website/optimize/seo.rst @@ -33,10 +33,11 @@ finetune them. Make sure they fit the content of the page, otherwise you will be downgraded by search engines. .. image:: seo/seo01.png - :align: center + :align: center Keywords -------- + In order to write quality content and boost your traffic, Odoo provides a ```` finder. Those keywords are the searches you want to head towards your website. For each keyword, you see how it is used in the content @@ -44,7 +45,7 @@ towards your website. For each keyword, you see how it is used in the content searches in Google. The more keywords are used the better. .. image:: seo/seo02.png - :align: center + :align: center .. note:: If your website is in multiple languages, you can use the Promote @@ -93,7 +94,7 @@ Odoo allows to link all your social network accounts in your website footer. All you have to do is to refer all your accounts in your company settings. .. image:: seo/seo03.png - :align: center + :align: center Social Share ------------ @@ -103,14 +104,14 @@ By clicking the icon, they are prompted to share the page in their social media wall. .. image:: seo/seo04.png - :align: center + :align: center Most social media use a picture of the picture to decorate the share post. Odoo uses the website logo by default but you can choose any other image of your page in the Promote tool. .. image:: seo/seo05.png - :align: center + :align: center Facebook Page ------------- @@ -564,7 +565,7 @@ CMS and eCommerce (Drupal, Wordpress, Magento, Prestashop). Here is the slide that summarizes the scalability of Odoo Website & eCommerce. .. image:: seo/seo13.png - :align: center + :align: center Search Engines Files ==================== @@ -615,7 +616,7 @@ pages to be displayed in Google using extra information like the price and rating of a product: .. image:: seo/seo14.png - :align: center + :align: center robots.txt ---------- diff --git a/content/applications/websites/website/publish/on-premise_geo-ip-installation.rst b/content/applications/websites/website/publish/on-premise_geo-ip-installation.rst index 66e0fb797..081358896 100644 --- a/content/applications/websites/website/publish/on-premise_geo-ip-installation.rst +++ b/content/applications/websites/website/publish/on-premise_geo-ip-installation.rst @@ -42,6 +42,7 @@ Installation How To Test GeoIP Geolocation In Your Odoo Website ================================================== + 1. Go to your website. Open the web page that you want to test ``GeoIP``. 2. Choose :menuselection:`Customize --> HTML/CSS/JS Editor`. 3. Add the following piece of XML in the page : @@ -58,7 +59,9 @@ You should end up with a dictionary indicating the location of the IP address. .. note:: If the curly braces are empty ``{}``, it can be for any of the following reasons : - - The browsing IP address is the localhost (``127.0.0.1``) or a local area network one (``192.168.*.*``) - - If a reversed proxy is used, make sure to configure it correctly. See :option:`proxy mode ` + - The browsing IP address is the localhost (``127.0.0.1``) or a local area network one + (``192.168.*.*``) + - If a reversed proxy is used, make sure to configure it correctly. See :option:`proxy mode + ` - ``geoip2`` is not installed or the GeoIP database file wasn't found - The GeoIP database was unable to resolve the given IP address diff --git a/content/applications/websites/website/publish/translate.rst b/content/applications/websites/website/publish/translate.rst index 9b38e4680..18744008f 100644 --- a/content/applications/websites/website/publish/translate.rst +++ b/content/applications/websites/website/publish/translate.rst @@ -1,6 +1,6 @@ -=============================== +=========================== How to translate my website -=============================== +=========================== Overview ======== diff --git a/content/contributing/development/coding_guidelines.rst b/content/contributing/development/coding_guidelines.rst index 0e7222fd1..d699c7f21 100644 --- a/content/contributing/development/coding_guidelines.rst +++ b/content/contributing/development/coding_guidelines.rst @@ -30,6 +30,7 @@ Module structure Directories ----------- + A module is organized in important directories. Those contain the business logic; having a look at them should make you understand the purpose of the module. @@ -242,6 +243,7 @@ XML files Format ------ + To declare a record in XML, the **record** notation (using **) is recommended: - Place ``id`` attribute before ``model`` @@ -408,6 +410,7 @@ source code tries to respect Python standard, but some of them can be ignored. Imports ------- + The imports are ordered as #. External libraries (one per line sorted and split in python stdlib) @@ -586,9 +589,9 @@ Programming in Odoo - As in python, use ``filtered``, ``mapped``, ``sorted``, ... methods to ease code reading and performance. - Make your method work in batch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + When adding a function, make sure it can process multiple records by iterating on self to treat each record. @@ -614,6 +617,7 @@ is recommended to use ``read_group`` method, to compute all value in only one re Propagate the context ~~~~~~~~~~~~~~~~~~~~~ + The context is a ``frozendict`` that cannot be modified. To call a method with a different context, the ``with_context`` method should be used : @@ -636,7 +640,6 @@ choose a good name, and eventually prefix it by the name of the module to isolate its impact. A good example are the keys of ``mail`` module : *mail_create_nosubscribe*, *mail_notrack*, *mail_notify_user_signature*, ... - Think extendable ~~~~~~~~~~~~~~~~ @@ -680,9 +683,9 @@ the starting point of readable/maintainable code and tighter documentation. This recommendation is also relevant for classes, files, modules and packages. (See also http://en.wikipedia.org/wiki/Cyclomatic_complexity) - Never commit the transaction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The Odoo framework is in charge of providing the transactional context for all RPC calls. The principle is that a new database cursor is opened at the beginning of each RPC call, and committed when the call has returned, just @@ -748,7 +751,6 @@ have an **explicit comment** explaining why they are absolutely necessary, why they are indeed correct, and why they do not break the transactions. Otherwise they can and will be removed ! - Use translation method correctly ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -837,7 +839,6 @@ In general in Odoo, when manipulating strings, prefer ``%`` over ``.format()`` of position (when multiple variables have to be replaced). This makes the translation easier for the community translators. - Symbols and Conventions ----------------------- @@ -951,7 +952,7 @@ Javascript and CSS ================== Static files organization --------------------------- +------------------------- Odoo addons have some conventions on how to structure various files. We explain here in more details how web assets are supposed to be organized. diff --git a/content/contributing/development/git_guidelines.rst b/content/contributing/development/git_guidelines.rst index 7ac4202a2..426956db0 100644 --- a/content/contributing/development/git_guidelines.rst +++ b/content/contributing/development/git_guidelines.rst @@ -1,6 +1,6 @@ -================= +============== Git guidelines -================= +============== Configure your git ------------------ diff --git a/content/developer/api/extract_api.rst b/content/developer/api/extract_api.rst index 018043347..0207b529a 100644 --- a/content/developer/api/extract_api.rst +++ b/content/developer/api/extract_api.rst @@ -1,8 +1,8 @@ :code-column: -=============== +=========== Extract API -=============== +=========== Odoo provides a service allowing you to automate the processing of your invoices. The service scans your document using an Optical Character Recognition (OCR) engine and then uses AI-based algorithms to extract the fields of interest such as the total, the due date, or @@ -15,6 +15,7 @@ allows you to integrate our service directly into your own projects. Invoices ======== + The extract API use the JSON-RPC2_ protocol. The diffent routes are located at the following address: **https://iap-extract.odoo.com**. Expected successful flow @@ -36,14 +37,15 @@ Routes .. _webservices/extract_api/invoice_parse: ``/iap/invoice_extract/parse`` -'''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Description -^^^^^^^^^^^ +*********** + Request a processing of the document from the OCR. The route will return a `document_id` you can use to obtain the result of your request. Request Body -^^^^^^^^^^^^ +************ ``jsonrpc`` (required) Must be exactly “2.0”. @@ -97,7 +99,7 @@ Request Body } Response -^^^^^^^^ +******** ``jsonrpc`` A string specifying the version of the JSON-RPC protocol. It will be “2.0”. @@ -139,14 +141,15 @@ Response .. _webservices/extract_api/invoice_get_results: ``/iap/invoice_extract/get_results`` -'''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Description -^^^^^^^^^^^ +*********** + Request the results of the documents ids obtained with the :ref:`/parse ` route. Can either return the results or a "request pending" message. Request Body -^^^^^^^^^^^^ +************ ``jsonrpc`` (required) |SAME_AS_PARSE| @@ -174,7 +177,7 @@ Request Body } Response -^^^^^^^^ +******** ``jsonrpc`` |SAME_AS_PARSE| @@ -231,7 +234,7 @@ Response .. _webservices/extract_api/invoice_get_results/feature_result: ``feature_result`` -'''''''''''''''''' +~~~~~~~~~~~~~~~~~~ Each field of interest we want to extract from the invoice such as the total or the due date are also called features. An exhaustive list of all the extracted features can be found in the table below. @@ -252,7 +255,7 @@ For each feature, we return a list of candidates and we spotlight the candidate ``candidate`` -''''''''''''' +~~~~~~~~~~~~~ For each candidate we give its representation and position in the document. Candidates are sorted by decreasing order of suitability. @@ -326,7 +329,7 @@ For each candidate we give its representation and position in the document. Cand +-------------------------+------------------------------------------------------------------------------------+ ``feature_result`` for the ``invoice_lines`` feature -'''''''''''''''''''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It follows a more specific structure. It is basically a list of dictionaries where each dictionary represents an invoice line. Each value follows a :ref:`webservices/extract_api/invoice_get_results/feature_result` structure. @@ -353,15 +356,16 @@ a :ref:`webservices/extract_api/invoice_get_results/feature_result` structure. .. _webservices/extract_api/invoice_validate: ``/iap/invoice_extract/validate`` -''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Description -^^^^^^^^^^^ +*********** + Route that validates the different features of an invoice. The validation step is an optional step but is strongly recommended. By telling the system if it were right or wrong for each feature you give an important feedback. It has no direct impact but it helps the system to greatly improve its prediction accuracy for the invoices you will send in the future. Request Body -^^^^^^^^^^^^ +************ ``jsonrpc`` (required) |SAME_AS_PARSE| @@ -395,7 +399,7 @@ Request Body } ``validation`` -'''''''''''''' +~~~~~~~~~~~~~~ A **validation** for a given feature is a dictionary containing the textual representation of the expected value for this given feature. This format apply for all the features except for ``global_taxes`` and ``invoice_lines`` which have more complex validation format. @@ -406,7 +410,7 @@ This format apply for all the features except for ``global_taxes`` and ``invoice { "content": string|float } validation for ``global_taxes`` -''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **content** is a list of dictionaries. Each dictionary represents a tax: @@ -433,7 +437,7 @@ validation for ``global_taxes`` ]} validation for ``invoice_lines`` -'''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **lines** is a list of dictionaries. Each dictionary represents an invoice line. The dictionary keys speak for themselves. diff --git a/content/developer/cli.rst b/content/developer/cli.rst index 0ad90d2bc..546bd3a95 100644 --- a/content/developer/cli.rst +++ b/content/developer/cli.rst @@ -1,4 +1,3 @@ - .. _reference/cmdline: ============================ @@ -290,7 +289,7 @@ Advanced Options .. _reference/cmdline/dev: Developer features -'''''''''''''''''' +~~~~~~~~~~~~~~~~~~ .. option:: --dev @@ -312,7 +311,7 @@ Developer features .. _reference/cmdline/server/http: HTTP -'''' +~~~~ .. option:: --no-http @@ -347,7 +346,7 @@ HTTP .. _reference/cmdline/server/logging: Logging -''''''' +~~~~~~~ By default, Odoo displays all logging of level_ ``info`` except for workflow logging (``warning`` only), and log output is sent to ``stdout``. Various @@ -442,7 +441,7 @@ customize the amount of logging output. .. _reference/cdmline/workers: Multiprocessing -''''''''''''''' +~~~~~~~~~~~~~~~ .. option:: --workers @@ -716,7 +715,7 @@ Processed files .. _reference/cmdline/cloc/database-option: With the :option:`--database` option -'''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Odoo Cloc counts the lines in each file of extra installed modules in a given database. In addition, it counts the Python lines of server actions and @@ -747,12 +746,10 @@ per module. This is specified by the ``cloc_exclude`` entry of the manifest: | For more information about the pattern syntax, see `glob `_. - - .. _reference/cmdline/cloc/path-option: With the :option:`--path` option -'''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This method works the same as with the :ref:`--database option ` if a manifest file is present in the given @@ -775,7 +772,7 @@ Some file cannot be counted by Odoo Cloc. Those file are reported at the end of the output. Max file size exceeded -'''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~ Odoo Cloc rejects any file larger than 25MB. Usually, source files are smaller than 1 MB. If a file is rejected, it may be: @@ -784,7 +781,7 @@ than 1 MB. If a file is rejected, it may be: - A JavaScript library that should be placed in the :file:`static/lib` folder. Syntax Error -'''''''''''' +~~~~~~~~~~~~ Odoo Cloc cannot count the lines of code of a Python file with a syntax problem. If an extra module contains such files, they should be fixed to allow the module to diff --git a/content/developer/howtos/backend.rst b/content/developer/howtos/backend.rst index e94ae6edd..3de35c726 100644 --- a/content/developer/howtos/backend.rst +++ b/content/developer/howtos/backend.rst @@ -7,8 +7,7 @@ Building a Module ================= .. warning:: - - This tutorial requires :ref:`having installed Odoo ` + This tutorial requires :ref:`having installed Odoo ` Start/Stop the Odoo server ========================== @@ -26,7 +25,7 @@ necessary: .. code:: bash - odoo-bin + odoo-bin The server is stopped by hitting ``Ctrl-C`` twice from the terminal, or by killing the corresponding OS process. @@ -78,10 +77,10 @@ are specified by using the :option:`--addons-path ` option. .. tip:: - :class: aphorism + :class: aphorism - most command-line options can also be set using :ref:`a configuration - file ` + most command-line options can also be set using :ref:`a configuration file + ` An Odoo module is declared by its :ref:`manifest `. @@ -101,7 +100,7 @@ Odoo provides a mechanism to help set up a new module, :ref:`odoo-bin .. code-block:: console - $ odoo-bin scaffold + $ odoo-bin scaffold The command creates a subdirectory for your module, and automatically creates a bunch of standard files for a module. Most of them simply contain commented code @@ -109,8 +108,7 @@ or XML. The usage of most of those files will be explained along this tutorial. .. exercise:: Module creation - Use the command line above to create an empty module Open Academy, and - install it in Odoo. + Use the command line above to create an empty module Open Academy, and install it in Odoo. Object-Relational Mapping ------------------------- @@ -147,7 +145,7 @@ defined as attributes on the model class:: name = fields.Char() Common Attributes -################# +~~~~~~~~~~~~~~~~~ Much like the model itself, its fields can be configured, by passing configuration attributes as parameters:: @@ -167,7 +165,7 @@ Some attributes are available on all fields, here are the most common ones: Requests that Odoo create a `database index`_ on the column. Simple fields -############# +~~~~~~~~~~~~~ There are two broad categories of fields: "simple" fields which are atomic values stored directly in the model's table and "relational" fields linking @@ -177,7 +175,7 @@ Example of simple fields are :class:`~odoo.fields.Boolean`, :class:`~odoo.fields.Date`, :class:`~odoo.fields.Char`. Reserved fields -############### +~~~~~~~~~~~~~~~ Odoo creates a few fields in all models\ [#autofields]_. These fields are managed by the system and shouldn't be written to. They can be read if @@ -195,7 +193,7 @@ useful or necessary: user who last modified the record. Special fields -############## +~~~~~~~~~~~~~~ By default, Odoo also requires a ``name`` field on all models for various display and search behaviors. The field used for these purposes can be @@ -203,8 +201,8 @@ overridden by setting :attr:`~odoo.models.Model._rec_name`. .. exercise:: Define a model - Define a new data model *Course* in the *openacademy* module. A course - has a title and a description. Courses must have a title. + Define a new data model *Course* in the *openacademy* module. A course has a title and a + description. Courses must have a title. Data files ---------- @@ -213,7 +211,7 @@ Odoo is a highly data driven system. Although behavior is customized using Python_ code part of a module's value is in the data it sets up when loaded. .. tip:: some modules exist solely to add data into Odoo - :class: aphorism + :class: aphorism Module data is declared via :ref:`data files `, XML files with ```` elements. Each ```` element creates or updates a database @@ -221,13 +219,13 @@ record. .. code-block:: xml - + - - {a value} - + + {a value} + - + * ``model`` is the name of the Odoo model for the record. * ``id`` is an :term:`external identifier`, it allows referring to the record @@ -241,15 +239,13 @@ be declared in the ``'data'`` list (always loaded) or in the ``'demo'`` list .. exercise:: Define demonstration data - Create demonstration data filling the *Courses* model with a few - demonstration courses. + Create demonstration data filling the *Courses* model with a few demonstration courses. -.. tip:: The content of the data files is only loaded when a module is - installed or updated. +.. tip:: + The content of the data files is only loaded when a module is installed or updated. - After making some changes, do not forget to use - :ref:`odoo-bin -u openacademy ` to save the changes - to your database. + After making some changes, do not forget to use :ref:`odoo-bin -u openacademy + ` to save the changes to your database. .. _howtos/module/actions: @@ -269,29 +265,29 @@ action more easily. .. code-block:: xml - - Ideas - idea.idea - tree,form - - + + Ideas + idea.idea + tree,form + + .. danger:: - :class: aphorism + :class: aphorism - The action must be declared before its corresponding menu in the XML file. + The action must be declared before its corresponding menu in the XML file. - Data files are executed sequentially, the action's ``id`` must be present - in the database before the menu can be created. + Data files are executed sequentially, the action's ``id`` must be present in the database before + the menu can be created. .. exercise:: Define new menu entries - Define new menu entries to access courses under the - OpenAcademy menu entry. A user should be able to : + Define new menu entries to access courses under the OpenAcademy menu entry. A user should be able + to: - - display a list of all the courses - - create/modify courses + - display a list of all the courses + - create/modify courses Basic views =========== @@ -315,20 +311,19 @@ is implied by the root element of the ``arch`` field: .. code-block:: xml - - view.name - object_name - - - - - + + view.name + object_name + + + + + .. danger:: The view's content is XML. - :class: aphorism + :class: aphorism - The ``arch`` field must thus be declared as ``type="xml"`` to be parsed - correctly. + The ``arch`` field must thus be declared as ``type="xml"`` to be parsed correctly. Tree views ---------- @@ -384,40 +379,39 @@ elements (groups, notebooks) and interactive elements (buttons and fields): .. exercise:: Customise form view using XML - Create your own form view for the Course object. Data displayed should be: - the name and the description of the course. + Create your own form view for the Course object. Data displayed should be: the name and the + description of the course. .. exercise:: Notebooks - In the Course form view, put the description field under a tab, such that - it will be easier to add other tabs later, containing additional - information. + In the Course form view, put the description field under a tab, such that it will be easier to + add other tabs later, containing additional information. Form views can also use plain HTML for more flexible layouts: .. code-block:: xml -
-
-
- -
-
- - - - -
-
+
+
+
+ +
+
+ + + + +
+
Search views ------------ @@ -428,17 +422,17 @@ composed of fields defining which fields can be searched on: .. code-block:: xml - - - - + + + + If no search view exists for the model, Odoo generates one which only allows searching on the ``name`` field. .. exercise:: Search courses - Allow searching for courses based on their title or their description. + Allow searching for courses based on their title or their description. Relations between models ======================== @@ -449,12 +443,12 @@ client data; it is also related to its sale order line records. .. exercise:: Create a session model - For the module Open Academy, we consider a model for *sessions*: a session - is an occurrence of a course taught at a given time for a given audience. + For the module Open Academy, we consider a model for *sessions*: a session + is an occurrence of a course taught at a given time for a given audience. - Create a model for *sessions*. A session has a name, a start date, a - duration and a number of seats. Add an action and a menu item to display - them. Make the new model visible via a menu item. + Create a model for *sessions*. A session has a name, a start date, a + duration and a number of seats. Add an action and a menu item to display + them. Make the new model visible via a menu item. Relational fields ----------------- @@ -481,9 +475,9 @@ Relational field types are: .. danger:: - Because a :class:`~odoo.fields.One2many` is a virtual relationship, - there *must* be a :class:`~odoo.fields.Many2one` field in the - :samp:`{other_model}`, and its name *must* be :samp:`{related_field}` + Because a :class:`~odoo.fields.One2many` is a virtual relationship, + there *must* be a :class:`~odoo.fields.Many2one` field in the + :samp:`{other_model}`, and its name *must* be :samp:`{related_field}` :class:`Many2many(other_model) ` Bidirectional multiple relationship, any record on one side can be related @@ -495,28 +489,28 @@ Relational field types are: .. exercise:: Many2one relations - Using a many2one, modify the *Course* and *Session* models to reflect their - relation with other models: + Using a many2one, modify the *Course* and *Session* models to reflect their + relation with other models: - - A course has a *responsible* user; the value of that field is a record of - the built-in model ``res.users``. - - A session has an *instructor*; the value of that field is a record of the - built-in model ``res.partner``. - - A session is related to a *course*; the value of that field is a record - of the model ``openacademy.course`` and is required. - - Adapt the views. + - A course has a *responsible* user; the value of that field is a record of + the built-in model ``res.users``. + - A session has an *instructor*; the value of that field is a record of the + built-in model ``res.partner``. + - A session is related to a *course*; the value of that field is a record + of the model ``openacademy.course`` and is required. + - Adapt the views. .. exercise:: Inverse one2many relations - Using the inverse relational field one2many, modify the models to reflect - the relation between courses and sessions. + Using the inverse relational field one2many, modify the models to reflect + the relation between courses and sessions. .. exercise:: Multiple many2many relations - Using the relational field many2many, modify the *Session* model to relate - every session to a set of *attendees*. Attendees will be represented by - partner records, so we will relate to the built-in model ``res.partner``. - Adapt the views accordingly. + Using the relational field many2many, modify the *Session* model to relate + every session to a set of *attendees*. Attendees will be represented by + partner records, so we will relate to the built-in model ``res.partner``. + Adapt the views accordingly. Inheritance =========== @@ -541,12 +535,11 @@ model to a record in a parent model, and provides transparent access to the fields of the parent record. .. image:: ../reference/addons/orm/inheritance_methods.png - :align: center + :align: center .. seealso:: - - * :attr:`~odoo.models.Model._inherit` - * :attr:`~odoo.models.Model._inherits` + * :attr:`~odoo.models.Model._inherit` + * :attr:`~odoo.models.Model._inherits` View inheritance ---------------- @@ -561,19 +554,19 @@ instead of a single view its ``arch`` field is composed of any number of .. code-block:: xml - - - id.category.list2 - idea.category - - - - - - - - + + + id.category.list2 + idea.category + + + + + + + + ``expr`` An XPath_ expression selecting a single element in the parent view. @@ -595,30 +588,29 @@ instead of a single view its ``arch`` field is composed of any number of ``attribute`` elements in the ``xpath``'s body .. tip:: - - When matching a single element, the ``position`` attribute can be set directly - on the element to be found. Both inheritances below will give the same result. + When matching a single element, the ``position`` attribute can be set directly + on the element to be found. Both inheritances below will give the same result. .. code-block:: xml - - - + + + - - - + + + .. exercise:: Alter existing content - * Using model inheritance, modify the existing *Partner* model to add an - ``instructor`` boolean field, and a many2many field that corresponds to - the session-partner relation - * Using view inheritance, display this fields in the partner form view + * Using model inheritance, modify the existing *Partner* model to add an + ``instructor`` boolean field, and a many2many field that corresponds to + the session-partner relation + * Using view inheritance, display this fields in the partner form view Domains -####### +~~~~~~~ In Odoo, :ref:`reference/orm/domains` are values that encode conditions on records. A domain is a list of criteria used to select a subset of a model's @@ -646,14 +638,14 @@ records for the relation when trying to select records in the client interface. .. exercise:: Domains on relational fields - When selecting the instructor for a *Session*, only instructors (partners - with ``instructor`` set to ``True``) should be visible. + When selecting the instructor for a *Session*, only instructors (partners + with ``instructor`` set to ``True``) should be visible. .. exercise:: More complex domains - Create new partner categories *Teacher / Level 1* and *Teacher / Level 2*. - The instructor for a session can be either an instructor or a teacher - (of any level). + Create new partner categories *Teacher / Level 1* and *Teacher / Level 2*. + The instructor for a session can be either an instructor or a teacher + (of any level). Computed fields and default values ================================== @@ -669,30 +661,29 @@ method should simply set the value of the field to compute on every record in ``self``. .. danger:: ``self`` is a collection - :class: aphorism + :class: aphorism - The object ``self`` is a *recordset*, i.e., an ordered collection of - records. It supports the standard Python operations on collections, like - ``len(self)`` and ``iter(self)``, plus extra set operations like ``recs1 + - recs2``. + The object ``self`` is a *recordset*, i.e., an ordered collection of records. It supports the + standard Python operations on collections, like ``len(self)`` and ``iter(self)``, plus extra set + operations like ``recs1 + recs2``. - Iterating over ``self`` gives the records one by one, where each record is - itself a collection of size 1. You can access/assign fields on single - records by using the dot notation, like ``record.name``. + Iterating over ``self`` gives the records one by one, where each record is itself a collection of + size 1. You can access/assign fields on single records by using the dot notation, like + ``record.name``. .. code-block:: python - import random - from odoo import models, fields, api + import random + from odoo import models, fields, api - class ComputedModel(models.Model): - _name = 'test.computed' + class ComputedModel(models.Model): + _name = 'test.computed' - name = fields.Char(compute='_compute_name') + name = fields.Char(compute='_compute_name') - def _compute_name(self): - for record in self: - record.name = str(random.randint(1, 1e6)) + def _compute_name(self): + for record in self: + record.name = str(random.randint(1, 1e6)) Dependencies @@ -719,9 +710,9 @@ field whenever some of its dependencies have been modified:: .. exercise:: Computed fields - * Add the percentage of taken seats to the *Session* model - * Display that field in the tree and form views - * Display the field as a progress bar + * Add the percentage of taken seats to the *Session* model + * Display that field in the tree and form views + * Display the field as a progress bar Default values -------------- @@ -734,9 +725,7 @@ float, string), or a function taking a recordset and returning a value:: user_id = fields.Many2one('res.users', default=lambda self: self.env.user) .. note:: - - The object ``self.env`` gives access to request parameters and other useful - things: + The object ``self.env`` gives access to request parameters and other useful things: - ``self.env.cr`` or ``self._cr`` is the database *cursor* object; it is used for querying the database @@ -748,10 +737,10 @@ float, string), or a function taking a recordset and returning a value:: .. exercise:: Active objects – Default values - * Define the start_date default value as today (see - :class:`~odoo.fields.Date`). - * Add a field ``active`` in the class Session, and set sessions as active by - default. + * Define the start_date default value as today (see + :class:`~odoo.fields.Date`). + * Add a field ``active`` in the class Session, and set sessions as active by + default. Onchange ======== @@ -769,25 +758,25 @@ to specify on which field it has to be triggered. Any change you make on .. code-block:: xml - - - - + + + + .. code-block:: python - # onchange handler - @api.onchange('amount', 'unit_price') - def _onchange_price(self): - # set auto-changing field - self.price = self.amount * self.unit_price - # Can optionally return a warning and domains - return { - 'warning': { - 'title': "Something bad happened", - 'message': "It was very bad indeed", - } - } + # onchange handler + @api.onchange('amount', 'unit_price') + def _onchange_price(self): + # set auto-changing field + self.price = self.amount * self.unit_price + # Can optionally return a warning and domains + return { + 'warning': { + 'title': "Something bad happened", + 'message': "It was very bad indeed", + } + } For computed fields, valued ``onchange`` behavior is built-in as can be seen by playing with the *Session* form: change the number of seats or participants, and @@ -795,8 +784,8 @@ the ``taken_seats`` progressbar is automatically updated. .. exercise:: Warning - Add an explicit onchange to warn about invalid values, like a negative - number of seats, or more participants than seats. + Add an explicit onchange to warn about invalid values, like a negative + number of seats, or more participants than seats. Model constraints ================= @@ -822,8 +811,8 @@ raise an exception if its invariant is not satisfied:: .. exercise:: Add Python constraints - Add a constraint that checks that the instructor is not present in the - attendees of his/her own session. + Add a constraint that checks that the instructor is not present in the + attendees of his/her own session. SQL constraints are defined through the model attribute :attr:`~odoo.models.Model._sql_constraints`. The latter is assigned to a list @@ -833,20 +822,20 @@ and ``message`` is the error message. .. exercise:: Add SQL constraints - With the help of `PostgreSQL's documentation`_ , add the following - constraints: + With the help of `PostgreSQL's documentation`_ , add the following + constraints: - #. CHECK that the course description and the course title are different - #. Make the Course's name UNIQUE + #. CHECK that the course description and the course title are different + #. Make the Course's name UNIQUE .. exercise:: Exercise 6 - Add a duplicate option - Since we added a constraint for the Course name uniqueness, it is not - possible to use the "duplicate" function anymore (:menuselection:`Form --> - Duplicate`). + Since we added a constraint for the Course name uniqueness, it is not + possible to use the "duplicate" function anymore (:menuselection:`Form --> + Duplicate`). - Re-implement your own "copy" method which allows to duplicate the Course - object, changing the original name into "Copy of [original name]". + Re-implement your own "copy" method which allows to duplicate the Course + object, changing the original name into "Copy of [original name]". Advanced Views ============== @@ -915,14 +904,14 @@ their most common attributes are: .. code-block:: xml - - - + + + .. exercise:: Calendar view - Add a Calendar view to the *Session* model enabling the user to view the - events associated to the Open Academy. + Add a Calendar view to the *Session* model enabling the user to view the + events associated to the Open Academy. Search views ------------ @@ -943,20 +932,20 @@ predefined searches. Filters must have one of the following attributes: .. code-block:: xml - - - - - + + + + + - - - - - + + + + + To use a non-default search view in an action, it should be linked using the ``search_view_id`` field of the action record. @@ -969,33 +958,32 @@ default and behave as booleans (they can only be enabled by default). .. exercise:: Search views - #. Add a button to filter the courses for which the current user is the - responsible in the course search view. Make it selected by default. - #. Add a button to group courses by responsible user. + #. Add a button to filter the courses for which the current user is the + responsible in the course search view. Make it selected by default. + #. Add a button to group courses by responsible user. Gantt ----- .. warning:: - - The gantt view requires the web_gantt module which is present in - :ref:`the enterprise edition ` version. + The gantt view requires the web_gantt module which is present in :ref:`the enterprise edition + ` version. Horizontal bar charts typically used to show project planning and advancement, their root element is ````. .. code-block:: xml - + .. exercise:: Gantt charts - Add a Gantt Chart enabling the user to view the sessions scheduling linked - to the Open Academy module. The sessions should be grouped by instructor. + Add a Gantt Chart enabling the user to view the sessions scheduling linked + to the Open Academy module. The sessions should be grouped by instructor. Graph views ----------- @@ -1004,10 +992,9 @@ Graph views allow aggregated overview and analysis of models, their root element is ````. .. note:: - Pivot views (element ````) a multidimensional table, allows the - selection of filers and dimensions to get the right aggregated dataset - before moving to a more graphical overview. The pivot view shares the same - content definition as graph views. + Pivot views (element ````) a multidimensional table, allows the selection of filers and + dimensions to get the right aggregated dataset before moving to a more graphical overview. The + pivot view shares the same content definition as graph views. Graph views have 4 display modes, the default mode is selected using the ``@type`` attribute. @@ -1033,20 +1020,19 @@ the values: .. code-block:: xml - - - - + + + + .. warning:: - - Graph views perform aggregations on database values, they do not work - with non-stored computed fields. + Graph views perform aggregations on database values, they do not work with non-stored computed + fields. .. exercise:: Graph view - Add a Graph view in the Session object that displays, for each course, the - number of attendees under the form of a bar chart. + Add a Graph view in the Session object that displays, for each course, the + number of attendees under the form of a bar chart. Kanban ------ @@ -1065,8 +1051,8 @@ Kanban views define the structure of each card as a mix of form elements .. exercise:: Kanban view - Add a Kanban view that displays sessions grouped by course (columns are - thus courses). + Add a Kanban view that displays sessions grouped by course (columns are + thus courses). Security ======== @@ -1095,22 +1081,22 @@ rights are usually created by a CSV file named after its model: .. code-block:: text - id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink - access_idea_idea,idea.idea,model_idea_idea,base.group_user,1,1,1,0 - access_idea_vote,idea.vote,model_idea_vote,base.group_user,1,1,1,0 + id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink + access_idea_idea,idea.idea,model_idea_idea,base.group_user,1,1,1,0 + access_idea_vote,idea.vote,model_idea_vote,base.group_user,1,1,1,0 .. exercise:: Add access control through the Odoo interface - Create a new user "John Smith". Then create a group - "OpenAcademy / Session Read" with read access to the *Session* model. + Create a new user "John Smith". Then create a group + "OpenAcademy / Session Read" with read access to the *Session* model. .. exercise:: Add access control through data files in your module - Using data files, + Using data files, - * Create a group *OpenAcademy / Manager* with full access to all - OpenAcademy models - * Make *Session* and *Course* readable by all users + * Create a group *OpenAcademy / Manager* with full access to all + OpenAcademy models + * Make *Session* and *Course* readable by all users Record rules ------------ @@ -1127,23 +1113,23 @@ the same convention as the method :meth:`~odoo.models.Model.write` of the ORM. .. code-block:: xml - - Only cancelled leads may be deleted - - - - - - - [('state','=','cancel')] - + + Only cancelled leads may be deleted + + + + + + + [('state','=','cancel')] + .. exercise:: Record rule - Add a record rule for the model Course and the group - "OpenAcademy / Manager", that restricts ``write`` and ``unlink`` accesses - to the responsible of a course. If a course has no responsible, all users - of the group must be able to modify it. + Add a record rule for the model Course and the group + "OpenAcademy / Manager", that restricts ``write`` and ``unlink`` accesses + to the responsible of a course. If a course has no responsible, all users + of the group must be able to modify it. .. _howto/module/wizard: @@ -1169,8 +1155,8 @@ session, or for a list of sessions at once. .. exercise:: Define the wizard - Create a wizard model with a many2one relationship with the *Session* - model and a many2many relationship with the *Partner* model. + Create a wizard model with a many2one relationship with the *Session* + model and a many2many relationship with the *Partner* model. Launching wizards ----------------- @@ -1188,37 +1174,36 @@ the action is "bound" to. .. code:: xml - - Launch the Wizard - wizard.model.name - form - new - - + + Launch the Wizard + wizard.model.name + form + new + + .. tip:: - - While wizards use regular views and buttons, normally clicking any button in - a form would first save the form then close the dialog. Because this is - often undesirable in wizards, a special attribute ``special="cancel"`` is - available which immediately closes the wizard without saving the form. + While wizards use regular views and buttons, normally clicking any button in + a form would first save the form then close the dialog. Because this is + often undesirable in wizards, a special attribute ``special="cancel"`` is + available which immediately closes the wizard without saving the form. .. exercise:: Launch the wizard - #. Define a form view for the wizard. - #. Add the action to launch it in the context of the *Session* model. - #. Define a default value for the session field in the wizard; use the - context parameter ``self._context`` to retrieve the current session. + #. Define a form view for the wizard. + #. Add the action to launch it in the context of the *Session* model. + #. Define a default value for the session field in the wizard; use the + context parameter ``self._context`` to retrieve the current session. .. exercise:: Register attendees - Add buttons to the wizard, and implement the corresponding method for adding - the attendees to the given session. + Add buttons to the wizard, and implement the corresponding method for adding + the attendees to the given session. .. exercise:: Register attendees to multiple sessions - Modify the wizard model so that attendees can be registered to multiple - sessions. + Modify the wizard model so that attendees can be registered to multiple + sessions. Internationalization ==================== @@ -1234,21 +1219,20 @@ Translation` without specifying a language), to create the module template POT file, and then derive the translated PO files. Many IDE's have plugins or modes for editing and merging PO/POT files. -.. tip:: The Portable Object files generated by Odoo are published on - `Transifex `__, making it - easy to translate the software. +.. tip:: + The Portable Object files generated by Odoo are published on `Transifex + `_, making it easy to translate the software. .. code-block:: text - |- idea/ # The module directory - |- i18n/ # Translation files - | - idea.pot # Translation Template (exported from Odoo) - | - fr.po # French translation - | - pt_BR.po # Brazilian Portuguese translation - | (...) + |- idea/ # The module directory + |- i18n/ # Translation files + | - idea.pot # Translation Template (exported from Odoo) + | - fr.po # French translation + | - pt_BR.po # Brazilian Portuguese translation + | (...) .. tip:: - By default Odoo's POT export only extracts labels inside XML files or inside field definitions in Python code, but any Python string can be translated this way by surrounding it with the function :func:`odoo._` @@ -1276,43 +1260,43 @@ A report is a combination two elements: .. code-block:: xml - - Invoices - account.invoice - qweb-pdf - account.report_invoice - account.report_invoice - - (object.state in ('open','paid')) and - ('INV'+(object.number or '').replace('/','')+'.pdf') - - report - + + Invoices + account.invoice + qweb-pdf + account.report_invoice + account.report_invoice + + (object.state in ('open','paid')) and + ('INV'+(object.number or '').replace('/','')+'.pdf') + + report + .. tip:: - Because it largerly a standard action, as with :ref:`howto/module/wizard` - it is generally useful to add the report as a *contextual item* on the - tree and / or form views of the model being reported on via the - ``binding_model_id`` field. + Because it largerly a standard action, as with :ref:`howto/module/wizard` + it is generally useful to add the report as a *contextual item* on the + tree and / or form views of the model being reported on via the + ``binding_model_id`` field. - Here we are also using ``binding_type`` in order for the report to be in - the *report* contextual menu rather than the *action* one. There is no - technical difference but putting elements in the right place helps users. + Here we are also using ``binding_type`` in order for the report to be in + the *report* contextual menu rather than the *action* one. There is no + technical difference but putting elements in the right place helps users. * A standard :ref:`QWeb view ` for the actual report: .. code-block:: xml - - - -
-

Report title

-
-
-
-
+ + + +
+

Report title

+
+
+
+
the standard rendering context provides a number of elements, the most important being: @@ -1333,25 +1317,25 @@ http://localhost:8069/report/pdf/account.report_invoice/1. .. danger:: - If it appears that your PDF report is missing the styles (i.e. the text - appears but the style/layout is different from the html version), probably - your wkhtmltopdf_ process cannot reach your web server to download them. + If it appears that your PDF report is missing the styles (i.e. the text + appears but the style/layout is different from the html version), probably + your wkhtmltopdf_ process cannot reach your web server to download them. - If you check your server logs and see that the CSS styles are not being - downloaded when generating a PDF report, most surely this is the problem. + If you check your server logs and see that the CSS styles are not being + downloaded when generating a PDF report, most surely this is the problem. - The wkhtmltopdf_ process will use the ``web.base.url`` system parameter as - the *root path* to all linked files, but this parameter is automatically - updated each time the Administrator is logged in. If your server resides - behind some kind of proxy, that could not be reachable. You can fix this by - adding one of these system parameters: + The wkhtmltopdf_ process will use the ``web.base.url`` system parameter as + the *root path* to all linked files, but this parameter is automatically + updated each time the Administrator is logged in. If your server resides + behind some kind of proxy, that could not be reachable. You can fix this by + adding one of these system parameters: - - ``report.url``, pointing to an URL reachable from your server - (probably ``http://localhost:8069`` or something similar). It will be - used for this particular purpose only. + - ``report.url``, pointing to an URL reachable from your server + (probably ``http://localhost:8069`` or something similar). It will be + used for this particular purpose only. - - ``web.base.url.freeze``, when set to ``True``, will stop the - automatic updates to ``web.base.url``. + - ``web.base.url.freeze``, when set to ``True``, will stop the + automatic updates to ``web.base.url``. .. exercise:: Create a report for the Session model @@ -1415,44 +1399,43 @@ server with the library ``xmlrpc.client``:: .. only:: solutions - .. code-block:: python + .. code-block:: python - import functools - import xmlrpc.client - HOST = 'localhost' - PORT = 8069 - DB = 'openacademy' - USER = 'admin' - PASS = 'admin' - ROOT = 'http://%s:%d/xmlrpc/' % (HOST,PORT) + import functools + import xmlrpc.client + HOST = 'localhost' + PORT = 8069 + DB = 'openacademy' + USER = 'admin' + PASS = 'admin' + ROOT = 'http://%s:%d/xmlrpc/' % (HOST,PORT) - # 1. Login - uid = xmlrpc.client.ServerProxy(ROOT + 'common').login(DB,USER,PASS) - print("Logged in as %s (uid:%d)" % (USER,uid)) + # 1. Login + uid = xmlrpc.client.ServerProxy(ROOT + 'common').login(DB,USER,PASS) + print("Logged in as %s (uid:%d)" % (USER,uid)) - call = functools.partial( - xmlrpc.client.ServerProxy(ROOT + 'object').execute, - DB, uid, PASS) + call = functools.partial( + xmlrpc.client.ServerProxy(ROOT + 'object').execute, + DB, uid, PASS) - # 2. Read the sessions - sessions = call('openacademy.session','search_read', [], ['name','seats']) - for session in sessions: - print("Session %s (%s seats)" % (session['name'], session['seats'])) - # 3.create a new session - session_id = call('openacademy.session', 'create', { - 'name' : 'My session', - 'course_id' : 2, - }) + # 2. Read the sessions + sessions = call('openacademy.session','search_read', [], ['name','seats']) + for session in sessions: + print("Session %s (%s seats)" % (session['name'], session['seats'])) + # 3.create a new session + session_id = call('openacademy.session', 'create', { + 'name' : 'My session', + 'course_id' : 2, + }) - Instead of using a hard-coded course id, the code can look up a course - by name:: + Instead of using a hard-coded course id, the code can look up a course by name:: - # 3.create a new session for the "Functional" course - course_id = call('openacademy.course', 'search', [('name','ilike','Functional')])[0] - session_id = call('openacademy.session', 'create', { - 'name' : 'My session', - 'course_id' : course_id, - }) + # 3.create a new session for the "Functional" course + course_id = call('openacademy.course', 'search', [('name','ilike','Functional')])[0] + session_id = call('openacademy.session', 'create', { + 'name' : 'My session', + 'course_id' : course_id, + }) JSON-RPC Library ---------------- @@ -1504,9 +1487,8 @@ example assumes the **Productivity** app (``note``) is installed:: Examples can be easily adapted from XML-RPC to JSON-RPC. .. note:: - - There are a number of high-level APIs in various languages to access Odoo - systems without *explicitly* going through XML-RPC or JSON-RPC, such as: + There are a number of high-level APIs in various languages to access Odoo systems without + *explicitly* going through XML-RPC or JSON-RPC, such as: * https://github.com/akretion/ooor * https://github.com/OCA/odoorpc diff --git a/content/developer/howtos/localization.rst b/content/developer/howtos/localization.rst index ba8f45295..89d527caf 100644 --- a/content/developer/howtos/localization.rst +++ b/content/developer/howtos/localization.rst @@ -1,18 +1,17 @@ - ======================= Accounting Localization ======================= .. warning:: - - This tutorial requires knowledges about how to build a module in Odoo (see - :doc:`/developer/howtos/backend`). + This tutorial requires knowledges about how to build a module in Odoo (see + :doc:`/developer/howtos/backend`). Building a localization module -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +============================== -When installing the ``accounting`` module, the localization module corresponding to the country code of the company is installed automatically. -In case of no country code set or no localization module found, the ``l10n_generic_coa`` (US) localization module is installed by default. +When installing the ``accounting`` module, the localization module corresponding to the country code +of the company is installed automatically. In case of no country code set or no localization module +found, the ``l10n_generic_coa`` (US) localization module is installed by default. For example, ``l10n_be`` will be installed if the company has ``Belgium`` as country. @@ -26,24 +25,27 @@ This behavior is allowed by the presence of a *.xml* file containing the followi Where ``module.template_xmlid`` is the **fully-qualified** xmlid of the corresponding template. -Usually located in the ``data`` folder, it must be loaded at the very last in the ``__manifest__.py`` file. +Usually located in the ``data`` folder, it must be loaded at the very last in the +``__manifest__.py`` file. .. danger:: If the *.xml* file is missing, the right chart of accounts won't be loaded on time! - Configuring my own Chart of Accounts? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +===================================== -First of all, before I proceed, we need to talk about the templates. A template is a record that allows replica of itself. -This mechanism is needed when working in multi-companies. For example, the creation of a new account is done using the ``account.account.template`` model. -However, each company using this chart of accounts will be linked to a replica having ``account.account`` as model. -So, the templates are never used directly by the company. +First of all, before I proceed, we need to talk about the templates. A template is a record that +allows replica of itself. This mechanism is needed when working in multi-companies. For example, the +creation of a new account is done using the ``account.account.template`` model. However, each +company using this chart of accounts will be linked to a replica having ``account.account`` as +model. So, the templates are never used directly by the company. -Then, when a chart of accounts needs to be installed, all templates dependent of this one will create a replica and link this newly generated record to the company's user. -It means all such templates must be linked to the chart of accounts in some way. To do so, each one must reference the desired chart of accounts using the ``chart_template_id`` field. -For this reason, we need to define an instance of the ``account.chart.template`` model before creating its templates. +Then, when a chart of accounts needs to be installed, all templates dependent of this one will +create a replica and link this newly generated record to the company's user. It means all such +templates must be linked to the chart of accounts in some way. To do so, each one must reference the +desired chart of accounts using the ``chart_template_id`` field. For this reason, we need to define +an instance of the ``account.chart.template`` model before creating its templates. .. code-block:: xml @@ -96,15 +98,15 @@ For example, let's take a look to the Belgium chart of accounts.
-Now that the chart of accounts is created, we can focus on the creation of the templates. -As said previously, each record must reference this record through the ``chart_template_id`` field. -If not, the template will be ignored. The following sections show in details how to create these templates. +Now that the chart of accounts is created, we can focus on the creation of the templates. As said +previously, each record must reference this record through the ``chart_template_id`` field. If not, +the template will be ignored. The following sections show in details how to create these templates. Adding a new account to my Chart of Accounts -############################################ +-------------------------------------------- -It's time to create our accounts. It consists to creating records of ``account.account.template`` type. -Each ``account.account.template`` is able to create an ``account.account`` for each company. +It's time to create our accounts. It consists to creating records of ``account.account.template`` +type. Each ``account.account.template`` is able to create an ``account.account`` for each company. .. code-block:: xml @@ -136,23 +138,26 @@ Each ``account.account.template`` is able to create an ``account.account`` for e Some of the described fields above deserve a bit more explanation. -The ``user_type_id`` field requires a value of type ``account.account.type``. -Although some additional types could be created in a localization module, we encourage the usage of the existing types in the `account/data/data_account_type.xml <{GITHUB_PATH}/addons/account/data/data_account_type.xml>`_ file. -The usage of these generic types ensures the generic reports working correctly in addition to those that you could create in your localization module. +The ``user_type_id`` field requires a value of type ``account.account.type``. Although some +additional types could be created in a localization module, we encourage the usage of the existing +types in the `account/data/data_account_type.xml +<{GITHUB_PATH}/addons/account/data/data_account_type.xml>`_ file. The usage of these generic types +ensures the generic reports working correctly in addition to those that you could create in your +localization module. .. warning:: - - Avoid the usage of liquidity ``account.account.type``! - Indeed, the bank & cash accounts are created directly at the installation of the localization module and then, are linked to an ``account.journal``. + Avoid the usage of liquidity ``account.account.type``! Indeed, the bank & cash accounts are + created directly at the installation of the localization module and then, are linked to an + ``account.journal``. .. warning:: + Only one account of type payable/receivable is enough. - Only one account of type payable/receivable is enough. - -Although the ``tag_ids`` field is optional, this one remains a very powerful feature. -Indeed, this one allows you to define some tags for your accounts to spread them correctly on your reports. -For example, suppose you want to create a financial report having multiple lines but you have no way to find a rule to dispatch the accounts according their ``code`` or ``name``. -The solution is the usage of tags, one for each report line, to spread and aggregate your accounts like you want. +Although the ``tag_ids`` field is optional, this one remains a very powerful feature. Indeed, this +one allows you to define some tags for your accounts to spread them correctly on your reports. For +example, suppose you want to create a financial report having multiple lines but you have no way to +find a rule to dispatch the accounts according their ``code`` or ``name``. The solution is the usage +of tags, one for each report line, to spread and aggregate your accounts like you want. Like any other record, a tag can be created with the following xml structure: @@ -181,11 +186,10 @@ An examples coming from the ``l10n_be`` module:
.. warning:: - - Don't create too much accounts: 200-300 is enough. + Don't create too much accounts: 200-300 is enough. Adding a new tax to my Chart of Accounts -######################################## +---------------------------------------- To create a new tax record, you just need to follow the same process as the creation of accounts. The only difference being that you must use the ``account.tax.template`` model. @@ -285,14 +289,12 @@ An example found in the ``l10n_pl`` module:
- Adding a new fiscal position to my Chart of Accounts -#################################################### +---------------------------------------------------- .. note:: - - If you need more information about what is a fiscal position and how it works in Odoo, - please refer to :doc:`/applications/finance/accounting/taxation/taxes/fiscal_positions`. + If you need more information about what is a fiscal position and how it works in Odoo, please + refer to :doc:`/applications/finance/accounting/taxation/taxes/fiscal_positions`. To create a new fiscal position, simply use the ``account.fiscal.position.template`` model: @@ -310,10 +312,12 @@ To create a new fiscal position, simply use the ``account.fiscal.position.templa Adding the properties to my Chart of Accounts -############################################# +--------------------------------------------- -When the whole accounts are generated, you have the possibility to override the newly generated chart of accounts by adding some properties that correspond to default accounts used in certain situations. -This must be done after the creation of accounts before each one must be linked to the chart of accounts. +When the whole accounts are generated, you have the possibility to override the newly generated +chart of accounts by adding some properties that correspond to default accounts used in certain +situations. This must be done after the creation of accounts before each one must be linked to the +chart of accounts. .. code-block:: xml @@ -345,7 +349,8 @@ This must be done after the creation of accounts before each one must be linked -For example, let's come back to the Belgium PCMN. This chart of accounts is override in this way to add some properties. +For example, let's come back to the Belgium PCMN. This chart of accounts is override in this way to +add some properties. .. code-block:: xml @@ -360,15 +365,15 @@ For example, let's come back to the Belgium PCMN. This chart of accounts is over How to create a new bank operation model? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +========================================= .. note:: + How a bank operation model works exactly in Odoo? See + :doc:`/applications/finance/accounting/bank/reconciliation/reconciliation_models`. - How a bank operation model works exactly in Odoo? See :doc:`/applications/finance/accounting/bank/reconciliation/reconciliation_models`. - -Since ``V10``, a new feature is available in the bank statement reconciliation widget: the bank operation model. -This allows the user to pre-fill some accounting entries with a single click. -The creation of an ``account.reconcile.model.template`` record is quite easy: +Since ``V10``, a new feature is available in the bank statement reconciliation widget: the bank +operation model. This allows the user to pre-fill some accounting entries with a single click. The +creation of an ``account.reconcile.model.template`` record is quite easy: .. code-block:: xml @@ -412,14 +417,17 @@ The creation of an ``account.reconcile.model.template`` record is quite easy: How to create a new dynamic report? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +=================================== -If you need to add some reports on your localization, you need to create a new module named **l10n_xx_reports**. -Furthermore, this additional module must be present in the ``enterprise`` repository and must have at least two dependencies, -one to bring all the stuff for your localization module and one more, ``account_reports``, to design dynamic reports. +If you need to add some reports on your localization, you need to create a new module named +**l10n_xx_reports**. Furthermore, this additional module must be present in the ``enterprise`` +repository and must have at least two dependencies, one to bring all the stuff for your localization +module and one more, ``account_reports``, to design dynamic reports. .. code-block:: py 'depends': ['l10n_xx', 'account_reports'], -Once it's done, you can start the creation of your report statements. The documentation is available in the following `slides `_. +Once it's done, you can start the creation of your report statements. The documentation is available +in the following `slides +`_. diff --git a/content/developer/howtos/rdtraining/02_setup.rst b/content/developer/howtos/rdtraining/02_setup.rst index fcbf46484..b24d4e114 100644 --- a/content/developer/howtos/rdtraining/02_setup.rst +++ b/content/developer/howtos/rdtraining/02_setup.rst @@ -288,7 +288,7 @@ For JavaScript, we use ESLint and you can find a `configuration file example her `_. Administrator tools for PostgreSQL ------------------------------------ +---------------------------------- You can manage your PostgreSQL databases using the command line as demonstrated earlier or using a GUI application such as `pgAdmin `_ or `DBeaver @@ -377,7 +377,5 @@ Here is a list of commands: Quit the debugger. The program being executed is aborted. ----- - Now that your server is running, it's time to start :ref:`writing your own application `! diff --git a/content/developer/howtos/rdtraining/J_reports.rst b/content/developer/howtos/rdtraining/J_reports.rst index 9828bae30..d8695634a 100644 --- a/content/developer/howtos/rdtraining/J_reports.rst +++ b/content/developer/howtos/rdtraining/J_reports.rst @@ -203,7 +203,7 @@ template is passed more than one record, it can produce one PDF report for all t Using the Print menu in the list view with multiple records selected will demonstrate this. Make a Report ---------------- +------------- Finally, you now know where to create your files and how the content of the files should look. Happy report making! diff --git a/content/developer/howtos/rdtraining/K_dashboard.rst b/content/developer/howtos/rdtraining/K_dashboard.rst index ef3b9218f..724bb8dfc 100644 --- a/content/developer/howtos/rdtraining/K_dashboard.rst +++ b/content/developer/howtos/rdtraining/K_dashboard.rst @@ -104,6 +104,7 @@ these options. A full example to reference while doing the exercises in this sec Data ---- + To fully enjoy our dashboard view, we will need good test data to populate it. Test data will allow us to check that the resulting look and statistics are correct. It is a good idea to test with data that will cover most or all of your expected use cases, but is also easy to verify with @@ -128,6 +129,7 @@ data after you write your dashboard code and then test that your view is working Aggregations ------------ + Building a dashboard view is very similar to what you have previously done in :ref:`howto/rdtraining/07_basicviews`. For the dashboard view, we use the `dashboard` root element and choose from its possible tags (see all the possibilities and their attributes in the @@ -162,6 +164,7 @@ covered in :ref:`howto/rdtraining/06_firstui`). Now let's make some dashboards! Pie Charts ---------- + Adding pie charts to dashboards is a piece of cake using the `` element. An example is: .. code-block:: xml @@ -190,6 +193,7 @@ the ``title`` for the pie chart, and that we're grouping it by property type. Subviews -------- + Similar to how we can use the list view within the form view (we saw this automatically happen for One2many relationships in :ref:`howto/rdtraining/08_relations`), we can add other views within our dashboard view. The most commonly added are the pivot and graph views, but the cohort view is @@ -246,6 +250,7 @@ model clean of unnecessary fields. Model ----- + We will start with the more difficult part: our special report model. This file starts the same as any other model, except that we add 2 attributes ``_auto`` and ``_rec_name``:: @@ -316,6 +321,7 @@ or use alias names that match. View ---- + Now that we have our model, we can make its dashboard view. There is no difference in how it's made, except that its file is located in the ``report`` folder. Since it is a new model not linked to any other model, we will also have to add a new menuitem to view our dashboard. Typically, SQL views @@ -332,6 +338,7 @@ remember how to add a ``menuitem``? If not, revisit :ref:`howto/rdtraining/06_fi Extra Tips ---------- + **Tip 1** A common mistake in SQL views is not considering the duplication of certain data due to table JOINs. For example, in our **Goal**, we have a pie chart of the offers' property types. We may be tempted to add a similar pie chart with a domain to only include canceled properties, diff --git a/content/developer/howtos/themes.rst b/content/developer/howtos/themes.rst index 838ecd318..38ebebd0e 100644 --- a/content/developer/howtos/themes.rst +++ b/content/developer/howtos/themes.rst @@ -28,12 +28,9 @@ From common CMS to Odoo ----------------------- .. note:: - If you always think and work in the same way, you’ll probably get the same results. If you want something completely new, then try something different. -.. - - Where is my header.php file? +**Where is my header.php file?** This is usually the first question from a web designer used to working with Wordpress or Joomla and coming to Odoo for the first time. @@ -185,7 +182,7 @@ Keep reading the tutorial to learn to how properly extend it with your own code. Create a theme module -====================== +===================== Odoo’s themes are packaged like modules. Even if you are designing a very simple website for your company or client, you need to package the theme like an Odoo module. @@ -810,7 +807,7 @@ Options allow publishers to edit a snippet’s appearance using the Website Buil Using Website Builder functionalities, you can create snippet options easily and automatically add them to the UI. Options group properties -------------------------- +------------------------ Options are wrapped in groups. Groups can have properties that define how the included options will interact with the user interface. @@ -824,7 +821,7 @@ Options are wrapped in groups. Groups can have properties that define how the in Defines the list of elements that the snippet can be dropped beside. Default option methods ------------------------ +---------------------- Options apply standard CSS classes to the snippet. Depending on the method that you choose, the UI will behave differently. @@ -1102,11 +1099,12 @@ Describe your page ------------------ Define keywords -''''''''''''''' +~~~~~~~~~~~~~~~ + You should use appropriate, relevant keywords and synonyms for those keywords. You can define them for each page using the built-in “Promote” function found in the bar at the top. Define a title and a description -'''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Define them using the “Promote” function. Keep your page titles short and include the main keyword phrase for the page. Good titles evoke an emotional response, ask a question or promise something. diff --git a/content/developer/howtos/translations.rst b/content/developer/howtos/translations.rst index f30a8c96a..165085c03 100644 --- a/content/developer/howtos/translations.rst +++ b/content/developer/howtos/translations.rst @@ -1,7 +1,5 @@ - .. _reference/translations: - =================== Translating Modules =================== @@ -118,7 +116,8 @@ of global variables. return modules + ['your_module'] Variables -^^^^^^^^^ +--------- + **Don't** the extract may work but it will not translate the text correctly:: _("Scheduled meeting with %s" % invitee.name) @@ -130,7 +129,8 @@ will fallback on source in case of missing placeholder in the translation):: Blocks -^^^^^^ +------ + **Don't** split your translation in several blocks or multiples lines:: # bad, trailing spaces, blocks out of context @@ -152,7 +152,8 @@ Blocks "this sales order request.") Plural -^^^^^^ +------ + **Don't** pluralize terms the English-way:: msg = _("You have %(count)s invoice", count=invoice_count) @@ -167,7 +168,7 @@ Plural msg = _("You have one invoice") Read vs Run Time -^^^^^^^^^^^^^^^^ +---------------- **Don't** invoke translation lookup at server launch:: diff --git a/content/developer/howtos/web.rst b/content/developer/howtos/web.rst index 96445291b..8613b9cc6 100644 --- a/content/developer/howtos/web.rst +++ b/content/developer/howtos/web.rst @@ -1,8 +1,8 @@ :orphan: -============================= +========================== Customizing the web client -============================= +========================== .. note:: @@ -10,7 +10,6 @@ Customizing the web client but meanwhile, this tutorial will probably be frustrating to follow, since it was written a long time ago. - .. highlight:: javascript .. default-domain:: js @@ -30,7 +29,6 @@ or extend existing business systems of Odoo, see :doc:`backend`. It also requires :ref:`an installed Odoo `, and Git_. - A Simple Module =============== @@ -110,7 +108,9 @@ sub-folders are conventional and not strictly necessary. Which only prints a small message in the browser's console. -The files in the ``static`` folder, need to be defined within the module in order for them to be loaded correctly. Everything in ``src/xml`` is defined in ``__manifest__.py`` while the contents of ``src/css`` and ``src/js`` are defined in ``petstore.xml``, or a similar file. +The files in the ``static`` folder, need to be defined within the module in order for them to be +loaded correctly. Everything in ``src/xml`` is defined in ``__manifest__.py`` while the contents of +``src/css`` and ``src/js`` are defined in ``petstore.xml``, or a similar file. .. warning:: @@ -503,11 +503,10 @@ must be explicitly cleaned up (because the garbage collector will not handle them), you can override :func:`~odoo.Widget.destroy`. .. danger:: - - when overriding :func:`~odoo.Widget.destroy`, ``_super()`` - *must always* be called otherwise the widget and its children are not - correctly cleaned up leaving possible memory leaks and "phantom events", - even if no error is displayed + when overriding :func:`~odoo.Widget.destroy`, ``_super()`` + *must always* be called otherwise the widget and its children are not + correctly cleaned up leaving possible memory leaks and "phantom events", + even if no error is displayed The QWeb Template Engine ======================== @@ -537,16 +536,15 @@ characteristics: :class:`~odoo.Widget` without relying on QWeb) .. note:: + The rationale behind using QWeb instead of existing javascript template + engines is the extensibility of pre-existing (third-party) templates, much + like Odoo :ref:`views `. - The rationale behind using QWeb instead of existing javascript template - engines is the extensibility of pre-existing (third-party) templates, much - like Odoo :ref:`views `. - - Most javascript template engines are text-based which precludes easy - structural extensibility where an XML-based templating engine can be - generically altered using e.g. XPath or CSS and a tree-alteration DSL (or - even just XSLT). This flexibility and extensibility is a core - characteristic of Odoo, and losing it was considered unacceptable. + Most javascript template engines are text-based which precludes easy + structural extensibility where an XML-based templating engine can be + generically altered using e.g. XPath or CSS and a tree-alteration DSL (or + even just XSLT). This flexibility and extensibility is a core + characteristic of Odoo, and losing it was considered unacceptable. Using QWeb ---------- @@ -598,14 +596,13 @@ usages: sub-widget also gets a red background .. warning:: - - templates should have a single non-``t`` root element, especially if - they're set as a widget's :attr:`~odoo.Widget.template`. If there are - multiple "root elements", results are undefined (usually only the first - root element will be used and the others will be ignored) + templates should have a single non-``t`` root element, especially if + they're set as a widget's :attr:`~odoo.Widget.template`. If there are + multiple "root elements", results are undefined (usually only the first + root element will be used and the others will be ignored) QWeb Context -'''''''''''' +~~~~~~~~~~~~ QWeb templates can be given data and can contain basic display logic. @@ -659,7 +656,7 @@ Result:
Hello Mordecai
Template Declaration -'''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~ We've seen how to *render* QWeb templates, let's now see the syntax of the templates themselves. @@ -683,7 +680,7 @@ it can be called using :func:`QWeb.render`. It can only be used at the top-level of a template file. Escaping -'''''''' +~~~~~~~~ The ``t-esc`` directive can be used to output text: @@ -707,7 +704,7 @@ or method calls:
Outputting HTML -''''''''''''''' +~~~~~~~~~~~~~~~ To inject HTML in the page being rendered, use ``t-raw``. Like ``t-esc`` it takes an arbitrary Javascript expression as parameter, but it does not @@ -724,7 +721,7 @@ perform an HTML-escape step. vulnerabilities Conditionals -'''''''''''' +~~~~~~~~~~~~ QWeb can have conditional blocks using ``t-if``. The directive takes an arbitrary expression, if the expression is falsy (``false``, ``null``, ``0`` @@ -748,7 +745,7 @@ or an empty string) the whole block is suppressed, otherwise it is displayed. local variable if it's a complex or expensive expression. Iteration -''''''''' +~~~~~~~~~ To iterate on a list, use ``t-foreach`` and ``t-as``. ``t-foreach`` takes an expression returning a list to iterate on ``t-as`` takes a variable name to @@ -768,7 +765,7 @@ bind to each item during iteration. (dictionaries) Defining attributes -''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~ QWeb provides two related directives to define computed attributes: :samp:`t-att-{name}` and :samp:`t-attf-{name}`. In either case, *name* is the @@ -799,7 +796,7 @@ literal and partially computed such as a class: Calling other templates -''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~ Templates can be split into sub-templates (for simplicity, maintainability, reusability or to avoid excessive markup nesting). @@ -829,12 +826,12 @@ rendering the ``A`` template will result in: Sub-templates inherit the rendering context of their caller. To Learn More About QWeb -'''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~ For a QWeb reference, see :ref:`reference/qweb`. Exercise -'''''''' +~~~~~~~~ .. exercise:: Usage of QWeb in Widgets @@ -1667,7 +1664,7 @@ In Odoo Web, the component responsible for handling and reacting to these actions is the *Action Manager*. Using the Action Manager -'''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~ The action manager can be invoked explicitly from javascript code by creating a dictionary describing :ref:`an action ` of the right @@ -1811,7 +1808,7 @@ Much of Odoo web's usefulness (and complexity) resides in views. Each view type is a way of displaying a model in the client. The View Manager -'''''''''''''''' +~~~~~~~~~~~~~~~~ When an ``ActionManager`` instance receive an action of type ``ir.actions.act_window``, it delegates the synchronization and handling of @@ -1823,7 +1820,7 @@ multiple views depending on the original action's requirements: :width: 40% The Views -''''''''' +~~~~~~~~~ Most :ref:`Odoo views ` are implemented through a subclass of :class:`odoo.web.View` which provides a bit of generic basic structure @@ -1932,14 +1929,14 @@ interface and the ``AbstractField`` class directly in the code of the Odoo web client. Creating a New Type of Field -'''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In this part we will explain how to create a new type of field. The example here will be to re-implement the ``FieldChar`` class and progressively explain each part. Simple Read-Only Field -"""""""""""""""""""""" +********************** Here is a first implementation that will only display text. The user will not be able to modify the content of the field. @@ -1979,7 +1976,7 @@ none is specified by the form view (here we assume the default value of a ``char`` field should be an empty string). Read-Write Field -"""""""""""""""" +**************** Read-only fields, which only display content and don't allow the user to modify it can be useful, but most fields in Odoo also allow editing. diff --git a/content/developer/reference/addons/actions.rst b/content/developer/reference/addons/actions.rst index 5314596ec..8ddfa13a1 100644 --- a/content/developer/reference/addons/actions.rst +++ b/content/developer/reference/addons/actions.rst @@ -408,7 +408,7 @@ how the POS interface works. .. _reference/actions/cron: Automated Actions (``ir.cron``) -====================================== +=============================== Actions triggered automatically on a predefined frequency. diff --git a/content/developer/reference/addons/data.rst b/content/developer/reference/addons/data.rst index 019d76dd5..5d252fdc4 100644 --- a/content/developer/reference/addons/data.rst +++ b/content/developer/reference/addons/data.rst @@ -77,7 +77,7 @@ following attributes: Requires an :term:`external id`, defaults to ``True``. ``field`` ----------- +--------- Each record can be composed of ``field`` tags, defining values to set when creating the record. A ``record`` with no ``field`` will use all default diff --git a/content/developer/reference/addons/mixins.rst b/content/developer/reference/addons/mixins.rst index e7c339c9e..b42c8caa7 100644 --- a/content/developer/reference/addons/mixins.rst +++ b/content/developer/reference/addons/mixins.rst @@ -20,7 +20,7 @@ Messaging integration --------------------- Basic messaging system -'''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~ Integrating messaging features to your model is extremely easy. Simply inheriting the ``mail.thread`` model and adding the messaging fields (and their appropriate @@ -192,9 +192,8 @@ a date or an e-mail address, add CC's addresses as followers, etc.). :return: True :rtype: bool - Logging changes -''''''''''''''' +~~~~~~~~~~~~~~~ The ``mail`` module adds a powerful tracking system on fields, allowing you to log changes to specific fields in the record's chatter. To add tracking @@ -221,9 +220,8 @@ to a field, simple set the tracking attribute to True. well to give more context about the notification (even if the name did not change). - Subtypes -'''''''' +~~~~~~~~ Subtypes give you more granular control over messages. Subtypes act as a classification system for notifications, allowing subscribers to a document to customize the @@ -318,9 +316,8 @@ can override the ``_track_subtype()`` function: return self.env.ref('my_module.mt_state_change') return super(BusinessTrip, self)._track_subtype(init_values) - Customizing notifications -''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~ When sending notifications to followers, it can be quite useful to add buttons in the template to allow quick actions directly from the e-mail. Even a simple button @@ -469,7 +466,7 @@ The urls in the actions list can be generated automatically by calling the that can sometimes be boring, I choose the former instead of the latter. Overriding defaults -''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~ There are several ways you can customize the behaviour of ``mail.thread`` models, including (but not limited to): @@ -510,7 +507,7 @@ the outside, allowing users or customers to quickly create records in your database without needing to connect to Odoo directly. Aliases vs. Incoming Mail Gateway -''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Some people use the Incoming Mail Gateway for this same purpose. You still need a correctly configured mail gateway to use aliases, however a single @@ -531,7 +528,7 @@ Aliases have several advantages over Mail Gateways: Alias support integration -''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~ Aliases are usually configured on a parent model which will then create specific record when contacted by e-mail. For example, Project have aliases to create tasks @@ -977,7 +974,7 @@ The rating mixin allows sending email to ask for customer rating, automatic transitioning in a kanban processes and aggregating statistics on your ratings. Adding rating on your model -''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~ To add rating support, simply inherit the ``rating.mixin`` model: @@ -1010,7 +1007,7 @@ The behaviour of the mixin adapts to your model: ``mail.thread``) Send rating requests by e-mail -'''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you wish to send emails to request a rating, simply generate an e-mail with links to the rating object. A very basic email template could look like this: diff --git a/content/developer/reference/addons/orm.rst b/content/developer/reference/addons/orm.rst index 6ba59b40e..427b84261 100644 --- a/content/developer/reference/addons/orm.rst +++ b/content/developer/reference/addons/orm.rst @@ -1,4 +1,3 @@ - .. _reference/orm: ======= @@ -150,7 +149,7 @@ Advanced Fields .. _reference/fields/date: Date(time) Fields -''''''''''''''''' +~~~~~~~~~~~~~~~~~ :class:`Dates ` and :class:`Datetimes ` are very important fields in any kind of business application. @@ -211,7 +210,7 @@ These helpers are also available by importing `odoo.tools.date_utils`. .. _reference/fields/relational: Relational Fields -''''''''''''''''' +~~~~~~~~~~~~~~~~~ .. autoclass:: Many2one() @@ -220,7 +219,7 @@ Relational Fields .. autoclass:: Many2many() Pseudo-relational fields -'''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~ .. autoclass:: Reference() @@ -229,7 +228,7 @@ Pseudo-relational fields .. _reference/fields/compute: Computed Fields -''''''''''''''' +~~~~~~~~~~~~~~~ Fields can be computed (instead of read straight from the database) using the ``compute`` parameter. **It must assign the computed value to the field**. If @@ -320,7 +319,7 @@ it uses the values of other *fields*, it should specify those fields using .. _reference/fields/related: Related fields -'''''''''''''' +~~~~~~~~~~~~~~ A special case of computed fields are *related* (proxy) fields, which provide the value of a sub-field on the current record. They are defined by setting @@ -400,7 +399,7 @@ Automatic fields .. _reference/fields/automatic/log_access: Access Log fields -''''''''''''''''' +~~~~~~~~~~~~~~~~~ These fields are automatically set and updated if :attr:`~odoo.models.BaseModel._log_access` is enabled. It can be @@ -456,10 +455,10 @@ behavior is desired: :class:`~odoo.fields.Boolean` .. .. attribute:: sequence -.. + .. Alterable ordering criteria, allows drag-and-drop reordering of models .. in list views. -.. + .. :class:`~odoo.fields.Integer` .. attribute:: state @@ -764,7 +763,7 @@ Search/Read .. automethod:: Model.read_group Fields/Views -'''''''''''' +~~~~~~~~~~~~ .. automethod:: Model.fields_get @@ -773,7 +772,7 @@ Fields/Views .. _reference/orm/domains: Search domains -'''''''''''''' +~~~~~~~~~~~~~~ A domain is a list of criteria, each criterion being a triple (either a ``list`` or a ``tuple``) of ``(field_name, operator, value)`` where: @@ -935,14 +934,14 @@ Recordsets therefore provide the following operations returning recordsets thems (when possible): Filter -'''''' +~~~~~~ .. automethod:: Model.filtered .. automethod:: Model.filtered_domain Map -''' +~~~ .. automethod:: Model.mapped @@ -957,7 +956,7 @@ Map records.partner_id.mapped('name') # == records.mapped('partner_id.name') Sort -'''' +~~~~ .. automethod:: Model.sorted diff --git a/content/developer/reference/addons/reports.rst b/content/developer/reference/addons/reports.rst index 2b7f71de2..424c6c626 100644 --- a/content/developer/reference/addons/reports.rst +++ b/content/developer/reference/addons/reports.rst @@ -164,6 +164,7 @@ More parameters can be passed as a query string Useful Remarks -------------- + * Twitter Bootstrap and FontAwesome classes can be used in your report template * Local CSS can be put directly in the template @@ -277,6 +278,7 @@ the template, such as data from additional models: Custom fonts ============ + If you want to use custom fonts you will need to add your custom font and the related less/CSS to the ``web.reports_assets_common`` assets bundle. Adding your custom font(s) to ``web.assets_common`` or ``web.assets_backend`` will not make your font available in QWeb reports. diff --git a/content/developer/reference/addons/security.rst b/content/developer/reference/addons/security.rst index 39b10b612..59714e722 100644 --- a/content/developer/reference/addons/security.rst +++ b/content/developer/reference/addons/security.rst @@ -225,6 +225,7 @@ properly. Bypassing the ORM ----------------- + You should never use the database cursor directly when the ORM can do the same thing! By doing so you are bypassing all the ORM features, possibly the automated behaviours like translations, invalidation of fields, ``active``, @@ -250,6 +251,7 @@ less secure. SQL injections ~~~~~~~~~~~~~~ + Care must be taken not to introduce SQL injections vulnerabilities when using manual SQL queries. The vulnerability is present when user input is either incorrectly filtered or badly quoted, allowing an attacker to introduce @@ -420,6 +422,7 @@ likely it is to break things. Evaluating content ------------------ + Some may want to ``eval`` to parse user provided content. Using ``eval`` should be avoided at all cost. A safer, sandboxed, method :class:`~odoo.tools.safe_eval` can be used instead but still gives tremendous capabilities to the user running diff --git a/content/developer/reference/addons/testing.rst b/content/developer/reference/addons/testing.rst index 53c539d2e..d5a13bd8f 100644 --- a/content/developer/reference/addons/testing.rst +++ b/content/developer/reference/addons/testing.rst @@ -1,10 +1,8 @@ - .. _reference/testing: - -=============== +============ Testing Odoo -=============== +============ There are many ways to test an application. In Odoo, we have three kinds of tests diff --git a/content/developer/reference/javascript/javascript_cheatsheet.rst b/content/developer/reference/javascript/javascript_cheatsheet.rst index 82e7dda28..cc5d3a680 100644 --- a/content/developer/reference/javascript/javascript_cheatsheet.rst +++ b/content/developer/reference/javascript/javascript_cheatsheet.rst @@ -280,12 +280,13 @@ using the view in the kanban arch (a specific example is the helpdesk dashboard) need to have a valid arch field. Promises and asynchronous code -=============================== +============================== For a very good and complete introduction to promises, please read this excellent article https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/async%20%26%20performance/ch3.md Creating new Promises ------------------------ +--------------------- + - turn a constant into a promise There are 2 static functions on Promise that create a resolved or rejected promise based on a constant: @@ -383,6 +384,7 @@ Creating new Promises Waiting for Promises -------------------- + - waiting for a number of Promises if you have multiple promises that all need to be waited, you can convert them into a single promise that will be resolved when all the promises are resolved using Promise.all(arrayOfPromises). @@ -486,7 +488,7 @@ Error handling Testing asynchronous code --------------------------- +------------------------- - using promises in tests In the tests code, we support the latest version of Javascript, including primitives like `async` and `await`. This makes using and waiting for promises very easy. diff --git a/content/developer/reference/javascript/javascript_reference.rst b/content/developer/reference/javascript/javascript_reference.rst index 5f4b8fa03..71675f04b 100644 --- a/content/developer/reference/javascript/javascript_reference.rst +++ b/content/developer/reference/javascript/javascript_reference.rst @@ -1,11 +1,10 @@ - .. highlight:: javascript .. default-domain:: js -===================== +==================== Javascript Reference -===================== +==================== This document presents the Odoo Javascript framework. This framework is not a large application in term of lines of code, but it is quite @@ -15,7 +14,7 @@ records in the database. It is even possible to use the web client to modify the interface of the web client. Overview -========= +======== The Javascript framework is designed to work with three main use cases: @@ -53,7 +52,7 @@ action manager) actually creates and destroys many sub components. The state is highly dynamic, and each widget could be destroyed at any time. Overview of web client JS code -------------------------------------- +------------------------------ Here, we give a very quick overview on the web client code, in the *web/static/src/js* addon. Note that it is deliberately not exhaustive. @@ -133,6 +132,7 @@ them once. Main bundles ------------ + When the Odoo server is started, it checks the timestamp of each file in a bundle, and if necessary, will create/recreate the corresponding bundles. @@ -326,10 +326,8 @@ If an error happens, it will be logged (in debug mode) in the console: * ``Non loaded modules``: Modules who depend on a missing or a failed module - - Asynchronous modules ---------------------- +-------------------- It can happen that a module needs to perform some work before it is ready. For example, it could do a rpc to load some data. In that case, the module can @@ -351,7 +349,7 @@ wait for the promise to complete before registering the module. Best practices ----------------- +-------------- - remember the convention for a module name: *addon name* suffixed with *module name*. @@ -368,7 +366,6 @@ Best practices - try to avoid defining more than one module in one file. It may be convenient in the short term, but this is actually harder to maintain. - Class System ============ @@ -417,7 +414,6 @@ framework will secretly rebind a special method: *_super* to the currently called method. This allows us to use *this._super* whenever we need to call a parent method. - .. code-block:: javascript var Animal = require('web.Animal'); @@ -461,7 +457,6 @@ of them in the new class. In this example, the *Hamster* class is a subclass of Animal, but it also mix the DanceMixin in. - Patching an existing class -------------------------- @@ -486,7 +481,6 @@ the way Odoo is structured, it is sometimes necessary in one addon to modify the behavior of a widget/class defined in another addon. Note that it will modify all instances of the class, even if they have already been created. - Widgets ======= @@ -736,7 +730,6 @@ Widget API :param Element element: a DOM element or jQuery object to set as the widget's DOM root - Inserting a widget in the DOM ----------------------------- @@ -770,7 +763,7 @@ and are charged with three tasks: * starting the widget, and returning the result of starting it Widget Guidelines ----------------------- +----------------- * Identifiers (``id`` attribute) should be avoided. In generic applications and modules, ``id`` limits the re-usability of components and tends to make @@ -878,7 +871,6 @@ in order to make the web client slightly lighter. In that case, we can use the With this, the *Counter* widget will load the xmlDependencies files in its *willStart* method, so the template will be ready when the rendering is performed. - Event system ============ @@ -970,9 +962,8 @@ The previous example can be updated to use the custom event system: ... this.trigger_up('valuechange', {value: someValue}); - Registries -=========== +========== A common need in the Odoo ecosystem is to extend/change the behaviour of the base system from the outside (by installing an application, i.e. a different @@ -1009,7 +1000,6 @@ action registry action. In version 11, each value should simply be a subclass of *Widget*. However, in version 12, the values are required to be *AbstractAction*. - Communication between widgets ============================= @@ -1077,7 +1067,6 @@ Cross component }, }); - In this example, we use the bus exported by *web.core*, but this is not required. A bus could be created for a specific purpose. @@ -1094,7 +1083,7 @@ events, these events bubble up to a service provider, which will ask a service to perform a task, then maybe return an answer. Service --------- +------- A service is an instance of the *AbstractService* class. It basically only has a name and a few methods. Its job is to perform some work, typically something @@ -1126,7 +1115,6 @@ dispatch the custom events. In the *backend* (web client), this is done by the main web client instance. Note that the code for the service provider comes from the *ServiceProviderMixin*. - Widget ------ @@ -1185,7 +1173,7 @@ may need to directly call a controller (available on some route). }); Notifications -============== +============= The Odoo framework has a standard way to communicate various information to the user: notifications, which are displayed on the top right of the user interface. @@ -1220,9 +1208,9 @@ The notification system in Odoo is designed with the following components: - two helper functions in *ServiceMixin*: *do_notify* and *do_warn* - Displaying a notification ------------------------- + The most common way to display a notification is by using two methods that come from the *ServiceMixin*: @@ -1310,7 +1298,6 @@ the class variable SystrayMenu.items. SystrayMenu.Items.push(MySystrayWidget); - Ordering -------- @@ -1324,7 +1311,6 @@ left). MySystrayWidget.prototype.sequence = 100; - Translation management ====================== @@ -1419,7 +1405,7 @@ client for everyone), and for data which is required early in the initialization process. Views -====== +===== The word 'view' has more than one meaning. This section is about the design of the javascript code of the views, not the structure of the *arch* or anything @@ -1428,7 +1414,6 @@ else. In 2017, Odoo replaced the previous view code with a new architecture. The main need was to separate the rendering logic from the model logic. - Views (in a generic sense) are now described with 4 pieces: a View, a Controller, a Renderer and a Model. The API of these 4 pieces is described in the AbstractView, AbstractController, AbstractRenderer and AbstractModel classes. @@ -2280,7 +2265,6 @@ reference (FieldReference) - Supported field types: *char, reference* - Client actions ============== @@ -2345,7 +2329,6 @@ Registering the client action: my-custom-action - Using the control panel ----------------------- diff --git a/content/developer/reference/javascript/mobile.rst b/content/developer/reference/javascript/mobile.rst index 8fed85297..873412dc2 100644 --- a/content/developer/reference/javascript/mobile.rst +++ b/content/developer/reference/javascript/mobile.rst @@ -1,9 +1,8 @@ - .. _reference/mobile: -================== +================= Mobile JavaScript -================== +================= Introduction ============ @@ -11,15 +10,16 @@ Introduction In Odoo 10.0 we released a mobile app which allows you to access all **Odoo apps** (even your customized modules). -The application is a combination of **Odoo Web** and **Native Mobile -components**. In other words it is a Odoo Web instance loaded inside a native, mobile, WebView container. +The application is a combination of **Odoo Web** and **Native Mobile components**. In other words it +is a Odoo Web instance loaded inside a native, mobile, WebView container. This page documents how you can access mobile native components like Camera, Vibration, Notification and Toast through Odoo Web (via JavaScript). For this, you do not need to be a mobile developer, if you know Odoo JavaScript API you can access all available mobile features. -.. warning:: These features work with **Odoo Enterprise 10.0+** only +.. warning:: + These features work with **Odoo Enterprise 10.0+** only How does it work? ================= @@ -64,7 +64,7 @@ Methods a data JSON dictionary Show Toast in device -..................... +~~~~~~~~~~~~~~~~~~~~ .. js:function:: showToast @@ -80,10 +80,8 @@ remains visible and interactive. .. image:: mobile/toast.png - Vibrating device -................ - +~~~~~~~~~~~~~~~~ .. js:function:: vibrate @@ -97,7 +95,7 @@ Vibrate mobile device with given duration. mobile.methods.vibrate({'duration': 100}); Show snackbar with action -......................... +~~~~~~~~~~~~~~~~~~~~~~~~~ .. js:function:: showSnackBar @@ -122,7 +120,7 @@ displayed at a time. .. image:: mobile/snackbar.png Showing notification -..................... +~~~~~~~~~~~~~~~~~~~~ .. js:function:: showNotification @@ -143,7 +141,7 @@ view at any time. Create contact in device -......................... +~~~~~~~~~~~~~~~~~~~~~~~~ .. js:function:: addContact @@ -176,7 +174,7 @@ Create a new device contact with the given contact details. .. image:: mobile/mobile_contact_create.png Scanning barcodes -.................. +~~~~~~~~~~~~~~~~~ .. js:function:: scanBarcode @@ -198,7 +196,7 @@ The barcode API can read the following barcode formats: }); Switching account in device -........................... +~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. js:function:: switchAccount diff --git a/content/developer/reference/javascript/qweb.rst b/content/developer/reference/javascript/qweb.rst index 43d32d0ee..8616c3bdd 100644 --- a/content/developer/reference/javascript/qweb.rst +++ b/content/developer/reference/javascript/qweb.rst @@ -248,9 +248,8 @@ exists in 3 different forms: setting variables ================= -QWeb allows creating variables from within the template, to memoize a -computation (to use it multiple times), give a piece of data a clearer name, -... +QWeb allows creating variables from within the template, to memoize a computation (to use it +multiple times), give a piece of data a clearer name, ... This is done via the ``set`` directive, which takes the name of the variable to create. The value to set can be provided in two ways: @@ -337,12 +336,12 @@ Exclusive directives -------------------- Asset bundles -''''''''''''' +~~~~~~~~~~~~~ .. todo:: have fme write these up because I've no idea how they work "smart records" fields formatting -''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``t-field`` directive can only be used when performing field access (``a.b``) on a "smart" record (result of the ``browse`` method). It is able @@ -367,7 +366,7 @@ Helpers ------- Request-based -''''''''''''' +~~~~~~~~~~~~~ Most Python-side uses of QWeb are in controllers (and during HTTP requests), in which case templates stored in the database (as @@ -384,7 +383,7 @@ This automatically creates a :class:`~odoo.http.Response` object which can be returned from the controller (or further customized to suit). View-based -'''''''''' +~~~~~~~~~~ At a deeper level than the previous helper is the ``render`` method on ``ir.ui.view``: @@ -438,7 +437,7 @@ Exclusive directives -------------------- Defining templates -'''''''''''''''''' +~~~~~~~~~~~~~~~~~~ The ``t-name`` directive can only be placed at the top-level of a template file (direct children to the document root):: @@ -457,7 +456,7 @@ are related (e.g. called sub-templates) it is customary to use dot-separated names to indicate hierarchical relationships. Template inheritance -'''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~ Template inheritance is used to either: - Alter existing templates in-place, e.g. to add information to templates @@ -494,7 +493,7 @@ Extension inheritance (in-place transformation):: Old inheritance mechanism (deprecated) -'''''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Template inheritance is performed via the ``t-extend`` directive which takes the name of the template to alter as parameter. diff --git a/content/last_build.rst b/content/last_build.rst index e946fb937..dbe69a93d 100644 --- a/content/last_build.rst +++ b/content/last_build.rst @@ -1,6 +1,7 @@ :orphan: :nosearch: +=============== Last build date ===============