[FIX] *: RST cleanup

RST cleanup to comply with the RST guidelines. This is required so we
can use "make test", as there are currently hundreds of errors. For now,
it is unusable because of the oldest code in this repo.

closes odoo/documentation#3581

Signed-off-by: Castillo Jonathan (jcs) <jcs@odoo.com>
This commit is contained in:
Jonathan Castillo (jcs) 2023-02-13 15:50:13 +00:00
parent 18b000602b
commit 17319f92b2
67 changed files with 707 additions and 716 deletions

View File

@ -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.

View File

@ -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 <database-name> -u <userid> -p <password>

View File

@ -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
<https://accounts.odoo.com/my/subscription>`__ 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 <duplicate_premise>`.
@ -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 <https://www.odoo.com/help>`__
.. _force_ping:
.. _duplicate_premise:
@ -155,8 +147,7 @@ server (<odoo-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 <https://www.uuidtools.com>`_ 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

View File

@ -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

View File

@ -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 Notes 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.

View File

@ -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 Accounts 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.

View File

@ -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.

View File

@ -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>`
:doc:`AI-powered document digitization <../finance/accounting/payables/supplier_bills/invoice_digitization>`

View File

@ -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

View File

@ -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
--------------------

View File

@ -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 <india/e-waybill-configuration>`.

View File

@ -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.

View File

@ -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)

View File

@ -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”.

View File

@ -13,7 +13,7 @@ improving their overall experience with the company.
making customizations more robust as you dont 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 <email_communication/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 </administration/maintain/domain_names>`.
Updating translations within email templates
********************************************
--------------------------------------------
Email templates are automatically translated. Changing the translations shouldnt be necessary.
However, if for a specific reason youd like to change some of the translations, this can be done.

View File

@ -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 <http://www.pjsip.org/download.htm>`_. Once the source directory is extracted:
You also need to install PJSIP, you can download the source `here
<http://www.pjsip.org/download.htm>`_. 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 <http://www.pj
libpj.so (libc6,x86-64) => /usr/lib/libpj.so
Asterisk
~~~~~~~~
--------
- In order to install Asterisk 13.7.0, you can download the source directly `there <http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.7.0.tar.gz>`_.
- In order to install Asterisk 13.7.0, you can download the source directly `there
<http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.7.0.tar.gz>`_.
- 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 xs 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 xs 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.

View File

@ -15,7 +15,7 @@ to reorganize products and load another truck.
<https://www.odoo.com/blog/business-hacks-1/post/what-is-cross-docking-and-is-it-for-me-270>`_
Configuration
==============
=============
In the *Inventory* app, open :menuselection:`Configuration --> Settings` and activate the
*Multi-Step Routes*.

View File

@ -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.

View File

@ -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
---------------------------------------

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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 <https://www.odoo.com/page/point-of-sale-hardware>`__
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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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*.

View File

@ -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

View File

@ -7,7 +7,7 @@ track trends, identify areas for improvement, manage employees workloads and,
meet your customers 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*.

View File

@ -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,

View File

@ -1,8 +1,8 @@
:nosearch:
=================
=============
Collect taxes
=================
=============
.. toctree::
:titlesonly:

View File

@ -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 ``<keyword>`` 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
----------

View File

@ -42,6 +42,7 @@ Installation
How To Test GeoIP Geolocation In Your Odoo Website
==================================================
1. Go to your website. Open the web page that you want to test ``GeoIP``.
2. Choose :menuselection:`Customize --> HTML/CSS/JS Editor`.
3. Add the following piece of XML in the page :
@ -58,7 +59,9 @@ You should end up with a dictionary indicating the location of the IP address.
.. note::
If the curly braces are empty ``{}``, it can be for any of the following reasons :
- The browsing IP address is the localhost (``127.0.0.1``) or a local area network one (``192.168.*.*``)
- If a reversed proxy is used, make sure to configure it correctly. See :option:`proxy mode <odoo-bin --proxy-mode>`
- The browsing IP address is the localhost (``127.0.0.1``) or a local area network one
(``192.168.*.*``)
- If a reversed proxy is used, make sure to configure it correctly. See :option:`proxy mode
<odoo-bin --proxy-mode>`
- ``geoip2`` is not installed or the GeoIP database file wasn't found
- The GeoIP database was unable to resolve the given IP address

View File

@ -1,6 +1,6 @@
===============================
===========================
How to translate my website
===============================
===========================
Overview
========

View File

@ -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 *<record>*) 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.

View File

@ -1,6 +1,6 @@
=================
==============
Git guidelines
=================
==============
Configure your git
------------------

View File

@ -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 <webservices/extract_api/invoice_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.

View File

@ -1,4 +1,3 @@
.. _reference/cmdline:
============================
@ -379,7 +378,7 @@ Advanced Options
.. _reference/cmdline/dev:
Developer features
''''''''''''''''''
~~~~~~~~~~~~~~~~~~
.. option:: --dev <feature,feature,...,feature>
@ -407,7 +406,7 @@ Developer features
.. _reference/cmdline/server/http:
HTTP
''''
~~~~
.. option:: --no-http
@ -450,7 +449,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
@ -535,7 +534,7 @@ customize the amount of logging output.
.. _reference/cdmline/workers:
Multiprocessing
'''''''''''''''
~~~~~~~~~~~~~~~
.. option:: --workers <count>
@ -809,7 +808,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
@ -842,12 +841,10 @@ per module. This is specified by the ``cloc_exclude`` entry of the manifest:
| For more information about the pattern syntax, see `glob
<https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob>`_.
.. _reference/cmdline/cloc/path-option:
With the :option:`--path` option
''''''''''''''''''''''''''''''''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This method works the same as with the :ref:`--database option
<reference/cmdline/cloc/database-option>` if a manifest file is present in the given
@ -870,7 +867,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:
@ -879,7 +876,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

File diff suppressed because it is too large Load Diff

View File

@ -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.

View File

@ -287,7 +287,7 @@ For JavaScript, we use ESLint and you can find a `configuration file example her
<https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines#use-a-linter>`_.
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 <https://www.pgadmin.org/download/pgadmin-4-apt/>`_ 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
<howto/rdtraining/03_newapp>`!

View File

@ -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!

View File

@ -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 `<widget>` 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,

View File

@ -28,12 +28,9 @@ From common CMS to Odoo
-----------------------
.. note::
If you always think and work in the same way, youll 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
======================
=====================
Odoos 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 snippets 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.

View File

@ -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::

View File

@ -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 <setup/install>`, 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 <reference/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 <reference/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:
<div>Hello Mordecai</div>
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:
<div><t t-esc="name.toUpperCase()"/></div>
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:
</div>
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 <reference/actions>` 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 <reference/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.

View File

@ -408,7 +408,7 @@ how the POS interface works.
.. _reference/actions/cron:
Automated Actions (``ir.cron``)
======================================
===============================
Actions triggered automatically on a predefined frequency.

View File

@ -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

View File

@ -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:

View File

@ -153,7 +153,7 @@ Advanced Fields
.. _reference/fields/date:
Date(time) Fields
'''''''''''''''''
~~~~~~~~~~~~~~~~~
:class:`Dates <odoo.fields.Date>` and :class:`Datetimes <odoo.fields.Datetime>`
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,7 +1043,7 @@ Map
records.partner_id.mapped('name') # == records.mapped('partner_id.name')
Sort
''''
~~~~
.. automethod:: Model.sorted

View File

@ -5,7 +5,7 @@ Changelog
=========
Odoo version 16.0
========================
=================
- Translations for translated fields are stored as JSONB values with
`#97692 <https://github.com/odoo/odoo/pull/97692>`_

View File

@ -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.

View File

@ -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

View File

@ -1,9 +1,8 @@
.. _reference/testing:
===============
============
Testing Odoo
===============
============
There are many ways to test an application. In Odoo, we have three kinds of
tests
@ -737,7 +736,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::
@ -756,7 +756,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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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:
<field name="tag">my-custom-action</field>
</record>
Using the control panel
-----------------------

View File

@ -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

View File

@ -487,7 +487,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.

View File

@ -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 ``<i>`` 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)::
</t>
Old inheritance mechanism (deprecated)
''''''''''''''''''''''''''''''''''''''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Template inheritance is performed via the ``t-extend`` directive which takes
the name of the template to alter as parameter.

View File

@ -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

View File

@ -1,7 +1,6 @@
===============
======
Report
===============
======
.. automodel:: odoo.addons.account.models.account_report.AccountReport
:main:

View File

@ -1,7 +1,6 @@
===============
===========
Report Line
===============
===========
.. automodel:: odoo.addons.account.models.account_report.AccountReportLine
:main:

View File

@ -1,6 +1,7 @@
:orphan:
:nosearch:
===============
Last build date
===============