Tuesday, October 8, 2024
4 changes · master
Enhancements to existing features
This update reorganizes how Odoo applies small compatibility adjustments to third-party libraries, making them easier to identify and troubleshoot. It reduces the risk of inconsistent behavior across modules by ensuring these adjusted libraries are loaded consistently wherever they are used.
Original PR description
Monkeypatching is not a good practice, but it's in some cases necessary. This is especiallly true when relying on third party modules. Reasons may vary: - to adjust for compatibility between versions…
Monkeypatching is not a good practice, but it's in some cases necessary.
This is especiallly true when relying on third party modules.
Reasons may vary:
- to adjust for compatibility between versions
- to fix a small detail without reworking the external module.
In Odoo, there are several places in which monkeypatching is done.
This PR aims to put most of the monkeypatching together and to make clear at a glance which external modules are subject to it, and how.
Until now, the modules present here are of broad interest, and may belong to the `base` module.
There are cases in which a single Odoo module will require a third-party monkeypatched module that will get installed as `external_dependencies` in the `__manifest__.py` file.
We can leave the monkeypatching in that module, but we suggest using the `register` function here to make it at least visible at runtime, so that from the Odoo shell we can query them for troubleshooting:
```py
>>> from odoo.tools.monkeypatch import monkeypatches
>>> from pprint import pprint
>>> pprint(monkeypatches)
{'OpenSSL': <function monkeypatch_OpenSSL at 0x7fd7d8db3b50>,
'PyPDF2': <function monkeypatch_PyPDF2 at 0x7fd7d8db3be0>,
'xlsx': <function monkeypatch_xlsx at 0x7fd7d8db3c70>,
'xlsxwriter': <function monkeypatch_xlsxwriter at 0x7fd7d8db3d00>,
'xlwt': <function monkeypatch_xlwt at 0x7fd7d8db3d90>,
'xmlrpc': <function monkeypatch_xmlrpc at 0x7fd7d8db3e20>}
```
All the monkeypatching will be done so that import <module> will already load the monkeypatched module.
Modules will have a new `<module>.__is_monkeypatched__` attribute set to True.
This will remove the need to import from odoo.tools.misc.<module> and also ensure that people not aware of the monkeypatching use the wrong version.
Community PR: https://github.com/odoo/odoo/pull/98996This update improves compatibility with newer OpenSSL and PyOpenSSL versions used for secure certificate handling. It helps electronic invoicing and related localization services continue working reliably across supported environments.
Original PR description
The OpenSSL API X509_get_notBefore got renamed to X509_getm_notBefore in OpenSSL v.1.0.0a. PyOpenSSL v19.0.0 calls the old name, PyOpenSSL v20.0.0 calls the new one. The related community PR also contains a small refactor of the _monkeypatches.py to allow simple import and creation of possible new monkeypatches and to put order onto the ones that are already in odoo.tools.misc Community PR: https://github.com/odoo/odoo/pull/95524
The Approvals app is easier to use with keyboards and screen readers. Menus, report printing, view buttons, selection states, and page landmarks now provide clearer accessibility cues, helping more users navigate the app confidently.
Original PR description
Improved accessibility for keyboard navigation and screen readers
- Added aria-labels:
- 'Actions menu' to action menu cog item
- Dynamic aria-label 'Print report: {report_name}' to print menu entry
- {view_name view} to view mode buttons
- Converted state_selection to use CheckBoxItem instead of DropdownItem:
- Improves audio narration to announce checked items properly.
- Updated main container landmarks:
- Used `<main>` node instead of `<div>` in views layout.
Task: 3603393
community:-https://github.com/odoo/odoo/pull/168878The Knowledge app now loads some interface parts only when they are needed. This should reduce initial loading work and make Knowledge feel faster, especially for users opening pages with complex views or navigation.
Original PR description
locs (js, xml, scss): ... Total lazy loaded locs: ? Task ID: `3546321`