Daily updates from Odoo
Navigate
Branch
Friday, June 29, 2018
2 changes
Enhancements to existing features
This change lets addon maintainers tailor addon behavior for different Odoo versions from one codebase. It adds version-aware handling for data files, manifests, and web session checks, reducing maintenance work for teams supporting multiple Odoo releases.
Original PR description
Sorry, I had this floating on my mind and couldn't wait anymore to publish it :sweat_smile:. This is just a WIP for now, so you can have an example implementation, and if it gets approved, I can…
Sorry, I had this floating on my mind and couldn't wait anymore to publish it :sweat_smile:. This is just a WIP for now, so you can have an example implementation, and if it gets approved, I can start working with tests and docs.
In order to make possible to implement a different workflow on downstream addon maintenance teams, as explained in https://github.com/OCA/maintainer-tools/issues/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,
}
}
}
```
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
@Tecnativa @sbidoul @mart-e @tde-banana-odoo @jbeficentResolved issues and error corrections
This update fixes several issues that could interrupt users while editing invoices and list-style records, including crashes when adding invoice lines or reordering items with optional fields. It also improves how new items are placed in ordered lists and clarifies related developer documentation.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr