From a8deaf95942c170484ee786c5a0c1bdd3da6e2d2 Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Thu, 30 Mar 2023 13:20:29 +0000 Subject: [PATCH] [IMP] tutorials: add warning about mutable global variables The whole concept of multi-tenancy is not really approached within the tutorial. This commit adds a warning about never using mutable global variables within odoo to seed the idea in the reader's mind. task-3059110 closes odoo/documentation#3990 X-original-commit: 1ce7166f496cbdbf36fbb1956d0e02f63c1f1d24 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Benoit Socias (bso) --- .../developer/tutorials/getting_started/04_basicmodel.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/developer/tutorials/getting_started/04_basicmodel.rst b/content/developer/tutorials/getting_started/04_basicmodel.rst index fab955b77..f6cd7079a 100644 --- a/content/developer/tutorials/getting_started/04_basicmodel.rst +++ b/content/developer/tutorials/getting_started/04_basicmodel.rst @@ -13,6 +13,14 @@ tools to facilitate database interactions. Before moving forward in the exercise, make sure the ``estate`` module is installed, i.e. it must appear as 'Installed' in the Apps list. +.. warning:: + + Do not use mutable global variables. + + A single Odoo instance can run several databases in parallel within the same python process. + Distinct modules might be installed on each of these databases, therefore we cannot rely on + global variables that would be updated depending on installed modules. + Object-Relational Mapping =========================