-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] Allow addons to fully support multiple Odoo versions
In order to make possible to implement a different workflow on downstream addon maintenance teams, as explained in OCA/maintainer-tools#334, Odoo needs to support version-specific code. This can be currently done in Python by checking `odoo.release.version_info` and in JS by using the `/web/webclient/version_info` controller. However, when dealing with data files, we were out of luck. With this patch: - A new cached helper is found in JS sessions, that lazy-caches version info once per session, which will make version-specific assertions a pleasure in JS. - A new attribute `versions` is supported in `<odoo>`, `<openerp>` and `<data>` elements within XML data files, that allows the programmer to specify a version spec that makes that data section be omitted when Odoo version doesn't match it. - A new `overrides` key is supported in the `__manifest__.py` file, which has the form of a dict, where keys are version specs, and values are dicts that will directly override the addon base manifest. So, for instance, to declare an addon to be available only until version 13.0 of Odoo, put this in the manifest: ```python { ... "installable": False, "overrides": { ":13": { "installable": True, } } } ```
- Loading branch information
Showing
5 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters