[IMP] developer: improve navigation in top-level pages
Prior to this commit, users had to either know in advance or guess the
location of the content they were looking for. Top-level pages of the
"Developer" section of the documentation, in particular the "Developer"
page itself, were listing their sub-pages without directions for users.
This commit brings the following changes to improve the navigation:
- add directions for users on the "Developer" page and list the three
main categories of developer documentation ("Tutorials", "How-to
guides", and "Reference") with explanations of their content and
target audience;
- add categories for content cards on the "Tutorials" and "How-to
guides" pages, and fine-tune the toctree of the "Reference" page to
more easily locate specific topics;
- clarify what are the "Python framework" and the "JavaScript framework"
by relabelling them to "Server framework" and "Web framework" on
top-level pages, as some users were confused to find that the JS
framework was not responsible for the server, and others that the
documentation for QWeb template is located in the Python documentation;
- extract the "Setup guide" from the "Getting started" tutorial and
rename the latter to "Server framework 101" to allow reusing the setup
guide in other tutorials and make clear that the "Server framework 101"
tutorial is not about the Web framework.
task-3802536
closes odoo/documentation#8712
X-original-commit: 7f623b6ad5
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Valeriya (vchu) <vchu@odoo.com>
@ -146,7 +146,7 @@ Manually
|
||||
--------
|
||||
|
||||
If you want to create your module structure manually,
|
||||
you can follow the :doc:`/developer/tutorials/getting_started` tutorial to understand
|
||||
you can follow the :doc:`/developer/tutorials/server_framework_101` tutorial to understand
|
||||
the structure of a module and the content of each file.
|
||||
|
||||
Push the development branch
|
||||
|
@ -45,7 +45,7 @@ Git
|
||||
|
||||
To clone a Git repository, choose between cloning with HTTPS or SSH. In most cases, the best option
|
||||
is HTTPS. However, choose SSH to contribute to Odoo source code or when following the :doc:`Getting
|
||||
Started developer tutorial </developer/tutorials/getting_started>`.
|
||||
Started developer tutorial </developer/tutorials/server_framework_101>`.
|
||||
|
||||
.. tabs::
|
||||
|
||||
|
@ -48,7 +48,8 @@ lists the most important of them.
|
||||
pull requests from other contributors. By contributing to the codebase, you can make a direct
|
||||
and lasting impact on the quality and features of Odoo.
|
||||
- * :doc:`Guide: Contributing to the codebase <contributing/development>`
|
||||
* :doc:`Developer tutorials </developer/howtos>`
|
||||
* :doc:`Developer tutorials </developer/tutorials>`
|
||||
* :doc:`How-to guides </developer/howtos>`
|
||||
- Developers with experience in Python and web development
|
||||
* - Contribute to the documentation
|
||||
- Submit corrections and improvements to the Odoo documentation. The product evolves fast, and
|
||||
|
@ -1,20 +1,47 @@
|
||||
:nosearch:
|
||||
:show-content:
|
||||
:hide-page-toc:
|
||||
:show-toc:
|
||||
|
||||
|
||||
=========
|
||||
Developer
|
||||
=========
|
||||
|
||||
Learn through tutorials and get help using reference guides.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:maxdepth: 3
|
||||
developer/tutorials
|
||||
developer/howtos
|
||||
developer/reference
|
||||
|
||||
developer/tutorials
|
||||
developer/howtos
|
||||
developer/reference
|
||||
Welcome to the developer documentation of Odoo! Whether you're a seasoned developer or just getting
|
||||
started, you'll find here all the technical guidance and resources you need for developing Odoo
|
||||
applications. Explore our extensive collection of tutorials, how-to guides, and reference materials
|
||||
to achieve your development goals.
|
||||
|
||||
The Odoo development ecosystem is built on a modular and extensible architecture that allows you
|
||||
to extend existing applications or create new ones to meet the specific needs of modern businesses.
|
||||
You can make use of the tools and frameworks provided by Odoo to focus on getting your web
|
||||
application up and running quickly, without needing to reinvent the wheel and worry about the
|
||||
underlying infrastructure.
|
||||
|
||||
If you are new to Odoo or web application development, start with the
|
||||
:doc:`developer/tutorials/server_framework_101` tutorial.
|
||||
|
||||
.. cards::
|
||||
|
||||
.. card:: Tutorials
|
||||
:target: developer/tutorials
|
||||
|
||||
Tutorials take you by the hand through hands-on exercises to build skills and familiarity in
|
||||
Odoo development.
|
||||
|
||||
.. card:: How-to guides
|
||||
:target: developer/howtos
|
||||
|
||||
Recipes that provide a step-by-step guide for addressing real-world problems and use-cases.
|
||||
|
||||
.. card:: Reference
|
||||
:target: developer/reference
|
||||
|
||||
Technical descriptions and factual information on the frameworks and APIs of Odoo.
|
||||
|
||||
.. seealso::
|
||||
- :doc:`Guide: Contribute to the codebase </contributing/development>`
|
||||
- `Community forums <https://www.odoo.com/forum>`_
|
||||
|
@ -6,22 +6,25 @@ How-to guides
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
howtos/scss_tips
|
||||
howtos/javascript_field
|
||||
howtos/javascript_view
|
||||
howtos/javascript_client_action
|
||||
howtos/standalone_owl_application
|
||||
howtos/frontend_owl_components
|
||||
howtos/website_themes
|
||||
|
||||
howtos/scss_tips
|
||||
howtos/javascript_field
|
||||
howtos/javascript_view
|
||||
howtos/javascript_client_action
|
||||
howtos/standalone_owl_application
|
||||
howtos/frontend_owl_components
|
||||
howtos/web_services
|
||||
howtos/company
|
||||
howtos/create_reports
|
||||
howtos/accounting_localization
|
||||
howtos/translations
|
||||
howtos/website_themes
|
||||
howtos/connect_device
|
||||
howtos/upgrade_custom_db
|
||||
howtos/web_services
|
||||
howtos/company
|
||||
howtos/create_reports
|
||||
howtos/accounting_localization
|
||||
howtos/translations
|
||||
howtos/connect_device
|
||||
|
||||
howtos/upgrade_custom_db
|
||||
|
||||
Frontend development
|
||||
====================
|
||||
|
||||
.. cards::
|
||||
|
||||
@ -33,29 +36,39 @@ How-to guides
|
||||
.. card:: Customize a field
|
||||
:target: howtos/javascript_field
|
||||
|
||||
Learn how to customize field components in the Odoo JavaScript web framework.
|
||||
Learn how to customize field components in the web framework.
|
||||
|
||||
.. card:: Customize a view type
|
||||
:target: howtos/javascript_view
|
||||
|
||||
Learn how to customize view types in the Odoo JavaScript web framework.
|
||||
Learn how to customize view types in the web framework.
|
||||
|
||||
.. card:: Create a client action
|
||||
:target: howtos/javascript_client_action
|
||||
|
||||
Learn how to create client actions in the Odoo JavaScript web framework.
|
||||
Learn how to create client actions in the web framework.
|
||||
|
||||
.. card:: Create a standalone Owl application
|
||||
:target: howtos/standalone_owl_application
|
||||
|
||||
Learn how to create a public-facing Owl application outside of the web client using a
|
||||
controller and the Odoo JavaScript framework.
|
||||
controller and the web framework.
|
||||
|
||||
.. card:: Use Owl components on the portal and website
|
||||
:target: howtos/frontend_owl_components
|
||||
|
||||
Learn how to use Owl components on the portal and website.
|
||||
|
||||
.. card:: Website themes
|
||||
:target: howtos/website_themes
|
||||
|
||||
Learn how to customize your website by creating a custom theme.
|
||||
|
||||
Server-side development
|
||||
=======================
|
||||
|
||||
.. cards::
|
||||
|
||||
.. card:: Web services
|
||||
:target: howtos/web_services
|
||||
|
||||
@ -82,17 +95,18 @@ How-to guides
|
||||
|
||||
Learn how to provide translation abilities to your module.
|
||||
|
||||
.. card:: Website themes
|
||||
:target: howtos/website_themes
|
||||
|
||||
Learn how to customize your website by creating a custom theme.
|
||||
|
||||
.. card:: Connect with a device
|
||||
:target: howtos/connect_device
|
||||
|
||||
Learn how to enable a module to detect and communicate with an IoT device.
|
||||
|
||||
Custom development
|
||||
==================
|
||||
|
||||
.. cards::
|
||||
|
||||
.. card:: Upgrade a customized database
|
||||
:target: howtos/upgrade_custom_db
|
||||
|
||||
Learn how to upgrade a customized database, as well as the code and data of its custom modules.
|
||||
Learn how to upgrade a customized database, as well as the code and data of its custom
|
||||
modules.
|
||||
|
@ -6,7 +6,7 @@ Accounting localization
|
||||
.. warning::
|
||||
|
||||
This tutorial requires knowledge about how to build a module in Odoo (see
|
||||
:doc:`../tutorials/getting_started`).
|
||||
:doc:`../tutorials/server_framework_101`).
|
||||
|
||||
|
||||
Installation procedure
|
||||
|
@ -8,7 +8,7 @@ Multi-company Guidelines
|
||||
.. warning::
|
||||
|
||||
This tutorial requires good knowledge of Odoo.
|
||||
Please refer to the :doc:`../tutorials/getting_started` tutorial first if needed.
|
||||
Please refer to the :doc:`../tutorials/server_framework_101` tutorial first if needed.
|
||||
|
||||
As of version 13.0, a user can be logged in to multiple companies at once. This allows the user to
|
||||
access information from multiple companies, but also to create/edit records in a multi-company
|
||||
|
@ -1,18 +1,21 @@
|
||||
:nosearch:
|
||||
:show-content:
|
||||
:show-toc:
|
||||
:hide-page-toc:
|
||||
|
||||
=========
|
||||
Reference
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:maxdepth: 3
|
||||
|
||||
reference/backend
|
||||
reference/frontend
|
||||
reference/user_interface
|
||||
reference/standard_modules
|
||||
reference/cli
|
||||
reference/upgrade_scripts
|
||||
reference/upgrade_utils
|
||||
reference/external_api
|
||||
reference/extract_api
|
||||
reference/backend
|
||||
reference/frontend
|
||||
reference/user_interface
|
||||
reference/standard_modules
|
||||
reference/cli
|
||||
reference/upgrade_scripts
|
||||
reference/upgrade_utils
|
||||
reference/external_api
|
||||
reference/extract_api
|
||||
|
@ -1,19 +1,20 @@
|
||||
:nosearch:
|
||||
:hide-page-toc:
|
||||
|
||||
================
|
||||
Python framework
|
||||
Server framework
|
||||
================
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:titlesonly:
|
||||
|
||||
backend/orm
|
||||
backend/data
|
||||
backend/actions
|
||||
backend/reports
|
||||
backend/module
|
||||
backend/security
|
||||
backend/performance
|
||||
backend/testing
|
||||
backend/http
|
||||
backend/mixins
|
||||
backend/orm
|
||||
backend/data
|
||||
backend/actions
|
||||
backend/reports
|
||||
backend/module
|
||||
backend/security
|
||||
backend/performance
|
||||
backend/testing
|
||||
backend/http
|
||||
backend/mixins
|
||||
|
@ -1,21 +1,22 @@
|
||||
:nosearch:
|
||||
:hide-page-toc:
|
||||
|
||||
====================
|
||||
JavaScript framework
|
||||
====================
|
||||
=============
|
||||
Web framework
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:titlesonly:
|
||||
|
||||
frontend/framework_overview
|
||||
frontend/assets
|
||||
frontend/javascript_modules
|
||||
frontend/owl_components
|
||||
frontend/registries
|
||||
frontend/services
|
||||
frontend/hooks
|
||||
frontend/patching_code
|
||||
frontend/javascript_reference
|
||||
frontend/mobile
|
||||
frontend/qweb
|
||||
frontend/odoo_editor
|
||||
frontend/framework_overview
|
||||
frontend/assets
|
||||
frontend/javascript_modules
|
||||
frontend/owl_components
|
||||
frontend/registries
|
||||
frontend/services
|
||||
frontend/hooks
|
||||
frontend/patching_code
|
||||
frontend/javascript_reference
|
||||
frontend/mobile
|
||||
frontend/qweb
|
||||
frontend/odoo_editor
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: context
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: help
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: icon
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: name
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: string
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: type
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: name
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: readonly
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: required
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: string
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: widget
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: class
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: column_invisible
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: groups
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: invisible
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: banner_route
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: create
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: default_group_by
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: default_order
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: delete
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: edit
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: sample
|
||||
:noindex:
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
:nosearch:
|
||||
|
||||
.. attribute:: string
|
||||
:noindex:
|
||||
|
||||
|
@ -6,42 +6,52 @@ Tutorials
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
tutorials/setup_guide
|
||||
tutorials/server_framework_101
|
||||
tutorials/discover_js_framework
|
||||
tutorials/master_odoo_web_framework
|
||||
tutorials/define_module_data
|
||||
tutorials/restrict_data_access
|
||||
tutorials/unit_tests
|
||||
tutorials/mixins
|
||||
tutorials/pdf_reports
|
||||
|
||||
tutorials/getting_started
|
||||
tutorials/discover_js_framework
|
||||
tutorials/master_odoo_web_framework
|
||||
tutorials/define_module_data
|
||||
tutorials/restrict_data_access
|
||||
tutorials/unit_tests
|
||||
tutorials/mixins
|
||||
tutorials/pdf_reports
|
||||
.. tip::
|
||||
If you are new to Odoo development, we recommend starting with the :doc:`setup guide
|
||||
<tutorials/setup_guide>`.
|
||||
|
||||
Learn the server and web frameworks
|
||||
===================================
|
||||
|
||||
.. cards::
|
||||
|
||||
.. card:: Getting started
|
||||
:target: tutorials/getting_started
|
||||
.. card:: Server framework 101
|
||||
:target: tutorials/server_framework_101
|
||||
:tag: Beginner
|
||||
:large:
|
||||
|
||||
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.
|
||||
This introductory tutorial is designed for complete beginners seeking to get started in Odoo
|
||||
development. It covers the essential aspects and key concepts of the server framework. Learn
|
||||
to create a simple module from scratch with step-by-step instructions and practical insights.
|
||||
|
||||
.. card:: Discover the JavaScript Framework
|
||||
.. card:: Discover the web framework
|
||||
:target: tutorials/discover_js_framework
|
||||
:tag: Beginner
|
||||
:large:
|
||||
|
||||
Learn the basics of the JavaScript framework of Odoo. This tutorial will teach you how to work
|
||||
with Owl components and introduce the basic principles underlying the Odoo JavaScript
|
||||
codebase.
|
||||
This tutorial will teach the basics of the web framework and how to work with Owl components
|
||||
by customizing the web client.
|
||||
|
||||
.. card:: Master the Odoo Web Framework
|
||||
.. card:: Master the web framework
|
||||
:target: tutorials/master_odoo_web_framework
|
||||
:tag: Advanced
|
||||
|
||||
Become an expert in the Odoo Web Framework. A large variety of features are covered such as
|
||||
fields, views, and even the kitten mode.
|
||||
Become an expert in the web framework. A large variety of features are covered such as fields,
|
||||
views, and even the kitten mode.
|
||||
|
||||
Expand your knowledge on the server framework
|
||||
=============================================
|
||||
|
||||
.. cards::
|
||||
|
||||
.. card:: Define module data
|
||||
:target: tutorials/define_module_data
|
||||
|
@ -8,7 +8,7 @@ Building a Module
|
||||
=================
|
||||
|
||||
.. danger::
|
||||
This tutorial is outdated. We recommend reading :doc:`getting_started` instead.
|
||||
This tutorial is outdated. We recommend reading :doc:`server_framework_101` instead.
|
||||
|
||||
.. warning::
|
||||
This tutorial requires :doc:`having installed Odoo </administration/on_premise>`
|
||||
|
@ -3,11 +3,9 @@ Define module data
|
||||
==================
|
||||
|
||||
.. important::
|
||||
This tutorial is an extension of the :doc:`getting_started` tutorial. Make sure you have
|
||||
This tutorial is an extension of the :doc:`server_framework_101` tutorial. Make sure you have
|
||||
completed it and use the `estate` module you have built as a base for the exercises in this
|
||||
tutorial. Fetch the branch `{BRANCH}-core` from the `technical-training-solutions
|
||||
<https://github.com/odoo/technical-training-solutions/tree/{BRANCH}-core>`_ repository if you
|
||||
want to start from a clean base.
|
||||
tutorial.
|
||||
|
||||
Data Types
|
||||
==========
|
||||
@ -193,7 +191,7 @@ 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:`tutorials/getting_started/13_inheritance` chapter we
|
||||
During the Core Training, we saw in the :doc:`server_framework_101/12_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.
|
||||
|
||||
@ -251,7 +249,7 @@ 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
|
||||
<tutorials/getting_started/C_data/x2m>`.
|
||||
<tutorials/define_module_data/x2m>`.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
@ -298,7 +296,7 @@ You might also need to execute python code when loading data.
|
||||
others.
|
||||
|
||||
|
||||
.. _tutorials/getting_started/C_data/x2m:
|
||||
.. _tutorials/define_module_data/x2m:
|
||||
|
||||
Add X2many fields
|
||||
-----------------
|
||||
@ -362,7 +360,7 @@ In CSV, the title of the column must be suffixed with ``:id`` or ``/id``.
|
||||
"child3","module.parent","Name3"
|
||||
|
||||
In SQL, it is more complicated, see :ref:`the advanced section
|
||||
<tutorials/getting_started/C_data/xml_id>`.
|
||||
<tutorials/define_module_data/xml_id>`.
|
||||
|
||||
.. warning:: Data can always be deleted by the user. Always code defensively, taking this into
|
||||
account.
|
||||
@ -373,7 +371,7 @@ In SQL, it is more complicated, see :ref:`the advanced section
|
||||
Advanced
|
||||
========
|
||||
|
||||
.. _tutorials/getting_started/C_data/xml_id:
|
||||
.. _tutorials/define_module_data/xml_id:
|
||||
|
||||
What is the XML id?
|
||||
-------------------
|
||||
|
@ -1,8 +1,8 @@
|
||||
:show-content:
|
||||
|
||||
=========================
|
||||
Discover the JS framework
|
||||
=========================
|
||||
==========================
|
||||
Discover the web framework
|
||||
==========================
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
@ -10,12 +10,12 @@ Discover the JS framework
|
||||
|
||||
discover_js_framework/*
|
||||
|
||||
This two parts tutorial is designed to introduce you to the basics of the Odoo Javascript framework. Whether
|
||||
This two parts tutorial is designed to introduce you to the basics of the web framework. Whether
|
||||
you are new to the framework or have some prior experience, this tutorial will provide you with a
|
||||
solid foundation for using the Odoo JavaScript framework in your projects.
|
||||
solid foundation for using the web framework in your projects.
|
||||
|
||||
The first part covers the basics of Owl components, which
|
||||
are a key part of the Odoo JS framework. Owl components are reusable UI components that can be used
|
||||
are a key part of the web framework. Owl components are reusable UI components that can be used
|
||||
to build complex web interfaces quickly and efficiently. We will explore how to create and use Owl
|
||||
components in Odoo. Then, in the second part of this tutorial, we focus on creating a dashboard using various
|
||||
features of Odoo. Dashboards are an essential part of any web application, and provide a nice starting
|
||||
@ -23,8 +23,7 @@ point to use and interact with the Odoo codebase.
|
||||
|
||||
This tutorial assumes that you have some basic knowledge of development with Odoo in general
|
||||
(models, controllers, QWeb, ...). If you are new to Odoo, we recommend that you start with the
|
||||
:doc:`Getting started </developer/tutorials/getting_started>` tutorial before proceeding with this
|
||||
one.
|
||||
:doc:`/developer/tutorials/server_framework_101` tutorial before proceeding with this one.
|
||||
|
||||
.. note::
|
||||
|
||||
|
@ -1,47 +0,0 @@
|
||||
:show-content:
|
||||
|
||||
.. _tutorials/getting_started:
|
||||
|
||||
===============
|
||||
Getting started
|
||||
===============
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:glob:
|
||||
|
||||
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.
|
||||
|
||||
The goal of this tutorial is for you to get an insight of the most important parts of the Odoo
|
||||
development framework while developing your own Odoo module to manage real estate assets. 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.
|
||||
|
||||
.. attention::
|
||||
Are you following this tutorial as part of your technical onboarding as an Odoo employee? Then,
|
||||
we ask you to complete all the chapters before joining your new team.
|
||||
|
||||
Ready? Let's get started!
|
||||
|
||||
* :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_final_word`
|
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 15 KiB |
@ -1,8 +1,8 @@
|
||||
:show-content:
|
||||
|
||||
=============================
|
||||
Master the Odoo web framework
|
||||
=============================
|
||||
========================
|
||||
Master the web framework
|
||||
========================
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
@ -11,7 +11,7 @@ Master the Odoo web framework
|
||||
master_odoo_web_framework/*
|
||||
|
||||
This tutorial is designed for those who have completed the :doc:`discover_js_framework` tutorial and
|
||||
are looking to deepen their knowledge of the Odoo web framework. It is organized in four independant
|
||||
are looking to deepen their knowledge of the web framework. It is organized in four independent
|
||||
projects, each focusing on different features of Odoo.
|
||||
|
||||
.. note::
|
||||
|
@ -2,7 +2,7 @@
|
||||
Chapter 3: Customize a kanban view
|
||||
==================================
|
||||
|
||||
We have gained an understanding of the numerous capabilities offered by the Odoo web framework. As a
|
||||
We have gained an understanding of the numerous capabilities offered by the web framework. As a
|
||||
next step, we will customize a kanban view. This is a more complicated project that will showcase
|
||||
some non trivial aspects of the framework. The goal is to practice composing views, coordinating
|
||||
various aspects of the UI, and doing it in a maintainable way.
|
||||
|
@ -3,13 +3,11 @@ Build PDF Reports
|
||||
=================
|
||||
|
||||
.. important::
|
||||
This tutorial is an extension of the :doc:`getting_started` tutorial. Make sure you have
|
||||
This tutorial is an extension of the :doc:`server_framework_101` tutorial. Make sure you have
|
||||
completed it and use the `estate` module you have built as a base for the exercises in this
|
||||
tutorial. Fetch the branch `{BRANCH}-core` from the `technical-training-solutions
|
||||
<https://github.com/odoo/technical-training-solutions/tree/{BRANCH}-core>`_ repository if you
|
||||
want to start from a clean base.
|
||||
tutorial.
|
||||
|
||||
We were previously :ref:`introduced to QWeb <tutorials/getting_started/15_qwebintro>`
|
||||
We were previously :doc:`introduced to QWeb <server_framework_101/14_qwebintro>`
|
||||
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
|
||||
@ -180,7 +178,7 @@ 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:`tutorials/getting_started/10_actions`. This is handy for reports
|
||||
a button as we learned in :doc:`server_framework_101/09_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".
|
||||
|
@ -3,11 +3,9 @@ Restrict access to data
|
||||
=======================
|
||||
|
||||
.. important::
|
||||
This tutorial is an extension of the :doc:`getting_started` tutorial. Make sure you have
|
||||
This tutorial is an extension of the :doc:`server_framework_101` tutorial. Make sure you have
|
||||
completed it and use the `estate` module you have built as a base for the exercises in this
|
||||
tutorial. Fetch the branch `{BRANCH}-core` from the `technical-training-solutions
|
||||
<https://github.com/odoo/technical-training-solutions/tree/{BRANCH}-core>`_ repository if you
|
||||
want to start from a clean base.
|
||||
tutorial.
|
||||
|
||||
So far we have mostly concerned ourselves with implementing useful features.
|
||||
However in most business scenarios *security* quickly becomes a concern:
|
||||
@ -17,7 +15,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 <tutorials/getting_started/14_other_module/create>`.
|
||||
invoice <tutorials/server_framework_101/13_other_module/create>`.
|
||||
|
||||
However:
|
||||
|
||||
@ -142,7 +140,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:`tutorials/getting_started/05_securityintro`.
|
||||
Access rights were first introduced in :doc:`server_framework_101/04_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.
|
||||
|
44
content/developer/tutorials/server_framework_101.rst
Normal file
@ -0,0 +1,44 @@
|
||||
:show-content:
|
||||
|
||||
====================
|
||||
Server framework 101
|
||||
====================
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:glob:
|
||||
|
||||
server_framework_101/*
|
||||
|
||||
Welcome to the Server framework 101 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.
|
||||
|
||||
The goal of this tutorial is for you to get an insight of the most important parts of the Odoo
|
||||
development framework while developing your own Odoo module to manage real estate assets. 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.
|
||||
|
||||
.. important::
|
||||
Before going further, make sure you have prepared your development environment with the
|
||||
:doc:`setup guide <setup_guide>`.
|
||||
|
||||
Ready? Let's get started!
|
||||
|
||||
* :doc:`server_framework_101/01_architecture`
|
||||
* :doc:`server_framework_101/02_newapp`
|
||||
* :doc:`server_framework_101/03_basicmodel`
|
||||
* :doc:`server_framework_101/04_securityintro`
|
||||
* :doc:`server_framework_101/05_firstui`
|
||||
* :doc:`server_framework_101/06_basicviews`
|
||||
* :doc:`server_framework_101/07_relations`
|
||||
* :doc:`server_framework_101/08_compute_onchange`
|
||||
* :doc:`server_framework_101/09_actions`
|
||||
* :doc:`server_framework_101/10_constraints`
|
||||
* :doc:`server_framework_101/11_sprinkles`
|
||||
* :doc:`server_framework_101/12_inheritance`
|
||||
* :doc:`server_framework_101/13_other_module`
|
||||
* :doc:`server_framework_101/14_qwebintro`
|
||||
* :doc:`server_framework_101/15_final_word`
|
@ -1,4 +1,4 @@
|
||||
.. _tutorials/getting_started/01_architecture:
|
||||
.. _tutorials/server_framework_101/01_architecture:
|
||||
|
||||
================================
|
||||
Chapter 1: Architecture Overview
|
||||
@ -121,10 +121,7 @@ Odoo is available in `two versions`_: Odoo Enterprise (licensed & shared sources
|
||||
functionalities to Odoo. From a technical point-of-view, these functionalities are simply
|
||||
new modules installed on top of the modules provided by the Community version.
|
||||
|
||||
Ready to start? Before writing actual code, let's go to the :doc:`next chapter <02_setup>` to review
|
||||
the Odoo installation process. Even if Odoo is already running on your system, we strongly suggest
|
||||
you go through this chapter to make sure we start on the same page during the development of our new
|
||||
application.
|
||||
Ready to start? It is now time to :doc:`write your own application <02_newapp>`!
|
||||
|
||||
.. _multitier architecture:
|
||||
https://en.wikipedia.org/wiki/Multitier_architecture
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
@ -1,7 +1,5 @@
|
||||
.. _tutorials/getting_started/03_newapp:
|
||||
|
||||
============================
|
||||
Chapter 3: A New Application
|
||||
Chapter 2: A New Application
|
||||
============================
|
||||
|
||||
The purpose of this chapter is to lay the foundation for the creation of a completely new Odoo module.
|
||||
@ -18,7 +16,7 @@ to answer the specific business case.
|
||||
|
||||
Here is an overview of the main list view containing some advertisements:
|
||||
|
||||
.. image:: 03_newapp/overview_list_view_01.png
|
||||
.. image:: 02_newapp/overview_list_view_01.png
|
||||
:align: center
|
||||
:alt: List view 01
|
||||
|
||||
@ -26,14 +24,14 @@ The top area of the form view summarizes important information for the property,
|
||||
the property type, the postcode and so on. The first tab contains information describing the
|
||||
property: bedrooms, living area, garage, garden...
|
||||
|
||||
.. image:: 03_newapp/overview_form_view_01.png
|
||||
.. image:: 02_newapp/overview_form_view_01.png
|
||||
:align: center
|
||||
:alt: Form view 01
|
||||
|
||||
The second tab lists the offers for the property. We can see here that potential buyers can make
|
||||
offers above or below the expected selling price. It is up to the seller to accept an offer.
|
||||
|
||||
.. image:: 03_newapp/overview_form_view_02.png
|
||||
.. image:: 02_newapp/overview_form_view_02.png
|
||||
:align: center
|
||||
:alt: Form view 02
|
||||
|
||||
@ -52,7 +50,7 @@ Prepare the addon directory
|
||||
**Goal**: the goal of this section is to have Odoo recognize our new module, which will
|
||||
be an empty shell for now. It will be listed in the Apps:
|
||||
|
||||
.. image:: 03_newapp/app_in_list.png
|
||||
.. image:: 02_newapp/app_in_list.png
|
||||
:align: center
|
||||
:alt: The new module appears in the list
|
||||
|
||||
@ -98,5 +96,4 @@ tadaaa, your module appears! Did it not appear? Maybe try removing the default '
|
||||
|
||||
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
|
||||
<tutorials/getting_started/04_basicmodel>`!
|
||||
All good? If yes, then let's :doc:`create our first model <03_basicmodel>`!
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@ -1,10 +1,8 @@
|
||||
.. _tutorials/getting_started/04_basicmodel:
|
||||
|
||||
==================================
|
||||
Chapter 4: Models And Basic Fields
|
||||
Chapter 3: Models And Basic Fields
|
||||
==================================
|
||||
|
||||
At the end of the :ref:`previous chapter <tutorials/getting_started/03_newapp>`, we were able to
|
||||
At the end of the :doc:`previous chapter <02_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
|
||||
@ -289,7 +287,7 @@ useful or necessary:
|
||||
|
||||
|
||||
Now that we have created our first model, let's
|
||||
:ref:`add some security <tutorials/getting_started/05_securityintro>`!
|
||||
:doc:`add some security <04_securityintro>`!
|
||||
|
||||
|
||||
.. [#autofields] it is possible to :ref:`disable the automatic creation of some
|
@ -1,10 +1,8 @@
|
||||
.. _tutorials/getting_started/05_securityintro:
|
||||
|
||||
==========================================
|
||||
Chapter 5: Security - A Brief Introduction
|
||||
Chapter 4: Security - A Brief Introduction
|
||||
==========================================
|
||||
|
||||
In the :ref:`previous chapter <tutorials/getting_started/04_basicmodel>`, we created our first table
|
||||
In the :doc:`previous chapter <03_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.
|
||||
@ -119,7 +117,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 <tutorials/getting_started/06_firstui>`!
|
||||
It's now time to finally :doc:`interact with the UI <05_firstui>`!
|
||||
|
||||
.. [#who] meaning which Odoo user (or group of users)
|
||||
|
@ -1,11 +1,9 @@
|
||||
.. _tutorials/getting_started/06_firstui:
|
||||
|
||||
========================================
|
||||
Chapter 6: Finally, Some UI To Play With
|
||||
Chapter 5: Finally, Some UI To Play With
|
||||
========================================
|
||||
|
||||
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
|
||||
Now that we've created our new :doc:`model <03_basicmodel>` and its
|
||||
corresponding :doc:`access rights <04_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
|
||||
@ -17,7 +15,7 @@ Data Files (XML)
|
||||
**Reference**: the documentation related to this topic can be found in
|
||||
:ref:`reference/data`.
|
||||
|
||||
In :ref:`tutorials/getting_started/05_securityintro`, we added data through a CSV file. The CSV
|
||||
In :doc:`04_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,7 +63,7 @@ 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 <tutorials/getting_started/10_actions>` while the last is the focus of an
|
||||
:doc:`later chapter <09_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.
|
||||
@ -86,7 +84,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 <tutorials/getting_started/15_qwebintro>` that there can be other view modes.
|
||||
We'll see :doc:`later <14_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>`__
|
||||
@ -113,15 +111,15 @@ Menus
|
||||
**Goal**: at the end of this section, three menus should be created and the default view is
|
||||
displayed:
|
||||
|
||||
.. image:: 06_firstui/estate_menu_root.png
|
||||
.. image:: 05_firstui/estate_menu_root.png
|
||||
:align: center
|
||||
:alt: Root menus
|
||||
|
||||
.. image:: 06_firstui/estate_menu_action.png
|
||||
.. image:: 05_firstui/estate_menu_action.png
|
||||
:align: center
|
||||
:alt: First level and action menus
|
||||
|
||||
.. image:: 06_firstui/estate_form_default.png
|
||||
.. image:: 05_firstui/estate_form_default.png
|
||||
:align: center
|
||||
:alt: Default form view
|
||||
|
||||
@ -145,11 +143,11 @@ However, menus always follow an architecture, and in practice there are three le
|
||||
2. The first level menu, displayed in the top bar
|
||||
3. The action menus
|
||||
|
||||
.. image:: 06_firstui/menu_01.png
|
||||
.. image:: 05_firstui/menu_01.png
|
||||
:align: center
|
||||
:alt: Root menus
|
||||
|
||||
.. image:: 06_firstui/menu_02.png
|
||||
.. image:: 05_firstui/menu_02.png
|
||||
:align: center
|
||||
:alt: First level and action menus
|
||||
|
||||
@ -186,7 +184,7 @@ Fields, Attributes And View
|
||||
of bedrooms and the availability date should have default values. Additionally the selling price
|
||||
and availability date values won't be copied when the record is duplicated.
|
||||
|
||||
.. image:: 06_firstui/attribute_and_default.gif
|
||||
.. image:: 05_firstui/attribute_and_default.gif
|
||||
:align: center
|
||||
:alt: Interaction between model and view
|
||||
|
||||
@ -266,7 +264,7 @@ not be listed! ``active`` is an example of a reserved field with a specific beha
|
||||
a record has ``active=False``, it is automatically removed from any search. To display the
|
||||
created property, you will need to specifically search for inactive records.
|
||||
|
||||
.. image:: 06_firstui/inactive.gif
|
||||
.. image:: 05_firstui/inactive.gif
|
||||
:align: center
|
||||
:alt: Inactive records
|
||||
|
||||
@ -287,7 +285,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 <tutorials/getting_started/07_basicviews>`.
|
||||
obvious: we want to define :doc:`our own views <06_basicviews>`.
|
||||
|
||||
.. [#refresh] A refresh is needed since the web client keeps a cache of the various menus
|
||||
and views for performance reasons.
|
Before Width: | Height: | Size: 239 KiB After Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
@ -1,10 +1,8 @@
|
||||
.. _tutorials/getting_started/07_basicviews:
|
||||
|
||||
======================
|
||||
Chapter 7: Basic Views
|
||||
Chapter 6: Basic Views
|
||||
======================
|
||||
|
||||
We have seen in the :ref:`previous chapter <tutorials/getting_started/06_firstui>` that Odoo is able
|
||||
We have seen in the :doc:`previous chapter <05_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.
|
||||
@ -29,7 +27,7 @@ List
|
||||
|
||||
**Goal**: at the end of this section, the list view should look like this:
|
||||
|
||||
.. image:: 07_basicviews/list.png
|
||||
.. image:: 06_basicviews/list.png
|
||||
:align: center
|
||||
:alt: List view
|
||||
|
||||
@ -78,7 +76,7 @@ Form
|
||||
|
||||
**Goal**: at the end of this section, the form view should look like this:
|
||||
|
||||
.. image:: 07_basicviews/form.png
|
||||
.. image:: 06_basicviews/form.png
|
||||
:align: center
|
||||
:alt: Form view
|
||||
|
||||
@ -140,15 +138,15 @@ Search
|
||||
|
||||
**Goal**: at the end of this section, the search view should look like this:
|
||||
|
||||
.. image:: 07_basicviews/search_01.png
|
||||
.. image:: 06_basicviews/search_01.png
|
||||
:align: center
|
||||
:alt: Search fields
|
||||
|
||||
.. image:: 07_basicviews/search_02.png
|
||||
.. image:: 06_basicviews/search_02.png
|
||||
:align: center
|
||||
:alt: Filter
|
||||
|
||||
.. image:: 07_basicviews/search_03.png
|
||||
.. image:: 06_basicviews/search_03.png
|
||||
:align: center
|
||||
:alt: Group By
|
||||
|
||||
@ -239,4 +237,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 <tutorials/getting_started/08_relations>`.
|
||||
:doc:`link between models <07_relations>`.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
@ -1,10 +1,8 @@
|
||||
.. _tutorials/getting_started/08_relations:
|
||||
|
||||
===================================
|
||||
Chapter 8: Relations Between Models
|
||||
Chapter 7: Relations Between Models
|
||||
===================================
|
||||
|
||||
The :ref:`previous chapter <tutorials/getting_started/07_basicviews>` covered the creation of custom
|
||||
The :doc:`previous chapter <06_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
|
||||
@ -30,13 +28,13 @@ Many2one
|
||||
|
||||
- a new ``estate.property.type`` model should be created with the corresponding menu, action and views.
|
||||
|
||||
.. image:: 08_relations/property_type.png
|
||||
.. image:: 07_relations/property_type.png
|
||||
:align: center
|
||||
:alt: Property type
|
||||
|
||||
- three Many2one fields should be added to the ``estate.property`` model: property type, buyer and seller.
|
||||
|
||||
.. image:: 08_relations/property_many2one.png
|
||||
.. image:: 07_relations/property_many2one.png
|
||||
:align: center
|
||||
:alt: Property
|
||||
|
||||
@ -78,10 +76,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 <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>`.
|
||||
:doc:`model <03_basicmodel>`, set the
|
||||
:doc:`model <04_securityintro>`, add an
|
||||
:doc:`action and a menu <05_firstui>`, and
|
||||
:doc:`create a view <06_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 ;-)
|
||||
@ -137,13 +135,13 @@ Many2many
|
||||
|
||||
- a new ``estate.property.tag`` model should be created with the corresponding menu and action.
|
||||
|
||||
.. image:: 08_relations/property_tag.png
|
||||
.. image:: 07_relations/property_tag.png
|
||||
:align: center
|
||||
:alt: Property tag
|
||||
|
||||
- tags should be added to the ``estate.property`` model:
|
||||
|
||||
.. image:: 08_relations/property_many2many.png
|
||||
.. image:: 07_relations/property_many2many.png
|
||||
:align: center
|
||||
:alt: Property
|
||||
|
||||
@ -185,7 +183,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 <tutorials/getting_started/12_sprinkles>`.
|
||||
The ``widget`` attribute will be explained in detail in :doc:`a later chapter of the training <11_sprinkles>`.
|
||||
For now, you can try to adding and removing it and see the result ;-)
|
||||
|
||||
One2many
|
||||
@ -201,7 +199,7 @@ One2many
|
||||
- a new ``estate.property.offer`` model should be created with the corresponding form and tree view.
|
||||
- offers should be added to the ``estate.property`` model:
|
||||
|
||||
.. image:: 08_relations/property_offer.png
|
||||
.. image:: 07_relations/property_offer.png
|
||||
:align: center
|
||||
:alt: Property offers
|
||||
|
||||
@ -263,4 +261,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 <tutorials/getting_started/09_compute_onchange>` will be lighter, don't worry ;-)
|
||||
:doc:`next chapter <08_compute_onchange>` will be lighter, don't worry ;-)
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
@ -1,10 +1,8 @@
|
||||
.. _tutorials/getting_started/09_compute_onchange:
|
||||
|
||||
========================================
|
||||
Chapter 9: Computed Fields And Onchanges
|
||||
Chapter 8: Computed Fields And Onchanges
|
||||
========================================
|
||||
|
||||
The :ref:`relations between models <tutorials/getting_started/08_relations>` are a key component of
|
||||
The :doc:`relations between models <07_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.
|
||||
@ -26,13 +24,13 @@ Computed Fields
|
||||
|
||||
- In the property model, the total area and the best offer should be computed:
|
||||
|
||||
.. image:: 09_compute_onchange/compute.gif
|
||||
.. image:: 08_compute_onchange/compute.gif
|
||||
:align: center
|
||||
:alt: Compute fields
|
||||
|
||||
- In the property offer model, the validity date should be computed and can be updated:
|
||||
|
||||
.. image:: 09_compute_onchange/compute_inverse.gif
|
||||
.. image:: 08_compute_onchange/compute_inverse.gif
|
||||
:align: center
|
||||
:alt: Compute field with inverse
|
||||
|
||||
@ -52,7 +50,7 @@ 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:`tutorials/getting_started/01_architecture`). Private methods have a name starting with an
|
||||
:ref:`tutorials/server_framework_101/01_architecture`). Private methods have a name starting with an
|
||||
underscore ``_``.
|
||||
|
||||
Dependencies
|
||||
@ -230,7 +228,7 @@ Onchanges
|
||||
**Goal**: at the end of this section, enabling the garden will set a default area of 10 and
|
||||
an orientation to North.
|
||||
|
||||
.. image:: 09_compute_onchange/onchange.gif
|
||||
.. image:: 08_compute_onchange/onchange.gif
|
||||
:align: center
|
||||
:alt: Onchange
|
||||
|
||||
@ -301,5 +299,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 <tutorials/getting_started/10_actions>`, we'll see how we can trigger some
|
||||
In the :doc:`next chapter <09_actions>`, we'll see how we can trigger some
|
||||
business logic when buttons are clicked.
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
@ -1,11 +1,9 @@
|
||||
.. _tutorials/getting_started/10_actions:
|
||||
|
||||
==================================
|
||||
Chapter 10: Ready For Some Action?
|
||||
Chapter 9: 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 <tutorials/getting_started/09_compute_onchange>` thanks to
|
||||
logic in the :doc:`previous chapter <08_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:
|
||||
|
||||
@ -28,7 +26,7 @@ Object Type
|
||||
|
||||
- You should be able to cancel or set a property as sold:
|
||||
|
||||
.. image:: 10_actions/property.gif
|
||||
.. image:: 09_actions/property.gif
|
||||
:align: center
|
||||
:alt: Cancel and set to sold
|
||||
|
||||
@ -37,13 +35,13 @@ Object Type
|
||||
|
||||
- You should be able to accept or refuse an offer:
|
||||
|
||||
.. image:: 10_actions/offer_01.gif
|
||||
.. image:: 09_actions/offer_01.gif
|
||||
:align: center
|
||||
:alt: Accept or refuse an offer
|
||||
|
||||
- Once an offer is accepted, the selling price and the buyer should be set:
|
||||
|
||||
.. image:: 10_actions/offer_02.gif
|
||||
.. image:: 09_actions/offer_02.gif
|
||||
:align: center
|
||||
:alt: Accept an offer
|
||||
|
||||
@ -125,7 +123,7 @@ and its
|
||||
Action Type
|
||||
===========
|
||||
|
||||
In :ref:`tutorials/getting_started/06_firstui`, we created an action that was linked to a menu. You
|
||||
In :doc:`05_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:
|
||||
|
||||
@ -135,5 +133,5 @@ is:
|
||||
|
||||
We use ``type="action"`` and we refer to the :term:`external identifier` in the ``name``.
|
||||
|
||||
In the :ref:`next chapter <tutorials/getting_started/11_constraints>` we'll see how we can prevent
|
||||
In the :doc:`next chapter <10_constraints>` we'll see how we can prevent
|
||||
encoding incorrect data in Odoo.
|
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 186 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
@ -1,10 +1,8 @@
|
||||
.. _tutorials/getting_started/11_constraints:
|
||||
|
||||
=======================
|
||||
Chapter 11: Constraints
|
||||
Chapter 10: Constraints
|
||||
=======================
|
||||
|
||||
The :ref:`previous chapter <tutorials/getting_started/10_actions>` introduced the ability to add
|
||||
The :doc:`previous chapter <09_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.
|
||||
@ -25,13 +23,13 @@ SQL
|
||||
|
||||
- Amounts should be (strictly) positive
|
||||
|
||||
.. image:: 11_constraints/sql_01.gif
|
||||
.. image:: 10_constraints/sql_01.gif
|
||||
:align: center
|
||||
:alt: Constraints on amounts
|
||||
|
||||
- Property types and tags should have a unique name
|
||||
|
||||
.. image:: 11_constraints/sql_02.gif
|
||||
.. image:: 10_constraints/sql_02.gif
|
||||
:align: center
|
||||
:alt: Constraints on names
|
||||
|
||||
@ -76,7 +74,7 @@ Python
|
||||
**Goal**: at the end of this section, it will not be possible to accept an offer
|
||||
lower than 90% of the expected price.
|
||||
|
||||
.. image:: 11_constraints/python.gif
|
||||
.. image:: 10_constraints/python.gif
|
||||
:align: center
|
||||
:alt: Python constraint
|
||||
|
||||
@ -123,7 +121,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 <tutorials/getting_started/12_sprinkles>`.
|
||||
improve it in the :doc:`next chapter <11_sprinkles>`.
|
||||
|
||||
.. _PostgreSQL's documentation:
|
||||
.. _table_constraint:
|
Before Width: | Height: | Size: 316 KiB After Width: | Height: | Size: 316 KiB |
Before Width: | Height: | Size: 225 KiB After Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
@ -1,13 +1,11 @@
|
||||
.. _tutorials/getting_started/12_sprinkles:
|
||||
|
||||
=============================
|
||||
Chapter 12: Add The Sprinkles
|
||||
Chapter 11: Add The Sprinkles
|
||||
=============================
|
||||
|
||||
Our real estate module now makes sense from a business perspective. We created
|
||||
: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
|
||||
:doc:`specific views <06_basicviews>`, added several
|
||||
:doc:`action buttons <09_actions>` and
|
||||
:doc:`constraints <10_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.
|
||||
@ -27,7 +25,7 @@ Inline Views
|
||||
**Goal**: at the end of this section, a specific list of properties should be added to the property
|
||||
type view:
|
||||
|
||||
.. image:: 12_sprinkles/inline_view.png
|
||||
.. image:: 11_sprinkles/inline_view.png
|
||||
:align: center
|
||||
:alt: Inline list view
|
||||
|
||||
@ -102,7 +100,7 @@ Widgets
|
||||
**Goal**: at the end of this section, the state of the property should be displayed using a
|
||||
specific widget:
|
||||
|
||||
.. image:: 12_sprinkles/widget.png
|
||||
.. image:: 11_sprinkles/widget.png
|
||||
:align: center
|
||||
:alt: Statusbar widget
|
||||
|
||||
@ -241,7 +239,7 @@ Form
|
||||
- Conditional display of buttons and fields
|
||||
- Tag colors
|
||||
|
||||
.. image:: 12_sprinkles/form.gif
|
||||
.. image:: 11_sprinkles/form.gif
|
||||
:align: center
|
||||
:alt: Form view with sprinkles
|
||||
|
||||
@ -269,7 +267,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:`tutorials/getting_started/06_firstui`, we saw that reserved fields were used for
|
||||
In :doc:`05_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 can be used in combination with an ``invisible`` attribute in the view to display
|
||||
@ -322,11 +320,11 @@ List
|
||||
Additionally, offers and tags will be editable directly in the list, and the availability date will be
|
||||
hidden by default.
|
||||
|
||||
.. image:: 12_sprinkles/decoration.png
|
||||
.. image:: 11_sprinkles/decoration.png
|
||||
:align: center
|
||||
:alt: List view with decorations and optional field
|
||||
|
||||
.. image:: 12_sprinkles/editable_list.gif
|
||||
.. image:: 11_sprinkles/editable_list.gif
|
||||
:align: center
|
||||
:alt: Editable list
|
||||
|
||||
@ -392,7 +390,7 @@ Search
|
||||
and searching on the living area returns results where the area is larger than the given
|
||||
number.
|
||||
|
||||
.. image:: 12_sprinkles/search.gif
|
||||
.. image:: 11_sprinkles/search.gif
|
||||
:align: center
|
||||
:alt: Default filters and domains
|
||||
|
||||
@ -440,7 +438,7 @@ Stat Buttons
|
||||
**Goal**: at the end of this section, there will be a stat button on the property type form view
|
||||
which shows the list of all offers related to properties of the given type when it is clicked on.
|
||||
|
||||
.. image:: 12_sprinkles/stat_button.gif
|
||||
.. image:: 11_sprinkles/stat_button.gif
|
||||
:align: center
|
||||
:alt: Stat button
|
||||
|
||||
@ -505,7 +503,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:`tutorials/getting_started/10_actions` if you need a refresher).
|
||||
:doc:`09_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.
|
||||
@ -514,8 +512,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
|
||||
<tutorials/getting_started/13_inheritance>` doesn't require stat buttons ;-)
|
||||
Looking good? If not, don't worry, the :doc:`next chapter
|
||||
<12_inheritance>` doesn't require stat buttons ;-)
|
||||
|
||||
.. _order_by:
|
||||
https://www.postgresql.org/docs/12/queries-order.html
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 276 KiB |
Before Width: | Height: | Size: 283 KiB After Width: | Height: | Size: 283 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 266 KiB After Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
@ -1,7 +1,5 @@
|
||||
.. _tutorials/getting_started/13_inheritance:
|
||||
|
||||
=======================
|
||||
Chapter 13: Inheritance
|
||||
Chapter 12: Inheritance
|
||||
=======================
|
||||
|
||||
A powerful aspect of Odoo is its modularity. A module is dedicated to a business need, but
|
||||
@ -21,14 +19,14 @@ Python Inheritance
|
||||
|
||||
- It should not be possible to delete a property which is not new or canceled.
|
||||
|
||||
.. image:: 13_inheritance/unlink.gif
|
||||
.. image:: 12_inheritance/unlink.gif
|
||||
:align: center
|
||||
:alt: Unlink
|
||||
|
||||
- When an offer is created, the property state should change to 'Offer Received'
|
||||
- It should not be possible to create an offer with a lower price than an existing offer
|
||||
|
||||
.. image:: 13_inheritance/create.gif
|
||||
.. image:: 12_inheritance/create.gif
|
||||
:align: center
|
||||
:alt: Create
|
||||
|
||||
@ -126,7 +124,7 @@ The second inheritance mechanism (delegation) allows every record of a model to
|
||||
to a parent model's record and provides transparent access to the
|
||||
fields of this parent record.
|
||||
|
||||
.. image:: 13_inheritance/inheritance_methods.png
|
||||
.. image:: 12_inheritance/inheritance_methods.png
|
||||
:align: center
|
||||
:alt: Inheritance Methods
|
||||
|
||||
@ -173,7 +171,7 @@ View Inheritance
|
||||
**Goal**: at the end of this section, the list of available properties linked
|
||||
to a salesperson should be displayed in their user form view
|
||||
|
||||
.. image:: 13_inheritance/users.png
|
||||
.. image:: 12_inheritance/users.png
|
||||
:align: center
|
||||
:alt: Users
|
||||
|
||||
@ -245,7 +243,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 <tutorials/getting_started/14_other_module>`, we will learn how to
|
||||
In the :doc:`next chapter <13_other_module>`, we will learn how to
|
||||
interact with other modules.
|
||||
|
||||
.. _XPath: https://w3.org/TR/xpath
|
Before Width: | Height: | Size: 356 KiB After Width: | Height: | Size: 356 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 224 KiB |