From daf82ef1dbfca41a3f20499df800e6e1c1fcd42a Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Mon, 20 Feb 2023 16:48:19 +0000 Subject: [PATCH] [MOV] tutorials/getting_started/*: promote advanced chapters to independent tutorials task-2991663 Part-of: odoo/documentation#3649 --- content/developer/tutorials.rst | 95 +++++++++++++++++- .../K_dashboard.rst => dashboards.rst} | 42 ++++---- .../report_dashboard.png | Bin .../report_list_detail.png | Bin .../simple_dashboard.png | Bin .../C_data.rst => define_module_data.rst} | 24 ++--- .../developer/tutorials/getting_started.rst | 67 +++--------- .../getting_started/01_architecture.rst | 2 - .../getting_started/05_securityintro.rst | 8 +- .../tutorials/getting_started/A_i18n.rst | 9 -- .../tutorials/getting_started/F_jstour.rst | 9 -- .../tutorials/getting_started/G_website.rst | 9 -- .../tutorials/getting_started/H_adv_views.rst | 9 -- .../tutorials/getting_started/I_jswidget.rst | 9 -- .../tutorials/getting_started/L_cron.rst | 9 -- .../tutorials/getting_started/M_migration.rst | 9 -- .../tutorials/getting_started/N_security.rst | 27 ----- .../tutorials/getting_started/O_perf.rst | 9 -- .../D_mixins.rst => mixins.rst} | 10 +- .../J_reports.rst => pdf_reports.rst} | 42 ++++---- .../inherited_report.png | Bin .../J_reports => pdf_reports}/print_menu.png | Bin .../report_subtemplate.png | Bin .../simple_report.png | Bin ...l_irrules.rst => restrict_data_access.rst} | 39 +++---- .../agent.png | Bin .../error.png | Bin .../groups.png | Bin .../E_unittest.rst => unit_tests.rst} | 19 ++-- redirects/14.0.txt | 10 +- redirects/15.0.txt | 4 +- 31 files changed, 190 insertions(+), 271 deletions(-) rename content/developer/tutorials/{getting_started/K_dashboard.rst => dashboards.rst} (93%) rename content/developer/tutorials/{getting_started/K_dashboard => dashboards}/report_dashboard.png (100%) rename content/developer/tutorials/{getting_started/K_dashboard => dashboards}/report_list_detail.png (100%) rename content/developer/tutorials/{getting_started/K_dashboard => dashboards}/simple_dashboard.png (100%) rename content/developer/tutorials/{getting_started/C_data.rst => define_module_data.rst} (95%) delete mode 100644 content/developer/tutorials/getting_started/A_i18n.rst delete mode 100644 content/developer/tutorials/getting_started/F_jstour.rst delete mode 100644 content/developer/tutorials/getting_started/G_website.rst delete mode 100644 content/developer/tutorials/getting_started/H_adv_views.rst delete mode 100644 content/developer/tutorials/getting_started/I_jswidget.rst delete mode 100644 content/developer/tutorials/getting_started/L_cron.rst delete mode 100644 content/developer/tutorials/getting_started/M_migration.rst delete mode 100644 content/developer/tutorials/getting_started/N_security.rst delete mode 100644 content/developer/tutorials/getting_started/O_perf.rst rename content/developer/tutorials/{getting_started/D_mixins.rst => mixins.rst} (77%) rename content/developer/tutorials/{getting_started/J_reports.rst => pdf_reports.rst} (91%) rename content/developer/tutorials/{getting_started/J_reports => pdf_reports}/inherited_report.png (100%) rename content/developer/tutorials/{getting_started/J_reports => pdf_reports}/print_menu.png (100%) rename content/developer/tutorials/{getting_started/J_reports => pdf_reports}/report_subtemplate.png (100%) rename content/developer/tutorials/{getting_started/J_reports => pdf_reports}/simple_report.png (100%) rename content/developer/tutorials/{getting_started/B_acl_irrules.rst => restrict_data_access.rst} (95%) rename content/developer/tutorials/{getting_started/B_acl_irrules => restrict_data_access}/agent.png (100%) rename content/developer/tutorials/{getting_started/B_acl_irrules => restrict_data_access}/error.png (100%) rename content/developer/tutorials/{getting_started/B_acl_irrules => restrict_data_access}/groups.png (100%) rename content/developer/tutorials/{getting_started/E_unittest.rst => unit_tests.rst} (96%) diff --git a/content/developer/tutorials.rst b/content/developer/tutorials.rst index b70fcc976..e46ec150a 100644 --- a/content/developer/tutorials.rst +++ b/content/developer/tutorials.rst @@ -9,6 +9,12 @@ Tutorials :titlesonly: tutorials/getting_started + tutorials/define_module_data + tutorials/restrict_data_access + tutorials/unit_tests + tutorials/mixins + tutorials/pdf_reports + tutorials/dashboards .. raw:: html @@ -20,9 +26,9 @@ Tutorials

Getting started

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

+ +
+
+

Define module data

+

+ Define master and demo data for an Odoo module, leveraging the strengths of + the CSV and XML file formats to accommodate specific data requirements. +

+
+ +
+
+ + +
+
+

Restrict access to data

+

+ Implement security measures to restrict access to sensitive data with the + help of groups, access rights, and record rules. +

+
+ +
+
+ + +
+
+

Safeguard your code with unit tests

+

+ Write effective unit tests in Python to ensure the resilience of your code + and safeguard it against unexpected behaviors and regressions. +

+
+ +
+
+ + +
+
+

Reuse code with mixins

+

+ Create mixins to code features once and reuse them in multiple models. +

+
+ +
+
+ + +
+
+

Build PDF reports

+

+ Use QWeb, Odoo's powerful templating engine, to create custom PDF reports for + your documents. +

+
+ +
+
+ + +
+
+

Visualize data in dashboards

+

+ Create data visualization dashboards using the enterprise edition "Dashboard" + view and so-called "SQL views". +

+
+ +
+
+ diff --git a/content/developer/tutorials/getting_started/K_dashboard.rst b/content/developer/tutorials/dashboards.rst similarity index 93% rename from content/developer/tutorials/getting_started/K_dashboard.rst rename to content/developer/tutorials/dashboards.rst index aa7481392..861585f5c 100644 --- a/content/developer/tutorials/getting_started/K_dashboard.rst +++ b/content/developer/tutorials/dashboards.rst @@ -1,19 +1,13 @@ -.. _tutorials/getting_started/K_dashboard: +============================ +Visualize data in dashboards +============================ -====================== -Advanced K: Dashboards -====================== - -.. warning:: - - This tutorial assumes you have completed the :ref:`Core Training ` - 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 - `_ repository. It - contains a version of the module created during the core training we can use as a starting - point. +.. important:: + This tutorial is an extension of the :doc:`getting_started` 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 + `_ repository if you + want to start from a clean base. The term "Dashboard" is used in Odoo for objects that display data, but involves different implementations. This tutorial will only focus on the Enterprise view that is used to provide @@ -56,8 +50,8 @@ is also common to include "report" in the name of the SQL view's files. You may wondering why do we put the files in a report directory? We saw earlier that the dashboard is 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 ` in the report directory. +to them. Note it is also standard to store the xml code for :doc:`PDF report templates +` in the report directory. It is expected that your work tree will look something like: @@ -87,7 +81,7 @@ Dashboard View **Goal**: at the end of this section, we will have a new dashboard view that displays different property statistics. - .. image:: K_dashboard/simple_dashboard.png + .. image:: dashboards/simple_dashboard.png :align: center :alt: Basic Dashboard view @@ -117,8 +111,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:`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). +* Complete :doc:`define_module_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 `_ @@ -199,9 +193,7 @@ Subviews Similar to how we can use the list view within the form view (we saw this automatically happen for 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: +view is also an option. A dashboard with only subviews is: .. code-block:: xml @@ -240,7 +232,7 @@ SQL Views **Goal**: at the end of this section, we will have a new SQL view that displays different property statistics. - .. image:: K_dashboard/report_dashboard.png + .. image:: dashboards/report_dashboard.png :align: center :alt: SQL view @@ -350,7 +342,7 @@ are still looking at all the offers per property, so any property with more than counted per offer. This example is easily double-checked by clicking on the pie chart to see its list view: - .. image:: K_dashboard/report_list_detail.png + .. image:: dashboards/report_list_detail.png :align: center :alt: Pie chart list view diff --git a/content/developer/tutorials/getting_started/K_dashboard/report_dashboard.png b/content/developer/tutorials/dashboards/report_dashboard.png similarity index 100% rename from content/developer/tutorials/getting_started/K_dashboard/report_dashboard.png rename to content/developer/tutorials/dashboards/report_dashboard.png diff --git a/content/developer/tutorials/getting_started/K_dashboard/report_list_detail.png b/content/developer/tutorials/dashboards/report_list_detail.png similarity index 100% rename from content/developer/tutorials/getting_started/K_dashboard/report_list_detail.png rename to content/developer/tutorials/dashboards/report_list_detail.png diff --git a/content/developer/tutorials/getting_started/K_dashboard/simple_dashboard.png b/content/developer/tutorials/dashboards/simple_dashboard.png similarity index 100% rename from content/developer/tutorials/getting_started/K_dashboard/simple_dashboard.png rename to content/developer/tutorials/dashboards/simple_dashboard.png diff --git a/content/developer/tutorials/getting_started/C_data.rst b/content/developer/tutorials/define_module_data.rst similarity index 95% rename from content/developer/tutorials/getting_started/C_data.rst rename to content/developer/tutorials/define_module_data.rst index 46cd95ebd..39a51c2e4 100644 --- a/content/developer/tutorials/getting_started/C_data.rst +++ b/content/developer/tutorials/define_module_data.rst @@ -1,14 +1,13 @@ -.. _tutorials/getting_started/C_data: +================== +Define module data +================== -================================ -Advanced C: Master and Demo Data -================================ - -.. tip:: This tutorial assumes you followed the Core Training. - - To do the exercise, fetch the branch {BRANCH}-core from the `technical training solutions - `_ repository. It - contains a basic module we will use as a starting point +.. important:: + This tutorial is an extension of the :doc:`getting_started` 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 + `_ repository if you + want to start from a clean base. Data Types ========== @@ -20,9 +19,8 @@ Master data is usually part of the technical or business requirements for the mo words, such data is often necessary for the module to work properly. This data will always be installed when installing the module. -We already met technical data previously since we have defined -:ref:`security rules `, :ref:`views` and -:ref:`actions`. Those are one kind of master data. +We already met technical data previously since we have defined :ref:`views ` and +:ref:`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, as well as complete country localization (legal reports, tax definitions, chart of account), and much diff --git a/content/developer/tutorials/getting_started.rst b/content/developer/tutorials/getting_started.rst index f11e2ca4b..1fd34c112 100644 --- a/content/developer/tutorials/getting_started.rst +++ b/content/developer/tutorials/getting_started.rst @@ -6,45 +6,29 @@ 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. -This training is split in two parts: - -- The first part is the :ref:`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 - `. Each topic can be followed independently, but - requires the :ref:`core training `. +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 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. + 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! -.. _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` @@ -61,28 +45,3 @@ Core training * :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` diff --git a/content/developer/tutorials/getting_started/01_architecture.rst b/content/developer/tutorials/getting_started/01_architecture.rst index da69e7aed..0ef344e04 100644 --- a/content/developer/tutorials/getting_started/01_architecture.rst +++ b/content/developer/tutorials/getting_started/01_architecture.rst @@ -84,8 +84,6 @@ 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 ` and -:ref:`static web data ` are advanced topics. Module structure ---------------- diff --git a/content/developer/tutorials/getting_started/05_securityintro.rst b/content/developer/tutorials/getting_started/05_securityintro.rst index d80f22491..4d3fed756 100644 --- a/content/developer/tutorials/getting_started/05_securityintro.rst +++ b/content/developer/tutorials/getting_started/05_securityintro.rst @@ -9,8 +9,8 @@ intended to store business data. In a business application such as Odoo, one of 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:`tutorials/getting_started/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 :doc:`../restrict_data_access`. This chapter aims +to cover the minimum required for our new module. Data Files (CSV) ================ @@ -105,9 +105,7 @@ Here is an example for our previous ``test.model``: - ``model_id/id`` refers to the model which the access right applies to. The standard way to refer to the model is ``model_``, where ```` 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 ` dedicated to the - security. +- ``group_id/id`` refers to the group which the access right applies to. - ``perm_read,perm_write,perm_create,perm_unlink``: read, write, create and unlink permissions .. exercise:: Add access rights. diff --git a/content/developer/tutorials/getting_started/A_i18n.rst b/content/developer/tutorials/getting_started/A_i18n.rst deleted file mode 100644 index afa300801..000000000 --- a/content/developer/tutorials/getting_started/A_i18n.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/A_i18n: - -================================ -Advanced A: Internationalization -================================ - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/F_jstour.rst b/content/developer/tutorials/getting_started/F_jstour.rst deleted file mode 100644 index 553123918..000000000 --- a/content/developer/tutorials/getting_started/F_jstour.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/F_jstour: - -==================== -Advanced F: JS Tours -==================== - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/G_website.rst b/content/developer/tutorials/getting_started/G_website.rst deleted file mode 100644 index a6006f8d5..000000000 --- a/content/developer/tutorials/getting_started/G_website.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/G_website: - -================================= -Advanced G: Controllers & Website -================================= - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/H_adv_views.rst b/content/developer/tutorials/getting_started/H_adv_views.rst deleted file mode 100644 index 7729e581d..000000000 --- a/content/developer/tutorials/getting_started/H_adv_views.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/H_adv_views: - -========================== -Advanced H: Advanced Views -========================== - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/I_jswidget.rst b/content/developer/tutorials/getting_started/I_jswidget.rst deleted file mode 100644 index b31118f6b..000000000 --- a/content/developer/tutorials/getting_started/I_jswidget.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/I_jswidget: - -============================ -Advanced I: Custom JS Widget -============================ - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/L_cron.rst b/content/developer/tutorials/getting_started/L_cron.rst deleted file mode 100644 index 8a047ab9a..000000000 --- a/content/developer/tutorials/getting_started/L_cron.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/L_cron: - -====================================== -Advanced L: Scheduled & Server Actions -====================================== - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/M_migration.rst b/content/developer/tutorials/getting_started/M_migration.rst deleted file mode 100644 index 7379d49e3..000000000 --- a/content/developer/tutorials/getting_started/M_migration.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/M_migration: - -====================== -Advanced M: Migrations -====================== - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/N_security.rst b/content/developer/tutorials/getting_started/N_security.rst deleted file mode 100644 index 873db4a88..000000000 --- a/content/developer/tutorials/getting_started/N_security.rst +++ /dev/null @@ -1,27 +0,0 @@ -.. _tutorials/getting_started/N_security: - -==================== -Advanced N: Security -==================== - -Every day we hear about data leaks and attacks in the newspapers. -We expect you to be aware and careful about how to avoid security breaches in your future -developments. - -You already defined new models in your training. Did you check the access rights and define record -rules on it ? Are you sure your module is not an open door to SQL injections ? Did you use getattr -or t-raw in your code? - -- No or wrong access rules on models. -- Introduction of public methods that should actually be private. -- Wrong manipulation of access tokens. -- No or wrong `ir.rules` (restriction rules) on models. -- Introduction of SQL injections. -- etc. - -Please check this `presentation from Olivier Dony (odo) -`_ about -common mistakes that you should **absolutely** avoid in your future developments. -Also, please always use this `security checklist -`_ -to double-check your development and avoid further embarrassing issues. diff --git a/content/developer/tutorials/getting_started/O_perf.rst b/content/developer/tutorials/getting_started/O_perf.rst deleted file mode 100644 index a5a50665f..000000000 --- a/content/developer/tutorials/getting_started/O_perf.rst +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _tutorials/getting_started/O_perf: - -======================== -Advanced O: Performances -======================== - -Hopefully, this topic will be written soon :-) diff --git a/content/developer/tutorials/getting_started/D_mixins.rst b/content/developer/tutorials/mixins.rst similarity index 77% rename from content/developer/tutorials/getting_started/D_mixins.rst rename to content/developer/tutorials/mixins.rst index 9e9f52c9c..81c95bf2b 100644 --- a/content/developer/tutorials/getting_started/D_mixins.rst +++ b/content/developer/tutorials/mixins.rst @@ -1,11 +1,9 @@ -.. _tutorials/getting_started/D_mixins: - -================== -Advanced D: Mixins -================== +====================== +Reuse code with mixins +====================== If you need to interface with common Odoo features such as the chatter, you can rely on -:doc:`mixins <../../reference/backend/mixins>`. +:doc:`mixins <../reference/backend/mixins>`. They are Odoo models exposing useful methods through inheritance. To learn and play with mixins, visit `this repository `_. diff --git a/content/developer/tutorials/getting_started/J_reports.rst b/content/developer/tutorials/pdf_reports.rst similarity index 91% rename from content/developer/tutorials/getting_started/J_reports.rst rename to content/developer/tutorials/pdf_reports.rst index f99abb2d4..acdeea0d6 100644 --- a/content/developer/tutorials/getting_started/J_reports.rst +++ b/content/developer/tutorials/pdf_reports.rst @@ -1,22 +1,16 @@ -.. _tutorials/getting_started/J_reports: +================= +Build PDF Reports +================= -======================= -Advanced J: PDF Reports -======================= - -.. warning:: - - This tutorial assumes you have completed the :ref:`Core Training ` - and have installed :ref:`wkhtmltopdf `. - - To follow the exercise, it is recommended that you fetch the branch {BRANCH}-core from the - `technical training solutions - `_ repository. It - contains a version of the module created during the core training we can use as a starting - point. +.. important:: + This tutorial is an extension of the :doc:`getting_started` 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 + `_ repository if you + want to start from a clean base. We were previously :ref:`introduced to QWeb ` -in the Core Training where it was used to build a kanban view. Now we will expand on one of QWeb's +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 information in an organized template to support the business in different ways. Odoo @@ -58,8 +52,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 `. For now you can think of them -as customized views that use direct SQL queries (sometimes referred to as SQL Views). +the :doc:`dashboards` tutorial. 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 @@ -73,7 +67,7 @@ Basic Report **Goal**: at the end of this section, we will can print a report that displays all offers for a property. - .. image:: J_reports/simple_report.png + .. image:: pdf_reports/simple_report.png :align: center :alt: Simple PDF report @@ -93,8 +87,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:`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). +* Complete the :doc:`define_module_data` tutorial (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 `_ @@ -196,7 +190,7 @@ that only make sense under specific conditions. For example, if we wanted to mak 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 +.. image:: pdf_reports/print_menu.png :align: center :alt: Print Menu Button @@ -230,7 +224,7 @@ Sub-templates **Goal**: at the end of this section, we will have a sub-template that we use in 2 reports. - .. image:: J_reports/report_subtemplate.png + .. image:: pdf_reports/report_subtemplate.png :align: center :alt: Report using a subtemplate @@ -266,7 +260,7 @@ Report Inheritance **Goal**: at the end of this section, we will inherit the property report in the ``estate_account`` module. - .. image:: J_reports/inherited_report.png + .. image:: pdf_reports/inherited_report.png :align: center :alt: An inherited report diff --git a/content/developer/tutorials/getting_started/J_reports/inherited_report.png b/content/developer/tutorials/pdf_reports/inherited_report.png similarity index 100% rename from content/developer/tutorials/getting_started/J_reports/inherited_report.png rename to content/developer/tutorials/pdf_reports/inherited_report.png diff --git a/content/developer/tutorials/getting_started/J_reports/print_menu.png b/content/developer/tutorials/pdf_reports/print_menu.png similarity index 100% rename from content/developer/tutorials/getting_started/J_reports/print_menu.png rename to content/developer/tutorials/pdf_reports/print_menu.png diff --git a/content/developer/tutorials/getting_started/J_reports/report_subtemplate.png b/content/developer/tutorials/pdf_reports/report_subtemplate.png similarity index 100% rename from content/developer/tutorials/getting_started/J_reports/report_subtemplate.png rename to content/developer/tutorials/pdf_reports/report_subtemplate.png diff --git a/content/developer/tutorials/getting_started/J_reports/simple_report.png b/content/developer/tutorials/pdf_reports/simple_report.png similarity index 100% rename from content/developer/tutorials/getting_started/J_reports/simple_report.png rename to content/developer/tutorials/pdf_reports/simple_report.png diff --git a/content/developer/tutorials/getting_started/B_acl_irrules.rst b/content/developer/tutorials/restrict_data_access.rst similarity index 95% rename from content/developer/tutorials/getting_started/B_acl_irrules.rst rename to content/developer/tutorials/restrict_data_access.rst index 1bf0d124a..414f61b17 100644 --- a/content/developer/tutorials/getting_started/B_acl_irrules.rst +++ b/content/developer/tutorials/restrict_data_access.rst @@ -1,20 +1,13 @@ -.. _tutorials/getting_started/B_acl_irrules: +======================= +Restrict access to data +======================= -================================ -Advanced B: ACL and Record Rules -================================ - -ACL stands for "Access Control List" - -.. warning:: - - This tutorial assumes you have completed the :ref:`Core Training `. - - To follow the exercise, it is recommended that you fetch the branch - {BRANCH}-core from the `technical training solutions - `_ repository. It - contains a version of the module created during the core training we can use as a starting - point. +.. important:: + This tutorial is an extension of the :doc:`getting_started` 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 + `_ repository if you + want to start from a clean base. So far we have mostly concerned ourselves with implementing useful features. However in most business scenarios *security* quickly becomes a concern: @@ -85,8 +78,8 @@ This baseline seems sufficient for us: which are not specifically under the care of any agent. 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 -`, defined in one of the module's data files. +the ``res.groups`` model. They are normally part of a module's :doc:`master data +`, defined in one of the module's data files. As simple example `can be found here `_. @@ -120,7 +113,7 @@ As simple example `can be found here Manage Users` and open the ``admin`` user ("Mitchell Admin"), you should see a new section: - .. figure:: B_acl_irrules/groups.png + .. figure:: restrict_data_access/groups.png Set the admin user to be a *Real Estate manager*. @@ -133,7 +126,7 @@ As simple example `can be found here `, things might just not be + operations remotely using RPC <../api/external_api>`, things might just not be visible in the web interface in some contexts. * *Security* features mean a user can not access records, fields or operations. diff --git a/content/developer/tutorials/getting_started/B_acl_irrules/agent.png b/content/developer/tutorials/restrict_data_access/agent.png similarity index 100% rename from content/developer/tutorials/getting_started/B_acl_irrules/agent.png rename to content/developer/tutorials/restrict_data_access/agent.png diff --git a/content/developer/tutorials/getting_started/B_acl_irrules/error.png b/content/developer/tutorials/restrict_data_access/error.png similarity index 100% rename from content/developer/tutorials/getting_started/B_acl_irrules/error.png rename to content/developer/tutorials/restrict_data_access/error.png diff --git a/content/developer/tutorials/getting_started/B_acl_irrules/groups.png b/content/developer/tutorials/restrict_data_access/groups.png similarity index 100% rename from content/developer/tutorials/getting_started/B_acl_irrules/groups.png rename to content/developer/tutorials/restrict_data_access/groups.png diff --git a/content/developer/tutorials/getting_started/E_unittest.rst b/content/developer/tutorials/unit_tests.rst similarity index 96% rename from content/developer/tutorials/getting_started/E_unittest.rst rename to content/developer/tutorials/unit_tests.rst index f550c6ab5..19969e83f 100644 --- a/content/developer/tutorials/getting_started/E_unittest.rst +++ b/content/developer/tutorials/unit_tests.rst @@ -1,14 +1,13 @@ -.. _tutorials/getting_started/E_unittest: +=================================== +Safeguard your code with unit tests +=================================== -============================= -Advanced E: Python Unit Tests -============================= - -.. tip:: This tutorial assumes you followed the Core Training. - - To do the exercise, fetch the branch {BRANCH}-core from the `technical training solutions - `_ repository. It - contains a basic module we will use as a starting point +.. important:: + This tutorial is an extension of the :doc:`getting_started` 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 + `_ repository if you + want to start from a clean base. **Reference**: `Odoo's Test Framework: Learn Best Practices `__ diff --git a/redirects/14.0.txt b/redirects/14.0.txt index 5b70b6d14..ab96c3353 100644 --- a/redirects/14.0.txt +++ b/redirects/14.0.txt @@ -55,11 +55,11 @@ developer/howtos/rdtraining/13_inheritance.rst developer/tutorials/getting_start developer/howtos/rdtraining/14_other_module.rst developer/tutorials/getting_started/14_other_module.rst # reorganize the developer doc developer/howtos/rdtraining/15_qwebintro.rst developer/tutorials/getting_started/15_qwebintro.rst # reorganize the developer doc developer/howtos/rdtraining/16_guidelines_pr.rst developer/tutorials/getting_started/16_guidelines_pr.rst # reorganize the developer doc -developer/howtos/rdtraining/B_acl_irrules.rst developer/tutorials/getting_started/B_acl_irrules.rst # reorganize the developer doc -developer/howtos/rdtraining/C_data.rst developer/tutorials/getting_started/C_data.rst # reorganize the developer doc -developer/howtos/rdtraining/E_unittest.rst developer/tutorials/getting_started/E_unittest.rst # reorganize the developer doc -developer/howtos/rdtraining/J_reports.rst developer/tutorials/getting_started/J_reports.rst # reorganize the developer doc -developer/howtos/rdtraining/K_dashboard.rst developer/tutorials/getting_started/K_dashboard.rst # reorganize the developer doc +developer/howtos/rdtraining/B_acl_irrules.rst developer/tutorials/restrict_data_access.rst # reorganize the developer doc +developer/howtos/rdtraining/C_data.rst developer/tutorials/define_module_data.rst # reorganize the developer doc +developer/howtos/rdtraining/E_unittest.rst developer/tutorials/unit_tests.rst # reorganize the developer doc +developer/howtos/rdtraining/J_reports.rst developer/tutorials/pdf_reports.rst # reorganize the developer doc +developer/howtos/rdtraining/K_dashboard.rst developer/tutorials/dashboards.rst # reorganize the developer doc # developer/misc diff --git a/redirects/15.0.txt b/redirects/15.0.txt index acbc74e8d..96ad01b5c 100644 --- a/redirects/15.0.txt +++ b/redirects/15.0.txt @@ -40,8 +40,8 @@ applications/sales/crm/optimize/outlook_extension.rst applications/productivity/ # developer/howtos -developer/howtos/rdtraining/D_mixins.rst developer/tutorials/getting_started/D_mixins.rst # reorganize the developer doc -developer/howtos/rdtraining/N_security.rst developer/tutorials/getting_started/N_security.rst # reorganize the developer doc +developer/howtos/rdtraining/D_mixins.rst developer/tutorials/mixins.rst # reorganize the developer doc +developer/howtos/rdtraining/N_security.rst developer/tutorials/security.rst # reorganize the developer doc # developer/misc