[MOV] howto/rdtraining: move "Getting started" to the tutorials dir

This commit also replaces references to the "Building a module"
tutorial by references to the "Getting started" tutorial.

task-2991663

X-original-commit: 4f4e346953
Part-of: odoo/documentation#3660
This commit is contained in:
Antoine Vandevenne (anv) 2023-02-17 14:50:20 +00:00
parent 286ae4a7b7
commit 018d708b44
104 changed files with 320 additions and 272 deletions

View File

@ -279,8 +279,8 @@ Git
The following requires `Git <git_>`_ to be installed on your machine and that you have basic
knowledge of Git commands. To clone a Git repository, you must choose between cloning with HTTPS or
SSH. If you do not know the difference between the two, the best option is most likely HTTPS. If you
are following the :doc:`Getting started </developer/howtos/rdtraining>` developer tutorial, or plan
on contributing to Odoo source code, choose SSH.
are following the :doc:`Getting started </developer/tutorials/getting_started>` developer tutorial,
or plan on contributing to Odoo source code, choose SSH.
.. note::
**The Enterprise Git repository does not contain the full Odoo source code**. It is only a

View File

@ -146,7 +146,7 @@ Manually
--------
If you want to create your module structure manually,
you can follow :doc:`Build an Odoo module </developer/howtos/backend>` to understand
you can follow the :doc:`/developer/tutorials/getting_started` tutorial to understand
the structure of a module and the content of each file.
Push the development branch

View File

@ -8,7 +8,6 @@ How-to guides
.. toctree::
:titlesonly:
howtos/rdtraining
howtos/discover_js_framework
howtos/scss_tips
howtos/website
@ -20,24 +19,7 @@ How-to guides
.. raw:: html
<!-- 12 col on small screen, 6 on md, 3 on xl, 3 on xxl -->
<div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 row-cols-xxl-4 g-4 mb-4">
<!-- Big card with badge rounded-pill -->
<a class="o_toctree_card col-md-12 col-xl-8 col-xxl-6" href="howtos/rdtraining.html">
<div class="card h-100">
<div class="card-body pb-0">
<h4 class="card-title text-primary mb-1">Getting started</h4>
<p class="card-text text-dark fw-normal">
Learn how to develop your own module with the Odoo framework. This
step-by-step tutorial is crafted for newcomers and any other individual
curious about Odoo development.
</p>
</div>
<div class="card-footer border-0">
<span class="badge rounded-pill bg-dark mt-auto mb-2">Beginner</span>
</div>
</div>
</a>
<a class="o_toctree_card col-md-12 col-xl-8 col-xxl-6" href="howtos/discover_js_framework.html">
<div class="card h-100">

View File

@ -6,7 +6,7 @@ Accounting localization
.. warning::
This tutorial requires knowledge about how to build a module in Odoo (see
:doc:`/developer/howtos/backend`).
:doc:`../tutorials/getting_started`).
Installation procedure

View File

@ -8,7 +8,7 @@ Multi-company Guidelines
.. warning::
This tutorial requires good knowledge of Odoo.
Please refer to the :ref:`basic tutorial <howto/base>` first if needed.
Please refer to the :doc:`../tutorials/getting_started` tutorial first if needed.
As of version 13.0, a user can be logged in multiple companies at once. This allows the user to
access information from multiple companies but also to create/edit records in a multi-company

View File

@ -37,7 +37,7 @@ installed. If you have not installed it yet, we recommend installing it from :re
<setup/install/source>` (:dfn:`running Odoo from source code`).
To setup your development environment, you can also follow the dedicated chapter in :doc:`Getting
Started: Development environment setup <rdtraining/02_setup>` tutorial.
Started: Development environment setup <../tutorials/getting_started/02_setup>` tutorial.
The last things to do are:

View File

@ -1,87 +0,0 @@
:show-content:
.. _howto/rdtraining:
===============
Getting started
===============
Welcome to the Getting Started Odoo tutorial! If you reached this page that means you are
interested in the development of your own Odoo module. It might also mean that you recently
joined the Odoo company for a rather technical position. In any case, your journey to the
technical side of Odoo starts here.
This training is split in two parts:
- The first part is the :ref:`core training <howtos/rdtraining/core_training>`. Its objective is to
give you an insight of the most important parts of the Odoo development framework. The chapters
should be followed in their given order since they cover the development of a new Odoo application
from scratch in an incremental way. In other words, each chapter depends on the previous one.
- The second part covers a set of :ref:`advanced topics <howtos/rdtraining/advanced_topics>`. Each
topic can be followed independently, but requires the :ref:`core training
<howtos/rdtraining/core_training>`.
.. attention::
Are you following this training as part of your technical onboarding as an Odoo employee? Then,
we ask you to complete the first part of the training before joining your new team and the second
part the month after.
All topics are built around a business case we will enhance along the way. The reader is expected
to actively take part in the training by writing the solution for each exercise.
Ready? Let's get started!
.. _howtos/rdtraining/core_training:
Core training
=============
.. toctree::
:caption: Advanced Topics
:titlesonly:
:glob:
rdtraining/0*
rdtraining/1*
* :doc:`rdtraining/01_architecture`
* :doc:`rdtraining/02_setup`
* :doc:`rdtraining/03_newapp`
* :doc:`rdtraining/04_basicmodel`
* :doc:`rdtraining/05_securityintro`
* :doc:`rdtraining/06_firstui`
* :doc:`rdtraining/07_basicviews`
* :doc:`rdtraining/08_relations`
* :doc:`rdtraining/09_compute_onchange`
* :doc:`rdtraining/10_actions`
* :doc:`rdtraining/11_constraints`
* :doc:`rdtraining/12_sprinkles`
* :doc:`rdtraining/13_inheritance`
* :doc:`rdtraining/14_other_module`
* :doc:`rdtraining/15_qwebintro`
* :doc:`rdtraining/16_guidelines_pr`
.. _howtos/rdtraining/advanced_topics:
Advanced topics
===============
.. toctree::
:caption: Advanced Topics
:titlesonly:
rdtraining/B_acl_irrules
rdtraining/C_data
rdtraining/D_mixins
rdtraining/E_unittest
rdtraining/J_reports
rdtraining/K_dashboard
rdtraining/N_security
* :doc:`rdtraining/B_acl_irrules`
* :doc:`rdtraining/C_data`
* :doc:`rdtraining/D_mixins`
* :doc:`rdtraining/E_unittest`
* :doc:`rdtraining/J_reports`
* :doc:`rdtraining/K_dashboard`
* :doc:`rdtraining/N_security`

View File

@ -17,7 +17,7 @@ Customizing the web client
This guide is about creating modules for Odoo's web client.
To create websites with Odoo, see :doc:`website`; to add business capabilities
or extend existing business systems of Odoo, see :doc:`backend`.
or extend existing business systems of Odoo, see :doc:`../tutorials/getting_started`.
.. warning::

View File

@ -4,3 +4,31 @@
=========
Tutorials
=========
.. toctree::
:titlesonly:
tutorials/getting_started
.. raw:: html
<!-- 12 col on small screen, 6 on md, 3 on xl, 3 on xxl -->
<div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 row-cols-xxl-4 g-4 mb-4">
<!-- Big card with badge rounded-pill -->
<a class="o_toctree_card col-md-12 col-xl-8 col-xxl-6" href="tutorials/getting_started.html">
<div class="card h-100">
<div class="card-body pb-0">
<h4 class="card-title text-primary mb-1">Getting started</h4>
<p class="card-text text-dark fw-normal">
Learn how to develop your own module with the Odoo framework. This
step-by-step tutorial is crafted for newcomers and any other individual
curious about Odoo development.
</p>
</div>
<div class="card-footer border-0">
<span class="badge rounded-pill bg-dark mt-auto mb-2">Beginner</span>
</div>
</div>
</a>
</div>

View File

@ -0,0 +1,88 @@
:show-content:
.. _tutorials/getting_started:
===============
Getting started
===============
Welcome to the Getting Started Odoo tutorial! If you reached this page that means you are
interested in the development of your own Odoo module. It might also mean that you recently
joined the Odoo company for a rather technical position. In any case, your journey to the
technical side of Odoo starts here.
This training is split in two parts:
- The first part is the :ref:`core training <tutorials/getting_started/core_training>`. Its
objective is to give you an insight of the most important parts of the Odoo development framework.
The chapters should be followed in their given order since they cover the development of a new
Odoo application from scratch in an incremental way. In other words, each chapter depends on the
previous one.
- The second part covers a set of :ref:`advanced topics
<tutorials/getting_started/advanced_topics>`. Each topic can be followed independently, but
requires the :ref:`core training <tutorials/getting_started/core_training>`.
.. attention::
Are you following this training as part of your technical onboarding as an Odoo employee? Then,
we ask you to complete the first part of the training before joining your new team and the second
part the month after.
All topics are built around a business case we will enhance along the way. The reader is expected
to actively take part in the training by writing the solution for each exercise.
Ready? Let's get started!
.. _tutorials/getting_started/core_training:
Core training
=============
.. toctree::
:caption: Advanced Topics
:titlesonly:
:glob:
getting_started/0*
getting_started/1*
* :doc:`getting_started/01_architecture`
* :doc:`getting_started/02_setup`
* :doc:`getting_started/03_newapp`
* :doc:`getting_started/04_basicmodel`
* :doc:`getting_started/05_securityintro`
* :doc:`getting_started/06_firstui`
* :doc:`getting_started/07_basicviews`
* :doc:`getting_started/08_relations`
* :doc:`getting_started/09_compute_onchange`
* :doc:`getting_started/10_actions`
* :doc:`getting_started/11_constraints`
* :doc:`getting_started/12_sprinkles`
* :doc:`getting_started/13_inheritance`
* :doc:`getting_started/14_other_module`
* :doc:`getting_started/15_qwebintro`
* :doc:`getting_started/16_guidelines_pr`
.. _tutorials/getting_started/advanced_topics:
Advanced topics
===============
.. toctree::
:caption: Advanced Topics
:titlesonly:
getting_started/B_acl_irrules
getting_started/C_data
getting_started/D_mixins
getting_started/E_unittest
getting_started/J_reports
getting_started/K_dashboard
getting_started/N_security
* :doc:`getting_started/B_acl_irrules`
* :doc:`getting_started/C_data`
* :doc:`getting_started/D_mixins`
* :doc:`getting_started/E_unittest`
* :doc:`getting_started/J_reports`
* :doc:`getting_started/K_dashboard`
* :doc:`getting_started/N_security`

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/01_architecture:
.. _tutorials/getting_started/01_architecture:
================================
Chapter 1: Architecture Overview
@ -84,8 +84,8 @@ Static web data
None of these elements are mandatory. Some modules may only add data files (e.g. country-specific
accounting configuration), while others may only add business objects. During this training, we will
create business objects, object views and data files.
:ref:`Web controllers <howto/rdtraining/G_website>` and
:ref:`static web data <howto/rdtraining/I_jswidget>` are advanced topics.
:ref:`Web controllers <tutorials/getting_started/G_website>` and
:ref:`static web data <tutorials/getting_started/I_jswidget>` are advanced topics.
Module structure
----------------

View File

@ -99,7 +99,7 @@ Then, clone the two repositories with SSH as explained in the :ref:`Installing O
.. tip::
Cloning the repositories will take a while, enjoy a cup of coffee while you wait.
.. _howto/rdtraining/02_setup/development_repository:
.. _tutorials/getting_started/02_setup/development_repository:
Configure the Git repositories
==============================
@ -133,9 +133,9 @@ needed.
Install the dependencies
========================
As seen in :ref:`howto/rdtraining/01_architecture`, Odoo's server runs on Python and uses PostgreSQL
as an RDBMS. In the context of a development machine, the easiest approach is to install everything
locally. To do so, follow once again the :ref:`Installing Odoo guide
As seen in :ref:`tutorials/getting_started/01_architecture`, Odoo's server runs on Python and uses
PostgreSQL as an RDBMS. In the context of a development machine, the easiest approach is to install
everything locally. To do so, follow once again the :ref:`Installing Odoo guide
<setup/install/source/prepare>`.
.. tip::
@ -377,4 +377,4 @@ 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>`!
<tutorials/getting_started/03_newapp>`!

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/03_newapp:
.. _tutorials/getting_started/03_newapp:
============================
Chapter 3: A New Application
@ -105,4 +105,5 @@ Did it not appear? Maybe try removing the default 'Apps' filter ;-)
You can even install the module! But obviously it's an empty shell, so no menu will appear.
All good? If yes, then let's :ref:`create our first model <howto/rdtraining/04_basicmodel>`!
All good? If yes, then let's :ref:`create our first model
<tutorials/getting_started/04_basicmodel>`!

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1,14 +1,14 @@
.. _howto/rdtraining/04_basicmodel:
.. _tutorials/getting_started/04_basicmodel:
==================================
Chapter 4: Models And Basic Fields
==================================
At the end of the :ref:`previous chapter <howto/rdtraining/03_newapp>`, we were able to create an Odoo
module. However, at this point it is still an empty shell which doesn't allow us to store any data.
In our real estate module, we want to store the information related to the properties
(name, description, price, living area...) in a database. The Odoo framework provides tools to
facilitate database interactions.
At the end of the :ref:`previous chapter <tutorials/getting_started/03_newapp>`, we were able to
create an Odoo module. However, at this point it is still an empty shell which doesn't allow us to
store any data. In our real estate module, we want to store the information related to the
properties (name, description, price, living area...) in a database. The Odoo framework provides
tools to facilitate database interactions.
Before moving forward in the exercise, make sure the ``estate`` module is installed, i.e. it
must appear as 'Installed' in the Apps list.
@ -282,7 +282,7 @@ useful or necessary:
Now that we have created our first model, let's
:ref:`add some security <howto/rdtraining/05_securityintro>`!
:ref:`add some security <tutorials/getting_started/05_securityintro>`!
.. [#autofields] it is possible to :ref:`disable the automatic creation of some

View File

@ -1,16 +1,16 @@
.. _howto/rdtraining/05_securityintro:
.. _tutorials/getting_started/05_securityintro:
==========================================
Chapter 5: Security - A Brief Introduction
==========================================
In the :ref:`previous chapter <howto/rdtraining/04_basicmodel>`, we created our first table intended
to store business data. In a business application such as Odoo, one of the first questions to consider
is who\ [#who]_ can access the data. Odoo provides a security mechanism to allow access
In the :ref:`previous chapter <tutorials/getting_started/04_basicmodel>`, we created our first table
intended to store business data. In a business application such as Odoo, one of the first questions
to consider is who\ [#who]_ can access the data. Odoo provides a security mechanism to allow access
to the data for specific groups of users.
The topic of security is covered in more detail in :ref:`howto/rdtraining/B_acl_irrules`. This chapter
aims to cover the minimum required for our new module.
The topic of security is covered in more detail in :ref:`tutorials/getting_started/B_acl_irrules`.
This chapter aims to cover the minimum required for our new module.
Data Files (CSV)
================
@ -106,7 +106,8 @@ Here is an example for our previous ``test.model``:
to the model is ``model_<model_name>``, where ``<model_name>`` is the ``_name`` of the model
with the ``.`` replaced by ``_``. Seems cumbersome? Indeed it is...
- ``group_id/id`` refers to the group which the access right applies to. We will cover the concept
of groups in the :ref:`advanced topic <howto/rdtraining/N_security>` dedicated to the security.
of groups in the :ref:`advanced topic <tutorials/getting_started/N_security>` dedicated to the
security.
- ``perm_read,perm_write,perm_create,perm_unlink``: read, write, create and unlink permissions
.. exercise:: Add access rights.
@ -120,7 +121,7 @@ Here is an example for our previous ``test.model``:
Restart the server and the warning message should have disappeared!
It's now time to finally :ref:`interact with the UI <howto/rdtraining/06_firstui>`!
It's now time to finally :ref:`interact with the UI <tutorials/getting_started/06_firstui>`!
.. [#who] meaning which Odoo user (or group of users)

View File

@ -1,12 +1,12 @@
.. _howto/rdtraining/06_firstui:
.. _tutorials/getting_started/06_firstui:
========================================
Chapter 6: Finally, Some UI To Play With
========================================
Now that we've created our new :ref:`model <howto/rdtraining/04_basicmodel>` and its corresponding
:ref:`access rights <howto/rdtraining/05_securityintro>`, it is time to interact with
the user interface.
Now that we've created our new :ref:`model <tutorials/getting_started/04_basicmodel>` and its
corresponding :ref:`access rights <tutorials/getting_started/05_securityintro>`, it is time to
interact with the user interface.
At the end of this chapter, we will have created a couple of menus in order to access a default list
and form view.
@ -17,7 +17,7 @@ Data Files (XML)
**Reference**: the documentation related to this topic can be found in
:ref:`reference/data`.
In :ref:`howto/rdtraining/05_securityintro`, we added data through a CSV file. The CSV
In :ref:`tutorials/getting_started/05_securityintro`, we added data through a CSV file. The CSV
format is convenient when the data to load has a simple format. When the format is more complex
(e.g. load the structure of a view or an email template), we use the XML format. For example,
this
@ -65,10 +65,10 @@ Actions can be triggered in three ways:
3. as contextual actions on object
We will only cover the first case in this chapter. The second case will be covered in a
:ref:`later chapter <howto/rdtraining/10_actions>` while the last is the focus of an advanced topic.
In our Real Estate example, we would like to link a menu to the ``estate.property`` model, so we
are able to create a new record. The action can be viewed as the link between the menu and
the model.
:ref:`later chapter <tutorials/getting_started/10_actions>` while the last is the focus of an
advanced topic. In our Real Estate example, we would like to link a menu to the ``estate.property``
model, so we are able to create a new record. The action can be viewed as the link between the menu
and the model.
A basic action for our ``test.model`` is:
@ -86,7 +86,7 @@ A basic action for our ``test.model`` is:
- ``name`` is the name of the action.
- ``res_model`` is the model which the action applies to.
- ``view_mode`` are the views that will be available; in this case they are the list (tree) and form views.
We'll see :ref:`later <howto/rdtraining/15_qwebintro>` that there can be other view modes.
We'll see :ref:`later <tutorials/getting_started/15_qwebintro>` that there can be other view modes.
Examples can be found everywhere in Odoo, but
`this <https://github.com/odoo/odoo/blob/09c59012bf80d2ccbafe21c39e604d6cfda72924/addons/crm/views/crm_lost_reason_views.xml#L57-L70>`__
@ -287,7 +287,7 @@ Note that the default ``active=False`` value was assigned to all existing record
The ``state`` will be used later on for several UI enhancements.
Now that we are able to interact with the UI thanks to the default views, the next step is
obvious: we want to define :ref:`our own views <howto/rdtraining/07_basicviews>`.
obvious: we want to define :ref:`our own views <tutorials/getting_started/07_basicviews>`.
.. [#refresh] A refresh is needed since the web client keeps a cache of the various menus
and views for performance reasons.

View File

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -1,11 +1,11 @@
.. _howto/rdtraining/07_basicviews:
.. _tutorials/getting_started/07_basicviews:
======================
Chapter 7: Basic Views
======================
We have seen in the :ref:`previous chapter <howto/rdtraining/06_firstui>` that Odoo is able to
generate default views for a given model. In practice, the default view is **never** acceptable
We have seen in the :ref:`previous chapter <tutorials/getting_started/06_firstui>` that Odoo is able
to generate default views for a given model. In practice, the default view is **never** acceptable
for a business application. Instead, we should at least organize the various fields in a logical
manner.
@ -228,4 +228,4 @@ services *OR* have a unit price which is *NOT* between 1000 and 2000'::
Looking good? At this point we are already able to create models and design a user interface which
makes sense business-wise. However, a key component is still missing: the
:ref:`link between models <howto/rdtraining/08_relations>`.
:ref:`link between models <tutorials/getting_started/08_relations>`.

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -1,11 +1,11 @@
.. _howto/rdtraining/08_relations:
.. _tutorials/getting_started/08_relations:
===================================
Chapter 8: Relations Between Models
===================================
The :ref:`previous chapter <howto/rdtraining/07_basicviews>` covered the creation of custom views
for a model containing basic fields. However, in any real business scenario we need more than
The :ref:`previous chapter <tutorials/getting_started/07_basicviews>` covered the creation of custom
views for a model containing basic fields. However, in any real business scenario we need more than
one model. Moreover, links between models are necessary. One can easily imagine one model containing
the customers and another one containing the list of users. You might need to refer to a customer
or a user on any existing business model.
@ -78,10 +78,10 @@ In practice a many2one can be seen as a dropdown list in a form view.
and search views
This exercise is a good recap of the previous chapters: you need to create a
:ref:`model <howto/rdtraining/04_basicmodel>`, set the
:ref:`model <howto/rdtraining/05_securityintro>`, add an
:ref:`action and a menu <howto/rdtraining/06_firstui>`, and
:ref:`create a view <howto/rdtraining/07_basicviews>`.
:ref:`model <tutorials/getting_started/04_basicmodel>`, set the
:ref:`model <tutorials/getting_started/05_securityintro>`, add an
:ref:`action and a menu <tutorials/getting_started/06_firstui>`, and
:ref:`create a view <tutorials/getting_started/07_basicviews>`.
Tip: do not forget to import any new Python files in ``__init__.py``, add new data files in
``__manifest.py__`` or add the access rights ;-)
@ -185,7 +185,7 @@ operations like ``recs1 | recs2``.
Tip: in the view, use the ``widget="many2many_tags"`` attribute as demonstrated
`here <https://github.com/odoo/odoo/blob/5bb8b927524d062be32f92eb326ef64091301de1/addons/crm_iap_lead_website/views/crm_reveal_views.xml#L36>`__.
The ``widget`` attribute will be explained in detail in :ref:`a later chapter of the training <howto/rdtraining/12_sprinkles>`.
The ``widget`` attribute will be explained in detail in :ref:`a later chapter of the training <tutorials/getting_started/12_sprinkles>`.
For now, you can try to adding and removing it and see the result ;-)
One2many
@ -263,4 +263,4 @@ for convenience.
Still alive? This chapter is definitely not the easiest one. It introduced a couple of new concepts
while relying on everything that was introduced before. The
:ref:`next chapter <howto/rdtraining/09_compute_onchange>` will be lighter, don't worry ;-)
:ref:`next chapter <tutorials/getting_started/09_compute_onchange>` will be lighter, don't worry ;-)

View File

@ -1,14 +1,13 @@
.. _howto/rdtraining/09_compute_onchange:
.. _tutorials/getting_started/09_compute_onchange:
========================================
Chapter 9: Computed Fields And Onchanges
========================================
The :ref:`relations between models <howto/rdtraining/08_relations>` are a key component of any Odoo
module. They are necessary for the modelization of any business case.
However, we may want links between the fields within a given model. Sometimes the
value of one field is determined from the values of other fields and other times we want to help the
user with data entry.
The :ref:`relations between models <tutorials/getting_started/08_relations>` are a key component of
any Odoo module. They are necessary for the modelization of any business case. However, we may want
links between the fields within a given model. Sometimes the value of one field is determined from
the values of other fields and other times we want to help the user with data entry.
These cases are supported by the concepts of computed fields and onchanges. Although this chapter is
not technically complex, the semantics of both concepts is very important.
@ -53,7 +52,8 @@ method should set the value of the computed field for every record in
By convention, :attr:`~odoo.fields.Field.compute` methods are private, meaning that they cannot
be called from the presentation tier, only from the business tier (see
:ref:`howto/rdtraining/01_architecture`). Private methods have a name starting with an underscore ``_``.
:ref:`tutorials/getting_started/01_architecture`). Private methods have a name starting with an
underscore ``_``.
Dependencies
------------
@ -301,5 +301,5 @@ When using stored computed fields, pay close attention to the dependencies. When
depend on other computed fields, changing a value can trigger a large number of recomputations.
This leads to poor performance.
In the :ref:`next chapter<howto/rdtraining/10_actions>`, we'll see how we can trigger some business
logic when buttons are clicked.
In the :ref:`next chapter <tutorials/getting_started/10_actions>`, we'll see how we can trigger some
business logic when buttons are clicked.

View File

@ -1,13 +1,13 @@
.. _howto/rdtraining/10_actions:
.. _tutorials/getting_started/10_actions:
==================================
Chapter 10: Ready For Some Action?
==================================
So far we have mostly built our module by declaring fields and views. We just introduced business
logic in the :ref:`previous chapter <howto/rdtraining/09_compute_onchange>` thanks to computed fields
and onchanges. In any real business scenario, we would want to link some business logic to action buttons.
In our real estate example, we would like to be able to:
logic in the :ref:`previous chapter <tutorials/getting_started/09_compute_onchange>` thanks to
computed fields and onchanges. In any real business scenario, we would want to link some business
logic to action buttons. In our real estate example, we would like to be able to:
- cancel or set a property as sold
- accept or refuse an offer
@ -125,9 +125,9 @@ and its
Object Type
===========
In :ref:`howto/rdtraining/06_firstui`, we created an action that was linked to a menu.
You may be wondering if it is possible to link an action to a button. Good news, it is! One
way to do it is:
In :ref:`tutorials/getting_started/06_firstui`, we created an action that was linked to a menu. You
may be wondering if it is possible to link an action to a button. Good news, it is! One way to do it
is:
.. code-block:: xml
@ -135,5 +135,5 @@ way to do it is:
We use ``type="action"`` and we refer to the :term:`external identifier` in the ``name``.
In the :ref:`next chapter <howto/rdtraining/11_constraints>` we'll see how we can prevent encoding
incorrect data in Odoo.
In the :ref:`next chapter <tutorials/getting_started/11_constraints>` we'll see how we can prevent
encoding incorrect data in Odoo.

View File

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

View File

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -1,11 +1,11 @@
.. _howto/rdtraining/11_constraints:
.. _tutorials/getting_started/11_constraints:
=======================
Chapter 11: Constraints
=======================
The :ref:`previous chapter <howto/rdtraining/10_actions>` introduced the ability to add some
business logic to our model. We can now link buttons to business code, but how can we prevent
The :ref:`previous chapter <tutorials/getting_started/10_actions>` introduced the ability to add
some business logic to our model. We can now link buttons to business code, but how can we prevent
users from entering incorrect data? For example, in our real estate module nothing prevents
users from setting a negative expected price.
@ -123,7 +123,7 @@ prefer SQL over Python constraints.
Our real estate module is starting to look good. We added some business logic, and now we make sure
the data is consistent. However, the user interface is still a bit rough. Let's see how we can
improve it in the :ref:`next chapter <howto/rdtraining/12_sprinkles>`.
improve it in the :ref:`next chapter <tutorials/getting_started/12_sprinkles>`.
.. _PostgreSQL's documentation:
.. _table_constraint:

View File

Before

Width:  |  Height:  |  Size: 316 KiB

After

Width:  |  Height:  |  Size: 316 KiB

View File

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 225 KiB

View File

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

@ -1,13 +1,13 @@
.. _howto/rdtraining/12_sprinkles:
.. _tutorials/getting_started/12_sprinkles:
=============================
Chapter 12: Add The Sprinkles
=============================
Our real estate module now makes sense from a business perspective. We created
:ref:`specific views <howto/rdtraining/07_basicviews>`, added several
:ref:`action buttons <howto/rdtraining/10_actions>` and
:ref:`constraints <howto/rdtraining/11_constraints>`. However our user interface is still a bit
:ref:`specific views <tutorials/getting_started/07_basicviews>`, added several
:ref:`action buttons <tutorials/getting_started/10_actions>` and
:ref:`constraints <tutorials/getting_started/11_constraints>`. However our user interface is still a bit
rough. We would like to add some colors to the list views and make some fields and buttons conditionally
disappear. For example, the 'Sold' and 'Cancel' buttons should disappear when the property
is sold or canceled since it is no longer allowed to change the state at this point.
@ -268,7 +268,7 @@ behavior customizations, we can add the ``options`` attribute to several field w
Have a look at the :ref:`FieldMany2ManyTags widget documentation <reference/js/widgets>`
for more info.
In :ref:`howto/rdtraining/06_firstui`, we saw that reserved fields were used for
In :ref:`tutorials/getting_started/06_firstui`, we saw that reserved fields were used for
specific behaviors. For example, the ``active`` field is used to automatically filter out
inactive records. We added the ``state`` as a reserved field as well. It's now time to use it!
A ``state`` field is used in combination with a ``states`` attribute in the view to display
@ -506,7 +506,7 @@ Every time the partner name is changed, the description is modified.
- Create a stat button on ``estate.property.type`` pointing to the ``estate.property.offer``
action. This means you should use the ``type="action"`` attribute (go back to the end of
:ref:`howto/rdtraining/10_actions` if you need a refresher).
:ref:`tutorials/getting_started/10_actions` if you need a refresher).
At this point, clicking on the stat button should display all offers. We still need to filter out the
offers.
@ -515,8 +515,8 @@ Every time the partner name is changed, the description is modified.
as equal to the ``active_id`` (= the current record,
`here is an example <https://github.com/odoo/odoo/blob/df37ce50e847e3489eb43d1ef6fc1bac6d6af333/addons/event/views/event_views.xml#L162>`__)
Looking good? If not, don't worry, the :ref:`next chapter <howto/rdtraining/13_inheritance>` doesn't
require stat buttons ;-)
Looking good? If not, don't worry, the :ref:`next chapter
<tutorials/getting_started/13_inheritance>` doesn't require stat buttons ;-)
.. _order_by:
https://www.postgresql.org/docs/12/queries-order.html

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 276 KiB

View File

Before

Width:  |  Height:  |  Size: 283 KiB

After

Width:  |  Height:  |  Size: 283 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 266 KiB

After

Width:  |  Height:  |  Size: 266 KiB

View File

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/13_inheritance:
.. _tutorials/getting_started/13_inheritance:
=======================
Chapter 13: Inheritance
@ -244,7 +244,7 @@ An example of a view inheritance extension can be found
Inheritance is extensively used in Odoo due to its modular concept. Do not hesitate to read
the corresponding documentation for more info!
In the :ref:`next chapter <howto/rdtraining/14_other_module>`, we will learn how to interact with
other modules.
In the :ref:`next chapter <tutorials/getting_started/14_other_module>`, we will learn how to
interact with other modules.
.. _XPath: https://w3.org/TR/xpath

View File

Before

Width:  |  Height:  |  Size: 356 KiB

After

Width:  |  Height:  |  Size: 356 KiB

View File

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 224 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,11 +1,11 @@
.. _howto/rdtraining/14_other_module:
.. _tutorials/getting_started/14_other_module:
=======================================
Chapter 14: Interact With Other Modules
=======================================
In the :ref:`previous chapter <howto/rdtraining/13_inheritance>`, we used inheritance to modify
the behavior of a module. In our real estate scenario, we would like to go a step further
In the :ref:`previous chapter <tutorials/getting_started/13_inheritance>`, we used inheritance to
modify the behavior of a module. In our real estate scenario, we would like to go a step further
and be able to generate invoices for our customers. Odoo provides an Invoicing module, so it
would be neat to create an invoice directly from our real estate module, i.e. once a property
is set to 'Sold', an invoice is created in the Invoicing application.
@ -42,13 +42,14 @@ independently. When both are installed, the link module provides the new feature
For now, it will be an empty shell.
Tip: you already did this at the
:ref:`beginning of the tutorial <howto/rdtraining/03_newapp>`. The process is very similar.
:ref:`beginning of the tutorial <tutorials/getting_started/03_newapp>`. The process is very
similar.
When the ``estate_account`` module appears in the list, go ahead and install it! You'll notice that
the Invoicing application is installed as well. This is expected since your module depends on it.
If you uninstall the Invoicing application, your module will be uninstalled as well.
.. _howto/rdtraining/14_other_module/create:
.. _tutorials/getting_started/14_other_module/create:
Invoice Creation
----------------
@ -56,13 +57,14 @@ Invoice Creation
It's now time to generate the invoice. We want to add functionality to the
``estate.property`` model, i.e. we want to add some extra logic for when a property is sold.
Does that sound familiar? If not, it's a good idea to go back to the
:ref:`previous chapter <howto/rdtraining/13_inheritance>` since you might have missed something ;-)
:ref:`previous chapter <tutorials/getting_started/13_inheritance>` since you might have missed
something ;-)
As a first step, we need to extend the action called when pressing the
:ref:`'Sold' button <howto/rdtraining/10_actions>` on a property. To do so, we need to create a
:ref:`model inheritance <howto/rdtraining/13_inheritance>` in the ``estate_account`` module
for the ``estate.property`` model. For now, the overridden action will simply return the ``super``
call. Maybe an example will make things clearer::
:ref:`'Sold' button <tutorials/getting_started/10_actions>` on a property. To do so, we need to
create a :ref:`model inheritance <tutorials/getting_started/13_inheritance>` in the `estate_account`
module for the ``estate.property`` model. For now, the overridden action will simply return the
``super`` call. Maybe an example will make things clearer::
from odoo import models
@ -166,5 +168,5 @@ field ``line_ids`` at creation of a ``test.model``::
For each line, we need a ``name``, ``quantity`` and ``price_unit``.
This chapter might be one of the most difficult that has been covered so far, but it is the closest
to what Odoo development will be in practice. In the :ref:`next chapter <howto/rdtraining/15_qwebintro>`,
we will introduce the templating mechanism used in Odoo.
to what Odoo development will be in practice. In the :ref:`next chapter
<tutorials/getting_started/15_qwebintro>`, we will introduce the templating mechanism used in Odoo.

View File

Before

Width:  |  Height:  |  Size: 513 KiB

After

Width:  |  Height:  |  Size: 513 KiB

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/15_qwebintro:
.. _tutorials/getting_started/15_qwebintro:
===================================
Chapter 15: A Brief History Of QWeb
@ -125,7 +125,8 @@ view and fine tune it instead of starting from scratch. There are many options a
available, so... read and learn!
It is now time to add the
:ref:`final touches to our application and submit it on GitHub <howto/rdtraining/16_guidelines_pr>`!
:ref:`final touches to our application and submit it on GitHub
<tutorials/getting_started/16_guidelines_pr>`!
.. _templating:
https://en.wikipedia.org/wiki/Template_processor

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/16_guidelines_pr:
.. _tutorials/getting_started/16_guidelines_pr:
===============================================
Chapter 16: Polish Your Code And Submit Your PR
@ -57,9 +57,9 @@ folder to be able to commit your work.
$ git branch master training/master
$ git checkout master #Two new files will be downloaded README.md and .gitignore
Note that if your work is already in a :ref:`Git and GitHub configured folder <howto/rdtraining/02_setup/development_repository>`
the previous steps are not needed. This is the case when you start working in the
'odoo' or 'enterprise' folders.
Note that if your work is already in a :ref:`Git and GitHub configured folder
<tutorials/getting_started/02_setup/development_repository>` the previous steps are not needed. This
is the case when you start working in the 'odoo' or 'enterprise' folders.
Branch, Commit & Push
---------------------

View File

@ -1,6 +1,6 @@
:orphan:
.. _howto/rdtraining/A_i18n:
.. _tutorials/getting_started/A_i18n:
================================
Advanced A: Internationalization

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/B_acl_irrules:
.. _tutorials/getting_started/B_acl_irrules:
================================
Advanced B: ACL and Record Rules
@ -8,8 +8,7 @@ ACL stands for "Access Control List"
.. warning::
This tutorial assumes you have completed the :ref:`Core Training
<howto/rdtraining>`.
This tutorial assumes you have completed the :ref:`Core Training <tutorials/getting_started>`.
To follow the exercise, it is recommended that you fetch the branch
{BRANCH}-core from the `technical training solutions
@ -25,7 +24,7 @@ currently,
update or delete properties, property types, or property tags.
* If ``estate_account`` is installed then only agents allowed to interact
with invoicing can confirm sales as that's necessary to :ref:`create an
invoice <howto/rdtraining/14_other_module/create>`.
invoice <tutorials/getting_started/14_other_module/create>`.
However:
@ -87,7 +86,7 @@ This baseline seems sufficient for us:
In keeping with Odoo's data-driven nature, a group is no more than a record of
the ``res.groups`` model. They are normally part of a module's :ref:`master data
<howto/rdtraining/C_data>`, defined in one of the module's data files.
<tutorials/getting_started/C_data>`, defined in one of the module's data files.
As simple example `can be found here <https://github.com/odoo/odoo/blob/532c083cbbe0ee6e7a940e2bdc9c677bd56b62fa/addons/hr/security/hr_security.xml#L9-L14>`_.
@ -150,7 +149,7 @@ Access Rights
real-estate application.
- Real-estate agents will not be able to update the property types or tags.
Access rights were first introduced in :ref:`howto/rdtraining/05_securityintro`.
Access rights were first introduced in :ref:`tutorials/getting_started/05_securityintro`.
Access rights are a way to give users access to models *via* groups: associate
an access right to a group, then all users with that group will have the access.
@ -383,7 +382,7 @@ Explicit security checks can be performed by:
Re-run the bypass script, check that the error occurs before the print.
.. _howto/rdtraining/B_acl_irrules/multicompany:
.. _tutorials/getting_started/B_acl_irrules/multicompany:
Multi-company security
======================

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/C_data:
.. _tutorials/getting_started/C_data:
================================
Advanced C: Master and Demo Data
@ -21,7 +21,7 @@ words, such data is often necessary for the module to work properly. This data w
installed when installing the module.
We already met technical data previously since we have defined
:ref:`security rules<howto/rdtraining/N_security>`, :ref:`views<reference/views>` and
:ref:`security rules <tutorials/getting_started/N_security>`, :ref:`views<reference/views>` and
:ref:`actions<reference/actions>`. Those are one kind of master data.
On top of technical data, business data can be defined, e.g. countries, currencies, units of measure,
@ -194,8 +194,8 @@ When the data to create is more complex it can be useful, or even necessary, to
Data Extension
~~~~~~~~~~~~~~
During the Core Training, we saw in the :ref:`howto/rdtraining/13_inheritance` chapter we could
inherit (extend) an existing view. This was a special case of data extension: any data can be
During the Core Training, we saw in the :ref:`tutorials/getting_started/13_inheritance` chapter we
could inherit (extend) an existing view. This was a special case of data extension: any data can be
extended in a module.
When you are adding new fields to an existing model in a new module, you might want to populate
@ -251,7 +251,8 @@ works too if you are in the module declaring it).
The value to assign to a field is not always a simple string and you might need to compute it.
It can also be used to optimize the insertion of related values, or because a constraint forces you
to add the related values in batch. See ::ref:`Add X2many fields <howto/rdtraining/C_data/x2m>`.
to add the related values in batch. See ::ref:`Add X2many fields
<tutorials/getting_started/C_data/x2m>`.
.. code-block:: xml
@ -298,7 +299,7 @@ You might also need to execute python code when loading data.
others.
.. _howto/rdtraining/C_data/x2m:
.. _tutorials/getting_started/C_data/x2m:
Add X2many fields
-----------------
@ -361,7 +362,8 @@ In CSV, the title of the column must be suffixed with ``:id`` or ``/id``.
"child2","module.parent","Name2"
"child3","module.parent","Name3"
In SQL, it is more complicated, see :ref:`the advanced section<howto/rdtraining/C_data/xml_id>`.
In SQL, it is more complicated, see :ref:`the advanced section
<tutorials/getting_started/C_data/xml_id>`.
.. warning:: Data can always be deleted by the user. Always code defensively, taking this into
account.
@ -372,7 +374,7 @@ In SQL, it is more complicated, see :ref:`the advanced section<howto/rdtraining/
Advanced
========
.. _howto/rdtraining/C_data/xml_id:
.. _tutorials/getting_started/C_data/xml_id:
What is the XML id?
-------------------

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/D_mixins:
.. _tutorials/getting_started/D_mixins:
==================
Advanced D: Mixins

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/E_unittest:
.. _tutorials/getting_started/E_unittest:
=============================
Advanced E: Python Unit Tests

View File

@ -1,6 +1,6 @@
:orphan:
.. _howto/rdtraining/F_jstour:
.. _tutorials/getting_started/F_jstour:
====================
Advanced F: JS Tours

View File

@ -1,6 +1,6 @@
:orphan:
.. _howto/rdtraining/G_website:
.. _tutorials/getting_started/G_website:
=================================
Advanced G: Controllers & Website

View File

@ -1,6 +1,6 @@
:orphan:
.. _howto/rdtraining/H_adv_views:
.. _tutorials/getting_started/H_adv_views:
==========================
Advanced H: Advanced Views

View File

@ -1,6 +1,6 @@
:orphan:
.. _howto/rdtraining/I_jswidget:
.. _tutorials/getting_started/I_jswidget:
============================
Advanced I: Custom JS Widget

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/J_reports:
.. _tutorials/getting_started/J_reports:
=======================
Advanced J: PDF Reports
@ -6,7 +6,7 @@ Advanced J: PDF Reports
.. warning::
This tutorial assumes you have completed the :ref:`Core Training <howto/rdtraining>`
This tutorial assumes you have completed the :ref:`Core Training <tutorials/getting_started>`
and have installed :ref:`wkhtmltopdf <setup/install/source/prepare>`.
To follow the exercise, it is recommended that you fetch the branch {BRANCH}-core from the
@ -15,7 +15,7 @@ Advanced J: PDF Reports
contains a version of the module created during the core training we can use as a starting
point.
We were previously :ref:`introduced to QWeb <howto/rdtraining/15_qwebintro>`
We were previously :ref:`introduced to QWeb <tutorials/getting_started/15_qwebintro>`
in the Core Training where it was used to build a kanban view. Now we will expand on one of QWeb's
other main uses: creating PDF reports. A common business requirement is the ability to create documents
to send to customers and to use internally. These reports can be used to summarize and display
@ -58,8 +58,8 @@ Therefore, it is expected that your work tree will look something like this:
Note that you will often see other non-QWeb and non-XML files containing "report" in their name also within
the report folder. These are unrelated to the reports covered in this tutorial and are covered in
:ref:`another advanced topic <howto/rdtraining/K_dashboard>`. For now you can think of them as customized views
that use direct SQL queries (sometimes referred to as SQL Views).
:ref:`another advanced topic <tutorials/getting_started/K_dashboard>`. For now you can think of them
as customized views that use direct SQL queries (sometimes referred to as SQL Views).
Don't forget to add whatever files your template and action view will be into to your ``__manifest__.py``.
In this case, you will want to add the files to the ``data`` list and remember that the files listed in a manifest
@ -93,8 +93,8 @@ or all of your expected use cases. A good representation set for our simple repo
If you don't have a set of data like this already, you can either:
* Complete :ref:`howto/rdtraining/C_data` (if you haven't done so already) and add the extra
cases to your demo data (you may need to create a new database to load in the demo data).
* Complete :ref:`tutorials/getting_started/C_data` (if you haven't done so already) and add the
extra cases to your demo data (you may need to create a new database to load in the demo data).
* Manually create the data in your database.
* Copy this `data file
<https://github.com/odoo/technical-training-solutions/blob/{BRANCH}-J_reports/estate/data/estate_demo.xml>`_
@ -191,10 +191,10 @@ Its contents are all explained in :ref:`the documentation <reference/actions/rep
An ``ir.actions.report`` is primarily used via the Print menu of a model's view. In the practical
example, the ``binding_model_id`` specifies which model's views the report should show, and Odoo
will auto-magically add it for you. Another common use case of the report action is to link it to
a button as we learned in :ref:`howto/rdtraining/10_actions`. This is handy for reports that
only make sense under specific conditions. For example, if we wanted to make a "Final Sale" report,
then we can link it to a "Print Sale Info" button that appears in the form view only when the
property is "Sold".
a button as we learned in :ref:`tutorials/getting_started/10_actions`. This is handy for reports
that only make sense under specific conditions. For example, if we wanted to make a "Final Sale"
report, then we can link it to a "Print Sale Info" button that appears in the form view only when
the property is "Sold".
.. image:: J_reports/print_menu.png
:align: center

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/K_dashboard:
.. _tutorials/getting_started/K_dashboard:
======================
Advanced K: Dashboards
@ -6,8 +6,8 @@ Advanced K: Dashboards
.. warning::
This tutorial assumes you have completed the :ref:`Core Training <howto/rdtraining>` and have
access to Odoo Enterprise features.
This tutorial assumes you have completed the :ref:`Core Training <tutorials/getting_started>`
and have access to Odoo Enterprise features.
To follow the exercise, it is recommended that you fetch the branch
{BRANCH}-core from the `technical training solutions
@ -42,11 +42,11 @@ add it to your manifest file! It is standard to add dashboards intended to be us
It is standard to create a separate Enterprise module to add extra Enterprise views and features to
a Community module. This is done in a similar manner as the module link technique covered within
:ref:`howto/rdtraining/14_other_module`. The difference is that instead of linking 2 different
modules, we are extending our `estate` module. We do this by creating a new module and adding both
the Community module and its necessary Enterprise module dependencies to its manifest. You will
commonly see "enterprise" in the module's directory name. To keep this tutorial simple, we will
add dashboards to our existing ``estate`` module.
:ref:`tutorials/getting_started/14_other_module`. The difference is that instead of linking 2
different modules, we are extending our `estate` module. We do this by creating a new module and
adding both the Community module and its necessary Enterprise module dependencies to its manifest.
You will commonly see "enterprise" in the module's directory name. To keep this tutorial simple, we
will add dashboards to our existing ``estate`` module.
SQL Views have 2 parts: their xml file (don't forget to add it to your manifest file) and their
Python file (don't forget to add it to the appropriate ``__init.py__`` files). The former is the
@ -57,7 +57,7 @@ wondering why do we put the files in a report directory? We saw earlier that the
for data visualization, therefore it is not editable. You can think of dashboards as interactive
reports where you can click on statistics, graphs, and charts to see the specific data contributing
to them. Note it is also standard to store the xml code for
:ref:`PDF report templates <howto/rdtraining/J_reports>` in the report directory.
:ref:`PDF report templates <tutorials/getting_started/J_reports>` in the report directory.
It is expected that your work tree will look something like:
@ -117,8 +117,8 @@ minimum, and maximum statistics, therefore a good representation set for our das
If you don't have a set of data like this already, you can either:
* Complete :ref:`howto/rdtraining/C_data` (if you haven't done so already) and add the extra
cases to your demo data (you may need to create a new database to load in the demo data).
* Complete :ref:`tutorials/getting_started/C_data` (if you haven't done so already) and add the
extra cases to your demo data (you may need to create a new database to load in the demo data).
* Manually create the data in your database.
* Copy this `data file
<https://github.com/odoo/technical-training-solutions/blob/{BRANCH}-K_dashboard/estate/data/estate_demo.xml>`_
@ -133,8 +133,8 @@ 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
:ref:`tutorials/getting_started/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
:ref:`reference/views/dashboard` documentation). So a simple dashboard example is:
.. code-block:: xml
@ -152,7 +152,7 @@ how to aggregate it with the `group_operator` attribute. The `group_operator` ca
PostgreSQL aggregate function plus the special Odoo defined ``count_distinct``.
Hopefully you remember how to add views to a window action `view_mode` (hint, it was
covered in :ref:`howto/rdtraining/06_firstui`). Now let's make some dashboards!
covered in :ref:`tutorials/getting_started/06_firstui`). Now let's make some dashboards!
.. exercise:: Make a dashboard view.
@ -162,7 +162,7 @@ covered in :ref:`howto/rdtraining/06_firstui`). Now let's make some dashboards!
consideration any applied view filters!
- Bonus: Add in some aggregations that need a `domain` to make sense (remember domains were
also covered in :ref:`howto/rdtraining/07_basicviews`).
also covered in :ref:`tutorials/getting_started/07_basicviews`).
Pie Charts
----------
@ -197,10 +197,11 @@ 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
also an option. These views are covered in more depth in :ref:`howto/rdtraining/H_adv_views`. For
this topic, you are only required to know their names. A dashboard with only subviews is:
One2many relationships in :ref:`tutorials/getting_started/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 also an option. These views are covered in more depth in
:ref:`tutorials/getting_started/H_adv_views`. For this topic, you are only required to know their
names. A dashboard with only subviews is:
.. code-block:: xml
@ -274,10 +275,10 @@ our property offers don't have a name. We will need the `tools` import later (i.
the future). Note that it is standard to include ``report`` in the model's name.
Remember, your new model will need to be added to your security file, as you learned in
:ref:`howto/rdtraining/05_securityintro`!
:ref:`tutorials/getting_started/05_securityintro`!
Then we define the fields we need for our dashboard the same way as any other model (like you
learned in :ref:`howto/rdtraining/04_basicmodel`), except that every field is
learned in :ref:`tutorials/getting_started/04_basicmodel`), except that every field is
``readonly=True``. After all, our model is for read-only purposes only.
Now we override the ``BaseModel.init()`` method mentioned earlier::
@ -328,7 +329,7 @@ Now that we have our model, we can make its dashboard view. There is no differen
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
are added under a first-level menu called *Reporting* (because it's a report, surprise!). Do you
remember how to add a ``menuitem``? If not, revisit :ref:`howto/rdtraining/06_firstui`) again.
remember how to add a ``menuitem``? If not, revisit :ref:`tutorials/getting_started/06_firstui`) again.
.. exercise:: Create report view.

View File

@ -1,6 +1,6 @@
:orphan:
.. _howto/rdtraining/L_cron:
.. _tutorials/getting_started/L_cron:
======================================
Advanced L: Scheduled & Server Actions

View File

@ -1,6 +1,6 @@
:orphan:
.. _howto/rdtraining/M_migration:
.. _tutorials/getting_started/M_migration:
======================
Advanced M: Migrations

View File

@ -1,4 +1,4 @@
.. _howto/rdtraining/N_security:
.. _tutorials/getting_started/N_security:
====================
Advanced N: Security

Some files were not shown because too many files have changed in this diff Show More