Compare commits

..

7 Commits

Author SHA1 Message Date
Perman Atayev
5098eaf93f Typo fix 2021-11-30 09:50:32 +01:00
Rémy Baranx (bar)
57e1e31433 [FIX] conf.py: check odoo_dir is a real Odoo sources dir
In `conf.py`, we try to find a Odoo sources folder among `odoo` and
`../odoo` directories without really checking that they really are
Odoo sources folders, leading to doc generation error if it's not the case.

So, to improve that, this commit checks that the selected Odoo sources folder
contains `odoo-bin`.

While we're at it, the logging is also improved to always display the
matching odoo sources' folder and version.

closes odoo/documentation#1340

X-original-commit: f72e557f2c
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Antoine Vandevenne <anv@odoo.com>
2021-11-29 10:59:09 +00:00
lejeune quentin
afa905b9c4 [FIX] point_of_sale: Update certificate import
With the new version of chrome 95 we need adapt the documentation

closes odoo/documentation#1318

X-original-commit: 0f1f90e486
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-22 07:58:58 +00:00
Géry Debongnie
8c1003e363 [IMP] developer: small rework of assets page (frontend)
This commit applies some remarks by Antoine.

closes odoo/documentation#1327

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-19 13:24:53 +00:00
luvi
1f84bab97d [ADD] developer: scroller service added
This commit adds the documentation related to
the scroller service. This service is used for
the webclient to handle clicks on links and there
were no documentation related until now.

closes odoo/documentation#1313

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-19 11:36:52 +00:00
Zachary Straub (ZST)
0653e3df58 [IMP] finance: remove fiscal localization countries screenshots
closes odoo/documentation#1311

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-17 11:17:49 +00:00
Antoine Dupuis (andu)
15a1f73c28 [IMP] accounting/taxcloud: how to set up default account for new taxes
New taxes generated by the TaxCloud integration are by default created without an income or an expense account specified. By default, the journal items corresponding to these taxes therefore end up in the default income account, which is usually the 'Sales' account, when they should in fact go to the 'Tax Payable' account. Because these taxes are automatically generated on-the-fly, the user is usually not able to manually specify the Tax Payable account before the journal items are posted, leading to incorrect accounting entries which then need to be manually repaired through the use of miscellaneous operations.

To solve this issue, our video on TaxCloud integration (https://www.youtube.com/watch?v=JE-NeRNIWeU&t=616s) tells us to create a User-Defined Default for the account field of the tax.repartition.line model. This sets the default account with which new taxes are created. However, this information is missing from the documentation.

This PR brings the documentation up-to-date by explaining how to create this User-Defined Default that specifies the correct Tax Payable account.

closes odoo/documentation#1321

X-original-commit: 35d773a82a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-11-17 09:50:08 +00:00
15 changed files with 182 additions and 352 deletions

53
conf.py
View File

@@ -58,39 +58,44 @@ extension_dir = Path('extensions')
sys.path.insert(0, str(extension_dir.absolute()))
# Search for the directory of odoo sources to know whether autodoc should be used on the dev doc
odoo_dir = Path('odoo')
odoo_sources_candidate_dirs = (Path('odoo'), Path('../odoo'))
odoo_sources_dirs = [
d for d in odoo_sources_candidate_dirs if d.is_dir() and (d / 'odoo-bin').exists()
]
odoo_dir_in_path = False
if not odoo_dir.is_dir():
parent_odoo_dir = Path('../odoo')
if parent_odoo_dir.is_dir():
_logger.info('Using parent dir to find odoo sources')
odoo_dir = parent_odoo_dir
if not odoo_dir.is_dir():
if not odoo_sources_dirs:
_logger.warning(
f"Could not find Odoo sources directory at {odoo_dir.absolute()}.\n"
f"The 'Developer' documentation will be built but autodoc directives will be skipped.\n"
f"In order to fully build the 'Developer' documentation, clone the repository with "
f"`git clone https://github.com/odoo/odoo` or create a symbolic link."
"Could not find Odoo sources directory in neither of the following folders:\n"
"%(dir_list)s\n"
"The 'Developer' documentation will be built but autodoc directives will be skipped.\n"
"In order to fully build the 'Developer' documentation, clone the repository with "
"`git clone https://github.com/odoo/odoo` or create a symbolic link.",
{'dir_list': '\n'.join([f'\t- {d.resolve()}' for d in odoo_sources_candidate_dirs])},
)
else:
sys.path.insert(0, str(odoo_dir.absolute()))
if sys.version_info < (3, 7) and sys.version_info > (3, 6):
# running odoo needs python 3.7 min but monkey patch version_info to be
# able to build the doc in python 3.6
odoo_dir = odoo_sources_dirs[0].resolve()
sys.path.insert(0, str(odoo_dir))
if (3, 6) < sys.version_info < (3, 7):
# Running odoo needs python 3.7 min but monkey patch version_info to be compatible with 3.6
sys.version_info = (3, 7, 0)
from odoo import release as odoo_release # Don't collide with Sphinx's 'release' config option
odoo_version = odoo_release.version.replace('~', '-') \
if 'alpha' not in odoo_release.version else 'master'
if release != odoo_version:
_logger.warning(
f"Found Odoo sources directory but with version '{odoo_version}' incompatible with "
f"documentation version '{version}'.\n"
f"The 'Developer' documentation will be built but autodoc directives will be skipped.\n"
f"In order to fully build the 'Developer' documentation, checkout the matching branch "
f"with `cd odoo && git checkout {version}`."
"Found Odoo sources in %(directory)s but with version '%(odoo_version)s' incompatible "
"with documentation version '%(doc_version)s'.\n"
"The 'Developer' documentation will be built but autodoc directives will be skipped.\n"
"In order to fully build the 'Developer' documentation, checkout the matching branch"
" with `cd odoo && git checkout %(doc_version)s`.",
{'directory': odoo_dir, 'odoo_version': odoo_version, 'doc_version': version},
)
else:
_logger.info(f"Found Odoo sources directory matching documentation version {release}.")
_logger.info(
"Found Odoo sources in %(directory)s matching documentation version '%(version)s'.",
{'directory': odoo_dir, 'version': release},
)
odoo_dir_in_path = True
# The Sphinx extensions to use, as module names.
@@ -119,15 +124,9 @@ extensions = [
# Code switcher (switcher and case directives)
'switcher',
# Tabs switcher
'sphinx_tabs.tabs',
# Strange html domain logic used in memento pages
'html_domain',
]
sphinx_tabs_disable_tab_closing = False
if odoo_dir_in_path:
# GitHub links generation
extensions += [

View File

@@ -9,7 +9,7 @@ To register your database, you just need to enter your Subscription Code in the
banner in the App Switcher. Make sure you do not add extra spaces before or after
your subscription code. If the registration is successful, it will turn green and
will provide you with the Expiration Date of your freshly-registered database. You
can check this Epiration Date in the About menu (Odoo 9) or in the Settings Dashboard
can check this Expiration Date in the About menu (Odoo 9) or in the Settings Dashboard
(Odoo 10).
Registration Error Message

View File

@@ -22,10 +22,6 @@ selected at the creation of the database.
To install a new package, go to :menuselection:`Accounting --> Configuration --> Fiscal
Localization`, click on **Install More Packages**, and install your country's module.
.. image:: media/fiscal_localization_packages_modules.png
:align: center
:alt: Install the appropriate module as fiscal localization package in Odoo Accounting.
Once done, select your country's package, and click on *Save*.
.. image:: media/fiscal_localization_packages_selection.png

View File

@@ -6,10 +6,6 @@ Odoo Accounting can be used in many countries out of the box by installing the a
Here is a list of all :doc:`Fiscal Localization Packages <fiscal_localization_packages>` that are
available on Odoo.
.. image:: media/fiscal_localization_packages_modules.png
:align: center
:alt: Odoo Accounting.
Fiscal Localization Packages available
======================================

View File

@@ -43,6 +43,52 @@ In Odoo
and the zip code). Go to :menuselection:`Settings --> Users & Companies --> Companies`
to open and edit your Company record.
Automatically post taxes to the correct Tax Payable account
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* For each one of your companies that uses TaxCloud, it might be necessary to create a
**User-Defined Default** so that the new taxes generated by the TaxCloud integration are created
with the correct Tax Payable account:
.. warning::
A User-Defined Default impacts all records at creation. It means that **every** new tax will be
set up to record income in the specified Tax Payable account, unless the tax is manually edited
to specify a different income account (or there exists another User-Defined Default that takes
precedence).
* In :menuselection:`Accounting --> Configuration --> Chart of Accounts`, select the Tax Payable
account for the company. Take note of the account's ``id`` in the URL string.
.. image:: taxcloud/user-default-find-account-id.png
:alt: The account's ID can be found in the URL string as 'id=...'.
:align: center
* Activate the :ref:`developer mode <developer-mode>`, then go to
:menuselection:`Settings --> Technical --> Actions --> User-Defined Defaults`, and
click on *Create*.
* Click on *Field*, then, in the drop-down menu, on *Search More*.
.. image:: taxcloud/user-default-search-field.png
:alt: Click on 'Search More' in the 'Field' drop-down menu.
:align: center
* In the pop-up's search box, filter on the model ``tax.repartition.line`` and the field ``account``.
Select the ``account`` field of the ``tax.repartition.line`` model.
.. image:: taxcloud/user-default-select-field.png
:alt: Select the 'account' field of the 'tax.repartition.line' model.
:align: center
* In the **Default Value** field, enter the ID of the company's Tax Payable account.
Select the company for which this configuration should apply in the *Company* field.
Click *Save*.
.. image:: taxcloud/user-default-enter-default-account-id.png
:alt: Enter the ID of the company's Tax Payable account.
:align: center
How it works
============

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -62,27 +62,23 @@ for example, `https://192.168.1.25`. Then, accept the self-signed certificate.
.. note::
Note that the protocol is now **HTTPS**.
Click on :menuselection:`Not secure --> Certificate is not valid`.
Click on :menuselection:`Connection is not secure --> Certificate is not valid`.
.. image:: epos_ssc/browser-warning.png
:align: center
:alt: The web browser indicates that the connection to the printer is not secure.
Go to the *Details* tab and click on **Export**.
Go to the *Details* tab and click on **Copy to file**.
Select X.509 in base 64 and save it.
.. image:: epos_ssc/certificate-details.png
:align: center
:alt: Details of the ePOS printer certificate
Import the Self-signed certificate to your browser (Chrome)
===========================================================
Import the Self-signed certificate to Windows (Using Chrome)
============================================================
In your Chrome browser, go to :menuselection:`Settings --> Privacy and security --> Security -->
Manage certificates`, then open the *Authorities* tab, click on **Import**, and select all
functionalities of the certificate.
Manage certificates`
.. tip::
You can directly access these settings by navigating to `chrome://settings/certificates`.
Go to the *Trusted Root Certification Authorities* tab and click on **Import** and select
your previous file. Accept all warnings and restart your browser.
Import the Self-signed certificate to your Android device
=========================================================

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -620,260 +620,3 @@ the outer backticks interpret enclosed backslashes and thus prevent them from es
backticks. For instance, ```\`this formatting\```` produces an ``[UNKNOWN NODE title_reference]``
error. Instead, `````this formatting````` should be used to produce the following result:
```this formatting```.
Tabs
====
Sphinx extension ``'sphinx_tabs.tabs'`` enables to content tabs (basic, synchronized, nested and code) with custom names with complex content.
Basic tabs
----------
RST
~~~
.. code-block:: rst
.. tabs::
.. tab:: Windows
Windows OS
.. tab:: Linux
Linux OS
.. tab:: Mac
Mac OS
Render
~~~~~~
.. tabs::
.. tab:: Windows
Windows OS
.. tab:: Linux
Linux OS
.. tab:: Mac
Mac OS
Group tabs
----------
RST
~~~
.. code-block:: rst
.. tabs::
.. group-tab:: Linux
Linux tab content - tab set 1
.. group-tab:: Mac OSX
Mac OSX tab content - tab set 1
.. group-tab:: Windows
Windows tab content - tab set 1
.. tabs::
.. group-tab:: Linux
Linux tab content - tab set 2
.. group-tab:: Mac OSX
Mac OSX tab content - tab set 2
.. group-tab:: Windows
Windows tab content - tab set 2
Render
~~~~~~
.. tabs::
.. group-tab:: Linux
Linux tab content - tab set 1
.. group-tab:: Mac OSX
Mac OSX tab content - tab set 1
.. group-tab:: Windows
Windows tab content - tab set 1
.. tabs::
.. group-tab:: Linux
Linux tab content - tab set 2
.. group-tab:: Mac OSX
Mac OSX tab content - tab set 2
.. group-tab:: Windows
Windows tab content - tab set 2
Nested tabs
-----------
RST
~~~
.. code-block:: rst
.. tabs::
.. tab:: Linux
.. tabs::
.. group-tab:: Debian/Ubuntu
Debian/Ubuntu tab content
.. group-tab:: Fedora
Fedora tab content
Render
~~~~~~
.. tabs::
.. tab:: Linux
.. tabs::
.. group-tab:: Debian/Ubuntu
Debian/Ubuntu tab content
.. group-tab:: Fedora
Fedora tab content
Code tabs
---------
RST
~~~
.. code-block:: rst
.. tabs::
.. code-tab:: c
int main(const int argc, const char **argv) {
return 0;
}
.. code-tab:: c++
int main(const int argc, const char **argv) {
return 0;
}
.. code-tab:: py
def main():
return
.. code-tab:: java
class Main {
public static void main(String[] args) {
}
}
.. code-tab:: julia
function main()
end
.. code-tab:: fortran
PROGRAM main
END PROGRAM main
.. code-tab:: r R
main <- function() {
return(0)
}
Render
~~~~~~
.. tabs::
.. code-tab:: c
int main(const int argc, const char **argv) {
return 0;
}
.. code-tab:: c++
int main(const int argc, const char **argv) {
return 0;
}
.. code-tab:: py
def main():
return
.. code-tab:: java
class Main {
public static void main(String[] args) {
}
}
.. code-tab:: julia
function main()
end
.. code-tab:: fortran
PROGRAM main
END PROGRAM main
.. code-tab:: r R
main <- function() {
return(0)
}

View File

@@ -12,6 +12,41 @@ sale app, the website or even the mobile application are different. Also, some
assets may be large, but are seldom needed: in that case we may want them
to be :ref:`loaded lazily (on demand) <frontend/assets/lazy_loading>`.
Asset types
===========
There are three different asset types: code (`js` files), style (`css` or `scss`
files) and templates (`xml` files).
Code
Odoo supports :ref:`three different kinds of javascript files<frontend/js_modules>`.
All these files are then processed (native JS modules are transformed into odoo
modules), then minified (if not in `debug=assets` :ref:`mode <frontend/framework/assets_debug_mode>`)
and concatenated. The result is then saved as a file attachment. These file
attachments are usually loaded via a `<script>` tag in the `<head>` part of
the page (as a static file).
Style
Styling can be done with either `css` or `scss <https://sass-lang.com/>`_. Like
the javascript files, these files are processed (`scss` files are converted into
`css`), then minified (again, if not in `debug=assets` :ref:`mode <frontend/framework/assets_debug_mode>`)
and concatenated. The result is then saved as a file attachment. They are
then usually loaded via a `<link>` tag in the `<head>` part of the page (as
a static file).
Template
Templates (static `xml` files) are handled in a different way: they are simply
read from the file system whenever they are needed, and concatenated.
Whenever the browser loads odoo, it calls the `/web/webclient/qweb/` controller
to fetch the :ref:`templates <reference/qweb>`.
It is useful to know that in most cases, a browser only performs a request the
first time it loads a page. This is because each of these assets are
associated with a checksum, which is injected into the page source. The checksum
is then added to the url, which means that it is possible to safely set the cache
headers to a long period.
Bundles
=======
@@ -63,43 +98,9 @@ know:
- `web.qunit_mobile_suite_tests`: mobile specific qunit testing code
Asset types
===========
There are three different asset types: code (`js` files), style (`css` or `scss`
files) and templates (`xml` files).
Code
Odoo supports :ref:`three different kinds of javascript files<frontend/js_modules>`.
All these files are then processed (native JS modules are transformed into odoo
modules), then minified (if not in `debug=assets` :ref:`mode <frontend/framework/assets_debug_mode>`)
and concatenated. The result is then saved as a file attachment. These file
attachments are usually loaded via a `<script>` tag in the `<head>` part of
the page (as a static file).
Style
Styling can be done with either `css` or `scss <https://sass-lang.com/>`_. Like
the javascript files, these files are processed (`scss` files are converted into
`css`), then minified (again, if not in `debug=assets` :ref:`mode <frontend/framework/assets_debug_mode>`)
and concatenated. The result is then saved as a file attachment. They are
then usually loaded via a `<link>` tag in the `<head>` part of the page (as
a static file).
Template
Templates (static `xml` files) are handled in a different way: they are simply
read from the file system whenever they are needed, and concatenated.
Whenever the browser loads odoo, it calls the `/web/webclient/qweb/` controller
to fetch the :ref:`templates <reference/qweb>`.
It is useful to know that in most cases, a browser only performs a request the
first time it loads a page. This is because each of these assets are
associated with a checksum, which is injected into the page source. The checksum
is then added to the url, which means that it is possible to safely set the cache
headers to a long period.
Operations on asset bundles
===========================
Operations
----------
Typically, handling assets is simple: you just need to add some new files
to a frequently used bundle like `assets_common` or `assets_backend`. But there are other operations
@@ -111,7 +112,7 @@ in manifests higher up in the hierarchy or in ``ir.asset`` records with a lower
sequence.
`append`
--------
~~~~~~~~
This operation adds one or multiple file(s). Since it is the most common
operation, it can be done by simply using the file name:
@@ -127,7 +128,7 @@ glob pattern at the end of the bundle. Obviously, the pattern may also be direct
a single file path.
`prepend`
---------
~~~~~~~~~
Add one or multiple file(s) at the beginning of the bundle.
@@ -142,7 +143,7 @@ syntax: `('prepend', <path>)`.
],
`before`
--------
~~~~~~~~
Add one or multiple file(s) before a specific file.
@@ -158,7 +159,7 @@ file. It is declared by replacing the normal path with a 3-element tuple
],
`after`
-------
~~~~~~~
Add one or multiple file(s) after a specific file.
@@ -173,7 +174,7 @@ It is declared by replacing the normal path with a 3-element tuple
],
`include`
---------
~~~~~~~~~
Use nested bundles.
@@ -189,7 +190,7 @@ specify the sub bundle as a pair `('include', <bundle>)` like this:
],
`remove`
--------
~~~~~~~~
Remove one or multiple file(s).
@@ -204,7 +205,7 @@ can be done using the `remove` directive by specifying a pair
],
`replace`
---------
~~~~~~~~~
Replace an asset file with one or multiple file(s).
@@ -220,7 +221,7 @@ the `replace` directive, using a 3-element tuple `('replace', <target>, <path>)`
Loading order
=============
-------------
The order in which assets are loaded is sometimes critical and must be deterministic,
mostly for stylesheets priorities and setup scripts. Assets in Odoo are processed
@@ -235,7 +236,7 @@ as follows:
#. All modules declaring assets for said bundle in their manifest apply their
assets operations to this list. This is done following the order of modules dependencies
(e.g. `web` assets is processed before 'website'). If a directive tries to add
(e.g. `web` assets is processed before `website`). If a directive tries to add
a file already present in the list, nothing is done for that file. In other word,
only the first occurrence of a file is kept in the list.
@@ -267,8 +268,8 @@ in the list before all the others included in the glob.
.. _frontend/assets/lazy_loading:
Lazy loading assets
===================
Lazy loading
============
It is sometimes useful to load files and/or asset bundles dynamically, for
example to only load a library once it is needed. To do that, the Odoo framework

View File

@@ -128,6 +128,8 @@ Reference List
- manage the browser url
* - :ref:`rpc <frontend/services/rpc>`
- send requests to the server
* - :ref:`scroller <frontend/services/scroller>`
- handle clicks on anchors elements
* - :ref:`title <frontend/services/title>`
- read or modify the window title
* - :ref:`user <frontend/services/user>`
@@ -692,6 +694,57 @@ When a rpc fails, then:
displayed and the server is regularly contacted until it responds. The
notification is closed as soon as the server responds.
.. _frontend/services/scroller:
Scroller service
----------------
Overview
~~~~~~~~
- Technical name: `scroller`
- Dependencies: none
Whenever the user clicks on an anchor in the web client, this service automatically scrolls
to the target (if appropriate).
The service adds an event listener to get `click`'s on the document. The service checks
if the selector contained in its href attribute is valid to distinguish anchors and Odoo
actions (e.g. `<a href="#target_element"></a>`). It does nothing if it is not the case.
An event `SCROLLER:ANCHOR_LINK_CLICKED` is triggered on the main application bus if the click seems to be
targeted at an element. The event contains a custom event containing the `element` matching and its `id` as a reference.
It may allow other parts to handle a behavior relative to anchors themselves. The original event is also
given as it might need to be prevented. If the event is not prevented, then the user interface will
scroll to the target element.
API
~~~
The following values are contained in the `anchor-link-clicked` custom event explained above.
.. list-table::
:widths: 25 25 50
:header-rows: 1
* - Name
- Type
- Description
* - `element`
- `HTMLElement | null`
- The anchor element targeted by the href
* - `id`
- `string`
- The id contained in the href
* - `originalEv`
- `Event`
- The original click event
.. note::
The scroller service emits a `SCROLLER:ANCHOR_LINK_CLICKED` event on the :ref:`main bus <frontend/framework/bus>`.
To avoid the default scroll behavior of the scroller service, you must use `preventDefault()` on the event given
to the listener so that you can implement your own behavior correctly from the listener.
.. _frontend/services/title:
Title Service