diff --git a/content/administration/install/deploy.rst b/content/administration/install/deploy.rst index 2f0800331..3e97714dd 100644 --- a/content/administration/install/deploy.rst +++ b/content/administration/install/deploy.rst @@ -608,6 +608,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/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/accounting/receivables/customer_invoices/overview.rst b/content/applications/finance/accounting/receivables/customer_invoices/overview.rst index fe22c34ac..9b1479aba 100644 --- a/content/applications/finance/accounting/receivables/customer_invoices/overview.rst +++ b/content/applications/finance/accounting/receivables/customer_invoices/overview.rst @@ -149,7 +149,7 @@ It remains possible to resequence the invoices but with some restrictions: current year without starting over from the beginning. Invoice digitization with optical character recognition (OCR) ---------------------------------------------------------------- +------------------------------------------------------------- **Invoice digitization** is the process of automatically encoding traditional paper invoices into invoices forms in your accounting. diff --git a/content/applications/finance/documents.rst b/content/applications/finance/documents.rst index f40954a7d..b5fc07c06 100644 --- a/content/applications/finance/documents.rst +++ b/content/applications/finance/documents.rst @@ -209,4 +209,4 @@ digitize, click on :guilabel:`Create Bill`, :guilabel:`Create Customer Invoice` :guilabel:`Create credit note`, and then click on :guilabel:`Send for Digitization`. .. seealso:: - :doc:`AI-powered document digitization <../finance/accounting/payables/supplier_bills/invoice_digitization>` \ No newline at end of file + :doc:`AI-powered document digitization <../finance/accounting/payables/supplier_bills/invoice_digitization>` diff --git a/content/applications/finance/fiscal_localizations/argentina.rst b/content/applications/finance/fiscal_localizations/argentina.rst index eed96bdef..814aebfbd 100644 --- a/content/applications/finance/fiscal_localizations/argentina.rst +++ b/content/applications/finance/fiscal_localizations/argentina.rst @@ -86,8 +86,7 @@ into the **Production** environment. As these two environments are completely is other, the digital certificates of one instance are not valid in the other one. To select a database environment, go to :menuselection:`Accounting --> Settings --> Argentinean -Localization` and choose either :guilabel:`Prueba (Testing)` or :guilabel:`Produccion (Production)` -. +Localization` and choose either :guilabel:`Prueba (Testing)` or :guilabel:`Produccion (Production)`. .. image:: argentina/select-environment.png :align: center diff --git a/content/applications/finance/fiscal_localizations/colombia.rst b/content/applications/finance/fiscal_localizations/colombia.rst index fc4e32a5f..1d4c5297e 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/india.rst b/content/applications/finance/fiscal_localizations/india.rst index 5c8db6012..d75b3c853 100644 --- a/content/applications/finance/fiscal_localizations/india.rst +++ b/content/applications/finance/fiscal_localizations/india.rst @@ -208,7 +208,7 @@ Odoo is compliant with the **Indian Goods and Services Tax (GST) E-waybill syste .. _india/e-waybill-api: API Registration on your NIC E-waybill web portal --------------------------------------------------- +------------------------------------------------- You must register on the **NIC E-waybill** web portal to create your **API credentials**. You need these credentials to :ref:`configure your Odoo Accounting app `. 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 738a1793b..971f44c86 100644 --- a/content/applications/finance/fiscal_localizations/peru.rst +++ b/content/applications/finance/fiscal_localizations/peru.rst @@ -533,9 +533,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: @@ -578,9 +577,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/email_communication/email_template.rst b/content/applications/general/email_communication/email_template.rst index e649e5f37..f73fac16f 100644 --- a/content/applications/general/email_communication/email_template.rst +++ b/content/applications/general/email_communication/email_template.rst @@ -13,7 +13,7 @@ improving their overall experience with the company. making customizations more robust as you don’t have to edit code. Defining a default reply to on your mail template -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +================================================= Although the field *reply to* is available within the mail templates, **this field is only used for mass mailing** mode (this means when sending templates on what we call bulk emailing). You @@ -37,7 +37,7 @@ communication between your customer and your Odoo database. For more information the catchall works, please check :ref:`how to manage inbound messages `. Transactional emails and corresponding URL for each company -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +=========================================================== When using Odoo, multiple events trigger the sending of automated emails. These emails are known as transactional emails and sometimes contain links pointing to your Odoo database. @@ -72,7 +72,7 @@ For more information about how to configure your domains, we invite you to check documentation `. Updating translations within email templates -******************************************** +-------------------------------------------- Email templates are automatically translated. Changing the translations shouldn’t be necessary. However, if for a specific reason you’d like to change some of the translations, this can be done. 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/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/inventory_and_mrp/inventory/shipping/setup/sendcloud_shipping.rst b/content/applications/inventory_and_mrp/inventory/shipping/setup/sendcloud_shipping.rst index 4dc516da8..0f093a99b 100644 --- a/content/applications/inventory_and_mrp/inventory/shipping/setup/sendcloud_shipping.rst +++ b/content/applications/inventory_and_mrp/inventory/shipping/setup/sendcloud_shipping.rst @@ -1,6 +1,6 @@ -============================================ +========================================== Set up Sendcloud shipping services in Odoo -============================================ +========================================== Sendcloud is a shipping service aggregator that facilitates the integration of European shipping carriers with Odoo. Once integrated, users can select shipping carriers on inventory @@ -11,7 +11,7 @@ operations in their Odoo database. /360059470491-Odoo-integration>`_ Setup in Sendcloud -=================== +================== Create an account and activate carriers --------------------------------------- diff --git a/content/applications/inventory_and_mrp/manufacturing/management/quality_control.rst b/content/applications/inventory_and_mrp/manufacturing/management/quality_control.rst index 0f14718bd..d63f25c8c 100644 --- a/content/applications/inventory_and_mrp/manufacturing/management/quality_control.rst +++ b/content/applications/inventory_and_mrp/manufacturing/management/quality_control.rst @@ -1,6 +1,6 @@ -================= +=============== Quality Control -================= +=============== Whether you want to control the quality of your production, or the production of your subcontractor, before registering the products into your stock, you can diff --git a/content/applications/inventory_and_mrp/manufacturing/management/subcontracting.rst b/content/applications/inventory_and_mrp/manufacturing/management/subcontracting.rst index 3fd6f93f3..b4ddb99c2 100644 --- a/content/applications/inventory_and_mrp/manufacturing/management/subcontracting.rst +++ b/content/applications/inventory_and_mrp/manufacturing/management/subcontracting.rst @@ -195,7 +195,7 @@ From the location form, you are then able to access the Current Stock. Manual Replenishment --------------------------------- +-------------------- You can also choose to replenish your subcontractors manually. 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/sales/point_of_sale/payment/six.rst b/content/applications/sales/point_of_sale/payment/six.rst index 3f3fbb3ba..42cfef667 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 b9424b5d9..5915a1ed4 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 criteria to use a specific price: periods, min. sold quantity (meet a minimum order quantity and get a price break), etc. +You can set several criteria 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/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 39af40b5d..8fa2275b4 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 ------------- @@ -566,7 +567,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 ==================== @@ -617,7 +618,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/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 9ef08c79a..0c9603f93 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) @@ -588,6 +591,7 @@ Programming in Odoo 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 : @@ -610,7 +614,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 ~~~~~~~~~~~~~~~~ @@ -654,9 +657,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 @@ -722,7 +725,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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -811,7 +813,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 ----------------------- @@ -925,7 +926,7 @@ Javascript ========== 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 45b2c33d7..715511208 100644 --- a/content/developer/cli.rst +++ b/content/developer/cli.rst @@ -1,4 +1,3 @@ - .. _reference/cmdline: ============================ @@ -383,7 +382,7 @@ Advanced Options .. _reference/cmdline/dev: Developer features -'''''''''''''''''' +~~~~~~~~~~~~~~~~~~ .. option:: --dev @@ -411,7 +410,7 @@ Developer features .. _reference/cmdline/server/http: HTTP -'''' +~~~~ .. option:: --no-http @@ -454,7 +453,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 @@ -539,7 +538,7 @@ customize the amount of logging output. .. _reference/cdmline/workers: Multiprocessing -''''''''''''''' +~~~~~~~~~~~~~~~ .. option:: --workers @@ -813,7 +812,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 @@ -846,12 +845,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 @@ -874,7 +871,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: @@ -883,7 +880,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 3c8d83ac3..537553586 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/backend/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 diff --git a/content/developer/howtos/discover_js_framework/02_odoo_web_framework.rst b/content/developer/howtos/discover_js_framework/02_odoo_web_framework.rst index 934c16de7..8906944ac 100644 --- a/content/developer/howtos/discover_js_framework/02_odoo_web_framework.rst +++ b/content/developer/howtos/discover_js_framework/02_odoo_web_framework.rst @@ -1,6 +1,6 @@ -============================== +============================= Chapter 2: Odoo web framework -============================== +============================= In the previous chapter, we learned to use Owl framework and its different concepts. We can now learn how to use the Odoo JavaScript framework which is is built on top of Owl. diff --git a/content/developer/howtos/rdtraining/02_setup.rst b/content/developer/howtos/rdtraining/02_setup.rst index c01ee32a7..4efd0c6ff 100644 --- a/content/developer/howtos/rdtraining/02_setup.rst +++ b/content/developer/howtos/rdtraining/02_setup.rst @@ -287,7 +287,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 @@ -376,7 +376,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 ed0003c16..cdab8b196 100644 --- a/content/developer/howtos/rdtraining/J_reports.rst +++ b/content/developer/howtos/rdtraining/J_reports.rst @@ -205,7 +205,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 e811db156..c6d2c9508 100644 --- a/content/developer/howtos/rdtraining/K_dashboard.rst +++ b/content/developer/howtos/rdtraining/K_dashboard.rst @@ -105,6 +105,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 @@ -130,6 +131,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 @@ -164,6 +166,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 @@ -192,6 +195,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 @@ -248,6 +252,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``:: @@ -318,6 +323,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 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 @@ -334,6 +340,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 fefdb16f3..d889246c6 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. @@ -183,7 +180,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. @@ -808,7 +805,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. @@ -822,7 +819,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. @@ -1100,11 +1097,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 69fcec3bd..36572c0ed 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/backend/actions.rst b/content/developer/reference/backend/actions.rst index af97c5306..c8097bf58 100644 --- a/content/developer/reference/backend/actions.rst +++ b/content/developer/reference/backend/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/backend/data.rst b/content/developer/reference/backend/data.rst index 616581da8..a10359ca5 100644 --- a/content/developer/reference/backend/data.rst +++ b/content/developer/reference/backend/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/backend/mixins.rst b/content/developer/reference/backend/mixins.rst index 4f91c8e2f..7fe9ba0b8 100644 --- a/content/developer/reference/backend/mixins.rst +++ b/content/developer/reference/backend/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/backend/orm.rst b/content/developer/reference/backend/orm.rst index 665b8ea91..a3c9cee77 100644 --- a/content/developer/reference/backend/orm.rst +++ b/content/developer/reference/backend/orm.rst @@ -153,7 +153,7 @@ Advanced Fields .. _reference/fields/date: Date(time) Fields -''''''''''''''''' +~~~~~~~~~~~~~~~~~ :class:`Dates ` and :class:`Datetimes ` are very important fields in any kind of business application. @@ -214,7 +214,7 @@ These helpers are also available by importing `odoo.tools.date_utils`. .. _reference/fields/relational: Relational Fields -''''''''''''''''' +~~~~~~~~~~~~~~~~~ .. autoclass:: Many2one() @@ -228,7 +228,7 @@ Relational Fields :member-order: bysource Pseudo-relational fields -'''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~ .. autoclass:: Reference() @@ -237,7 +237,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 @@ -328,7 +328,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 @@ -410,7 +410,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 @@ -472,10 +472,10 @@ behavior is desired: .. automethod:: Model.action_unarchive .. .. attribute:: sequence -.. + .. Alterable ordering criteria, allows drag-and-drop reordering of models .. in list views. -.. + .. :class:`~odoo.fields.Integer` .. attribute:: Model.state @@ -852,14 +852,14 @@ Search/Read .. automethod:: Model.read_group Fields -'''''' +~~~~~~ .. automethod:: Model.fields_get .. _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: @@ -1021,14 +1021,14 @@ Recordsets therefore provide the following operations returning recordsets thems (when possible): Filter -'''''' +~~~~~~ .. automethod:: Model.filtered .. automethod:: Model.filtered_domain Map -''' +~~~ .. automethod:: Model.mapped @@ -1043,12 +1043,12 @@ Map records.partner_id.mapped('name') # == records.mapped('partner_id.name') Sort -'''' +~~~~ .. automethod:: Model.sorted Grouping -'''''''' +~~~~~~~~ .. automethod:: Model.grouped diff --git a/content/developer/reference/backend/orm/changelog.rst b/content/developer/reference/backend/orm/changelog.rst index ce6449da2..1651c0146 100644 --- a/content/developer/reference/backend/orm/changelog.rst +++ b/content/developer/reference/backend/orm/changelog.rst @@ -5,7 +5,7 @@ Changelog ========= Odoo version 16.0 -======================== +================= - Translations for translated fields are stored as JSONB values with `#97692 `_ diff --git a/content/developer/reference/backend/reports.rst b/content/developer/reference/backend/reports.rst index 92cb3bae9..1d084d034 100644 --- a/content/developer/reference/backend/reports.rst +++ b/content/developer/reference/backend/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/backend/security.rst b/content/developer/reference/backend/security.rst index 39b10b612..59714e722 100644 --- a/content/developer/reference/backend/security.rst +++ b/content/developer/reference/backend/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/backend/testing.rst b/content/developer/reference/backend/testing.rst index f74ea1f82..5bad6e4f4 100644 --- a/content/developer/reference/backend/testing.rst +++ b/content/developer/reference/backend/testing.rst @@ -1,9 +1,8 @@ .. _reference/testing: - -=============== +============ Testing Odoo -=============== +============ There are many ways to test an application. In Odoo, we have three kinds of tests @@ -734,7 +733,8 @@ Observing tours in a browser There are two ways with different tradeoffs: ``watch=True`` -'''''''''''''' +************** + When running a tour locally via the test suite, the ``watch=True`` parameter can be added to the ``browser_js`` or ``start_tour`` call:: @@ -753,7 +753,8 @@ run inside it. - only works if the test / tour can run correctly locally Run via browser -''''''''''''''' +*************** + Tours can also be launched via the browser UI, either by calling .. code-block:: javascript diff --git a/content/developer/reference/backend/views.rst b/content/developer/reference/backend/views.rst index 9e6537990..78f416b54 100644 --- a/content/developer/reference/backend/views.rst +++ b/content/developer/reference/backend/views.rst @@ -337,7 +337,7 @@ A view's specs are applied sequentially. all the specified classes Model Commons -==================== +============= .. currentmodule:: odoo.addons.base.models.ir_ui_view @@ -348,6 +348,7 @@ Attributes Methods ------- + .. automethod:: Model.get_views .. automethod:: Model.get_view diff --git a/content/developer/reference/frontend/javascript_cheatsheet.rst b/content/developer/reference/frontend/javascript_cheatsheet.rst index 82e7dda28..cc5d3a680 100644 --- a/content/developer/reference/frontend/javascript_cheatsheet.rst +++ b/content/developer/reference/frontend/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/frontend/javascript_modules.rst b/content/developer/reference/frontend/javascript_modules.rst index 316acf4f5..194f46134 100644 --- a/content/developer/reference/frontend/javascript_modules.rst +++ b/content/developer/reference/frontend/javascript_modules.rst @@ -263,7 +263,7 @@ within the same Odoo addon. .. _frontend/modules/odoo_module: Odoo Module System -=================== +================== Odoo has defined a small module system (located in the file :file:`addons/web/static/src/js/boot.js`, which needs to be loaded first). The Odoo @@ -371,7 +371,7 @@ If an error happens, it will be logged (in debug mode) in the console: 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 an rpc to load some data. In that case, the module can diff --git a/content/developer/reference/frontend/javascript_reference.rst b/content/developer/reference/frontend/javascript_reference.rst index 4c6cca532..685aa425b 100644 --- a/content/developer/reference/frontend/javascript_reference.rst +++ b/content/developer/reference/frontend/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. @@ -105,7 +104,7 @@ are a few things you can try to solve the issue: Loading Javascript Code -======================== +======================= Large applications are usually broken up into smaller files, that need to be connected together. Some file may need to use some part of code defined in @@ -146,8 +145,6 @@ not the primary way to write javascript code. .. note:: Native javascript modules are the primary way to define javascript code. - - Class System ============ @@ -204,7 +201,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'); @@ -248,7 +244,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 -------------------------- @@ -273,7 +268,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 ======= @@ -524,7 +518,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 ----------------------------- @@ -558,7 +551,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 @@ -668,7 +661,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 ============ @@ -760,9 +752,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 @@ -799,7 +790,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 ============================= @@ -867,7 +857,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. @@ -884,7 +873,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 @@ -916,7 +905,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 ------ @@ -975,7 +963,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. @@ -1010,9 +998,9 @@ The notification system in Odoo is designed with the following components: - an helper function in *ServiceMixin*: *displayNotification* - Displaying a notification ------------------------- + The most common way to display a notification is by using the method that come from the *ServiceMixin*: @@ -1098,7 +1086,6 @@ the class variable SystrayMenu.items. SystrayMenu.Items.push(MySystrayWidget); - Ordering -------- @@ -1112,7 +1099,6 @@ left). MySystrayWidget.prototype.sequence = 100; - Translation management ====================== @@ -1207,7 +1193,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 @@ -1216,7 +1202,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. @@ -2090,6 +2075,7 @@ reference (FieldReference) Widgets ------- + week_days (WeekDays) This field displays a list of checkboxes for week days, 1 checkbox for each day and allow the user to select a subset of the choices. @@ -2162,7 +2148,6 @@ Registering the client action: my-custom-action
- Using the control panel ----------------------- diff --git a/content/developer/reference/frontend/mobile.rst b/content/developer/reference/frontend/mobile.rst index 8fed85297..873412dc2 100644 --- a/content/developer/reference/frontend/mobile.rst +++ b/content/developer/reference/frontend/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/frontend/owl_components.rst b/content/developer/reference/frontend/owl_components.rst index b9dd2ce6f..71f7994fe 100644 --- a/content/developer/reference/frontend/owl_components.rst +++ b/content/developer/reference/frontend/owl_components.rst @@ -572,7 +572,7 @@ open themselves on mouse hover, without the need for a click. Example: Direct Siblings Dropdown -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When one dropdown toggler is clicked (**File** , **Edit** or **About**), the others will open themselves on hover. diff --git a/content/developer/reference/frontend/qweb.rst b/content/developer/reference/frontend/qweb.rst index 49e80886f..96d6fec16 100644 --- a/content/developer/reference/frontend/qweb.rst +++ b/content/developer/reference/frontend/qweb.rst @@ -257,9 +257,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: @@ -374,7 +373,7 @@ templates: will not strip that information from safe content. Creating safe content using :class:`~markupsafe.Markup` -''''''''''''''''''''''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See the official documentation for explanations, but the big advantage of :class:`~markupsafe.Markup` is that it's a very rich type overrinding @@ -471,12 +470,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 @@ -511,7 +510,7 @@ are also done only once. The content can only use the root values. Why and when to use ``t-cache``? -'''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This directive is used to speed up the rendering, by caching parts of the final document, which may save queries to the database. However, it should be used @@ -542,7 +541,7 @@ the template, the rendering of what comes after it could be different than if there was no ``t-cache`` directive. What if there is a ``t-cache`` inside a ``t-cache``? -'''''''''''''''''''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The parts are cached. Each containing only the string corresponding to its rendering. Thus, the ``t-cache`` inside will probably be read less often, its @@ -550,7 +549,7 @@ cache key will not necessarily be used. If this must be the case, then you may need to add a ``t-nocache`` (on the same node or a parent). What is ``t-nocache`` used for? -''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you want to cache part of a template with ``t-cache`` but a small piece must remain dynamic and be evaluated at cache times. However, the part in @@ -562,7 +561,7 @@ investigate). However, in the menu, we want the ecommerce cart to be always up to date. So there is a ``t-nocache`` to keep this part dynamic. The base of ``t-cache`` -''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~ The ``t-cache`` directive allows you to store the rendered result of a template. The **key expression** (eg 42: ``t-cache="42"``) will be evaluated as a python @@ -587,7 +586,7 @@ condition. And if a module modifies the record, the write_date being modified, the cached value is discarded. ``t-cache`` and scoped values (``t-set``, ``t-foreach``...) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Values in ``t-cache`` are scoped, this involves a change in behavior between having or not having ``t-cache`` on one of the parent nodes. Don't forget to @@ -626,7 +625,7 @@ Will render:: The base of ``t-nocache`` -''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~ The template part contained in a node with a ``t-nocache`` attribute is not cached. This content is therefore **dynamic** and is rendered systematically. @@ -655,7 +654,7 @@ Here the ```` tag that contains the container will always be rendered. While the rest is as a single string in the cache. ``t-nocache`` and scoped root values (``t-set``, ``t-foreach``...) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The contents of the ``t-nocache`` tag can be used for documentation and to explain why the directive is added. @@ -697,7 +696,7 @@ the rest is as a single string in the cache. The counter is not updated by the ``t-set`` out of the ``t-nocache`` ``t-nocache-*`` add some primitive values in the cache -''''''''''''''''''''''''''''''''''''''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to be able to use values generated in the template, it is possible to cache them. The directive is used as ``t-nocache-*="expr"`` where ``*`` is the @@ -725,7 +724,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 @@ -742,7 +741,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.qweb`` (use the datable) and the public module method ``render`` @@ -808,7 +807,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):: @@ -829,7 +828,7 @@ names to indicate hierarchical relationships. .. _reference/qweb/template_inheritance: Template inheritance -'''''''''''''''''''' +~~~~~~~~~~~~~~~~~~~~ Template inheritance is used to either: - Alter existing templates in-place, e.g. to add information to templates @@ -866,7 +865,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/developer/reference/frontend/services.rst b/content/developer/reference/frontend/services.rst index e92069efb..996ab1056 100644 --- a/content/developer/reference/frontend/services.rst +++ b/content/developer/reference/frontend/services.rst @@ -673,8 +673,7 @@ When a rpc fails, then: * the promise representing the rpc is rejected, so the calling code will crash, unless it handles the situation -* - an event ``RPC_ERROR`` is triggered on the main application bus. The event payload +* an event ``RPC_ERROR`` is triggered on the main application bus. The event payload contains a description of the cause of the error: If it is a server error (the server code threw an exception). In that case diff --git a/content/developer/reference/standard_modules/account/account_report.rst b/content/developer/reference/standard_modules/account/account_report.rst index 34e33ba16..0136d427f 100644 --- a/content/developer/reference/standard_modules/account/account_report.rst +++ b/content/developer/reference/standard_modules/account/account_report.rst @@ -1,7 +1,6 @@ - -=============== +====== Report -=============== +====== .. automodel:: odoo.addons.account.models.account_report.AccountReport :main: diff --git a/content/developer/reference/standard_modules/account/account_report_line.rst b/content/developer/reference/standard_modules/account/account_report_line.rst index 3e34b8b94..85b6e8287 100644 --- a/content/developer/reference/standard_modules/account/account_report_line.rst +++ b/content/developer/reference/standard_modules/account/account_report_line.rst @@ -1,7 +1,6 @@ - -=============== +=========== Report Line -=============== +=========== .. automodel:: odoo.addons.account.models.account_report.AccountReportLine :main: 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 ===============