Skip to content

Commit af09123

Browse files
committed
[FIX] Upgrade documentation: Code review changes
1 parent 52f4ca5 commit af09123

File tree

3 files changed

+53
-59
lines changed

3 files changed

+53
-59
lines changed

content/developer/howtos.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ How-to guides
8686

8787
Learn how to enable a module to detect and communicate with an IoT device.
8888

89-
.. card:: Upgrading a customized database
89+
.. card:: Upgrade a customized database
9090
:target: howtos/upgrade_custom_db
9191

92-
Learn how to upgrade a customized database, as well as the code and data of its custom modules.
92+
Learn how to upgrade a customized database, as well as the code and data of its custom modules.

content/developer/howtos/upgrade_custom_db.rst

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
:show-content:
2-
3-
.. _upgrade_custom/upgrade_custom_db:
4-
5-
===============================
6-
Upgrading a customized database
7-
===============================
1+
=============================
2+
Upgrade a customized database
3+
=============================
84

95
Upgrading to a new version of Odoo can be challenging, especially if the database you work on
106
contains custom modules. This page intent is to explain the technical process of upgrading a
117
database with customized modules. For a standard overview, please refer to the
128
:doc:`Upgrade documentation </administration/upgrade>`.
139

1410
We consider a custom module, any module that extends the standard code of Odoo and that was not
15-
built with the Studio app.
16-
Before upgrading those modules, or before asking for them to be upgraded, have a look at the
17-
:ref:`upgrade/sla` to make sure who's responsible for it.
11+
built with the Studio app. Before upgrading such a module, or before requesting its upgrade, have a
12+
look at the :ref:`upgrade/sla` to make sure who's responsible for it.
1813

1914
While working on what we refer to as the **custom upgrade** of your database, keep in mind the goals
2015
of an upgrade:
@@ -25,9 +20,9 @@ of an upgrade:
2520
#. Reduce the technical debt
2621
#. Benefit from security improvements
2722

28-
With every new version of Odoo, changes are introduced. These changes can have an impact modules on
29-
which customization have been developed. This is the reason why upgrading a database that contains
30-
custom modules requires additional steps in order to upgrade their source code.
23+
With every new version of Odoo, changes are introduced. These changes can impact modules on which
24+
customization have been developed. This is the reason why upgrading a database that contains custom
25+
modules requires additional steps in order to upgrade the source code.
3126

3227
These are the steps to follow to upgrade customized databases:
3328

@@ -44,16 +39,16 @@ These are the steps to follow to upgrade customized databases:
4439
Stop the developments
4540
=====================
4641

47-
Starting an upgrade requires commitment and development resources need to be allocated to it. If
48-
developments keep being made at the same time, those features will need to be re-upgraded and tested
49-
everytime you change them. This is why we recommend a complete freeze of the codebase when starting
50-
the upgrade process. Needless to say, bug fixing is exempt from this recommendation.
42+
Starting an upgrade requires commitment and development resources. If developments keep being made
43+
at the same time, those features will need to be re-upgraded and tested every time you change them.
44+
This is why we recommend a complete freeze of the codebase when starting the upgrade process.
45+
Needless to say, bug fixing is exempt from this recommendation.
5146

5247
Once you have stopped development, it is a good practice to assess the developments made and compare
5348
them with the features introduced between your current version and the version you are targeting.
54-
Challenge the developments as much as possible, find functionnal workarounds.
55-
Removing redundancy between your developments and the standard version of Odoo will lead to an eased
56-
upgrade process and reduce the technical debt.
49+
Challenge the developments as much as possible and find functional workarounds. Removing redundancy
50+
between your developments and the standard version of Odoo will lead to an eased
51+
upgrade process and reduce technical debt.
5752

5853
.. note::
5954
You can find information on the changes between versions in the `Release Notes
@@ -74,7 +69,7 @@ The purpose of this stage is not to start working with the custom modules in the
7469
but to make sure the standard upgrade process works seamlessly, and the test database is delivered
7570
properly. If that's not the case, and the upgrade request fails, request the assistance of Odoo via
7671
the `support page <https://odoo.com/help?stage=migration>`_ by selecting the option related to
77-
testing the upgrade.
72+
testing the upgrade.
7873

7974

8075
.. _upgrade_custom/empty_database:
@@ -83,22 +78,21 @@ Empty database
8378
==============
8479

8580
Before working on an upgraded test database, we recommend to make the custom developments work on an
86-
empty database in the targeted version of your upgrade.
87-
This ensures that the customization is compatible with the new version of Odoo, allows to analyse
88-
how does it behave and interact with the new features, and guarantees that they will not cause any
89-
issue when upgrading the database.
81+
empty database in the targeted version of your upgrade. This ensures that the customization is
82+
compatible with the new version of Odoo, allows to analyze how it behaves and interacts with the new
83+
features, and guarantees that they will not cause any issues when upgrading the database.
9084

91-
Making the custom modules work in an empty database also helps avoiding changes and wrong
92-
configurations that might be present on the production database (like studio customization,
85+
Making the custom modules work in an empty database also helps avoid changes and wrong
86+
configurations that might be present in the production database (like studio customization,
9387
customized website pages, email templates or translations). They are not intrinsically related to
9488
the custom modules and that can raise unwanted issues in this stage of the upgraded process.
9589

9690
To make custom modules work on an empty database we advise to follow these steps:
9791

98-
- :ref:`upgrade_custom/empty_database/modules_installable`
99-
- :ref:`upgrade_custom/empty_database/test_fixes`
100-
- :ref:`upgrade_custom/empty_database/clean_code`
101-
- :ref:`Make standard tests run successfully <upgrade_custom/empty_database/standard_test>`
92+
#. :ref:`upgrade_custom/empty_database/modules_installable`
93+
#. :ref:`upgrade_custom/empty_database/test_fixes`
94+
#. :ref:`upgrade_custom/empty_database/clean_code`
95+
#. :ref:`Make standard tests run successfully <upgrade_custom/empty_database/standard_test>`
10296

10397
.. _upgrade_custom/empty_database/modules_installable:
10498

@@ -131,9 +125,9 @@ customization to make sure everything is working as expected.
131125

132126
This process will help detect further issues that are not identified during the module installation
133127
and can only be detected in runtime. For example, deprecated calls to standard python or OWL
134-
functions, non existing references to standard fields, etc.
128+
functions, non-existing references to standard fields, etc.
135129

136-
We recommend to test all the customization, specially the following elements:
130+
We recommend to test all the customization, especially the following elements:
137131

138132
- Views
139133
- Email templates
@@ -153,7 +147,7 @@ Clean the code
153147
--------------
154148

155149
At this stage of the upgrade process, we also suggest to clean the code as much as possible.
156-
This includes:
150+
This includes:
157151

158152
- Remove redundant and unnecessary code.
159153
- Remove features that are now part of Odoo standard, as described in
@@ -167,7 +161,7 @@ Standard tests
167161
--------------
168162

169163
Once the previous steps are completed, we advise to make sure all standard tests associated to the
170-
dependencies of the custom module pass.
164+
dependencies of the custom module pass.
171165
Standard tests ensure the validation of the code logic and prevent data corruption.
172166
They will help you identify bugs or unwanted behavior before you work on your database.
173167

@@ -199,16 +193,17 @@ Migrate the data
199193
During the upgrade of the custom modules, you might have to use migration scripts to reflect changes
200194
from the source code to their corresponding data.
201195

202-
- Any technical data that was renamed during the upgrade of the custom code (models, fields, external
203-
identifiers) should be renamed using migration scripts to avoid data loss during the module upgrade.
196+
- Any technical data that was renamed during the upgrade of the custom code (models, fields,
197+
external identifiers) should be renamed using migration scripts to avoid data loss during the
198+
module upgrade.
204199
- Data from standard models removed from the source code of the newer Odoo version and from the
205200
database during the standard upgrade process might need to be recovered from the old model table
206-
if it is stil present.
201+
if it is still present.
207202

208203
Migration scripts can also be used to:
209204

210205
- Ease the processing time of an upgrade. For example, to store the value of computed stored fields
211-
on models with an excesive amount of records by using SQL queries.
206+
on models with an excessive number of records by using SQL queries.
212207
- Recompute fields in case the computation of their value has changed.
213208
- Uninstall unwanted custom modules.
214209
- Correct faulty data or wrong configurations.
@@ -220,13 +215,13 @@ Test the custom modules
220215

221216
To make sure the custom modules work properly with your data in the upgraded database, they need to
222217
be tested as well. This helps ensure both the standard and the custom data stored in the database
223-
are consistent and nothing was lost during the upgrade process.
218+
are consistent and that nothing was lost during the upgrade process.
224219

225220
Things to pay attention to:
226221

227-
- Views not working: During the upgrade, if a view causes issues because of it's content, it gets
228-
disabled. You can find the information of disabled views on the :ref:`Upgraded report
229-
<upgrade/upgrade_report>`. This views need to be activated again. To achieve this, we recommend
222+
- Views not working: During the upgrade, if a view causes issues because of its content, it gets
223+
disabled. You can find the information on disabled views on the :ref:`Upgrade report
224+
<upgrade/upgrade_report>`. This view needs to be activated again. To achieve this, we recommend
230225
the use of migration scripts.
231226
- :doc:`Module data <../tutorials/define_module_data>` not updated: Custom records that have the
232227
``noupdate`` flag are not updated when upgrading the module in the new database. For the custom
@@ -240,23 +235,23 @@ Testing and rehearsal
240235
=====================
241236

242237
When the custom modules are working properly in the upgraded database, it is crucial to do another
243-
round of testing to assess the database usability and detect any issue that might have gone
244-
unnoticed in previous tests. For further information about testing the upgraded database, check
238+
round of testing to assess the database usability and detect any issues that might have gone
239+
unnoticed in previous tests. For further information about testing the upgraded database, check
245240
:ref:`upgrade/test_your_db`.
246241

247242
As mentioned in :ref:`upgrade/upgrade-prod`, both standard upgrade scripts and your database are
248243
constantly evolving. Therefore it is highly recommended to frequently request new upgraded test
249244
databases and ensure that the upgrade process is still successful.
250245

251-
In adition to that, make a full rehearsal of the upgrade process the day before upgrading the
252-
production database to avoid an undesired behavior during the upgrade and to detect any issue that
253-
might have ocurred with the migrated data.
246+
In addition to that, make a full rehearsal of the upgrade process the day before upgrading the
247+
production database to avoid undesired behavior during the upgrade and to detect any issue that
248+
might have occurred with the migrated data.
254249

255250

256251
.. _upgrade_custom/production:
257252

258253
Production upgrade
259254
==================
260255

261-
Once you are confident about upgrading your production database, follow the process described on
256+
Once you are confident about upgrading your production database, follow the process described on
262257
:ref:`upgrade/upgrade-prod`, depending on the hosting type of your database.

content/developer/reference/cli.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -676,12 +676,7 @@ interaction with the :ref:`orm <reference/orm>` and its functionalities.
676676
677677
$ odoo-bin shell
678678
679-
.. option:: --shell-interface (ipython|ptpython|bpython|python)
680-
681-
Specify a preferred REPL to use in shell mode. This shell is started with the `env` variable
682-
already initialized to be able to access the ORM and other Odoo modules.
683-
684-
.. example:: Example of shell usage
679+
.. example::
685680

686681
Adding an exclamation mark to all contacts' names:
687682

@@ -702,8 +697,13 @@ interaction with the :ref:`orm <reference/orm>` and its functionalities.
702697
By default, the shell is running in transaction mode. This means that any change made to the
703698
database is rolled back when exiting the shell. To commit changes, use `env.cr.commit()`.
704699

700+
.. option:: --shell-interface (ipython|ptpython|bpython|python)
701+
702+
Specify a preferred REPL to use in shell mode. This shell is started with the `env` variable
703+
already initialized to be able to access the ORM and other Odoo modules.
704+
705705
.. seealso::
706-
:ref:`Environment documentation <reference/orm/environment>`
706+
:ref:`reference/orm/environment`
707707

708708
.. _reference/cmdline/scaffold:
709709

@@ -944,4 +944,3 @@ containing community and enterprise.
944944
.. code-block:: console
945945
946946
$ community/odoo-bin tsconfig --addons-path community/addons,community/odoo/addons,enterprise > tsconfig.json
947-

0 commit comments

Comments
 (0)