Wednesday, February 1, 2023
2 changes · master
Enhancements to existing features
Odoo now reuses the same internal working environment during system startup and module setup instead of recreating it repeatedly. This reduces duplicated code for developers and helps make module installation and maintenance logic more consistent, with a related fix ensuring some localization translation-loading steps are actually run.
Original PR description
The goal of this revision is to re-use the environment among the
different steps of the registry loading,
instead of creating a new environment for each step.
1. Simply To avoid to repeat the line
`env = api.Environment(cr, SUPERUSER_ID, {})`
multiple times in the code
2. This also allows to share the context among the different
steps. This is not yet used in this revision, but it could
be, for instance to avoid the current repetition to add the keys
`install_module`, in `convert_csv_import` and `xml_import._tag_record`This update streamlines how Odoo prepares and installs apps by reusing the same working context during registry loading. It mainly reduces duplicated internal code and makes future maintenance easier, with no expected change to day-to-day user workflows.
Original PR description
The goal of this revision is to re-use the environment among the
different steps of the registry loading,
instead of creating a new environment for each step.
1. Simply To avoid to repeat the line
`env = api.Environment(cr, SUPERUSER_ID, {})`
multiple times in the code
2. This also allows to share the context among the different
steps. This is not yet used in this revision, but it could
be, for instance to avoid the current repetition to add the keys
`install_module`, in `convert_csv_import` and `xml_import._tag_record`