Tuesday, October 8, 2024
22 changes · master
New functionality added to Odoo
This draft proof of concept adds support for setting a default grouping in Gantt timeline views. It could help users open planning screens with the most relevant organization already applied, reducing manual setup when reviewing schedules.
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/98996Resolved issues and error corrections
Odoo Studio and related apps now avoid creating outdated view rules when customizing screens. This helps keep customizations compatible with current platform standards and reduces the risk of future display or upgrade issues.
Code cleanup and technical improvements
This change renames several internal JavaScript models so their names align with related server-side names. It helps keep the codebase clearer and easier to maintain, with no expected change to day-to-day user workflows.
Original PR description
Enterprise counter-part. Part of task-3605717 https://github.com/odoo/odoo/pull/182364
Miscellaneous changes
…ing by SO in portal When grouping by SO in the helpdesk ticket portal list view, the group headers were invisible. That was cause by changing the groupby options from ``sale_line_id`` to ``sale_order_id`` without changing the condition in the template that would draw the group headers. In this commit we change the condition to ``groupby == 'sale_order_id``. task-4213896 Forward-Port-Of: odoo/enterprise#70890
Original PR description
…ing by SO in portal When grouping by SO in the helpdesk ticket portal list view, the group headers were invisible. That was cause by changing the groupby options from ``sale_line_id`` to ``sale_order_id`` without changing the condition in the template that would draw the group headers. In this commit we change the condition to ``groupby == 'sale_order_id``. task-4213896 Forward-Port-Of: odoo/enterprise#70890
This 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`
Original PR description
*= account_asset, account_consolidation, account_disallowed_expenses_fleet, account_reports_cash_basis, appointment, documents, helpdesk, l10n_ph_reports, planning, whatsapp This PR consist of two commits: 32c4dc22980c2b723e68a68e417afe3efaebe6a6 - This commit will prevent using deprecated xpath. f01b2e58841fe247d44102055413bbbcea2586e2 - This commit will change studio xpath api such that it no longer generates custom views using deprecated xpath. Specifications: `contains(@class...` => `hasclass(...` Community PR: https://github.com/odoo/odoo/pull/174139 Task - 3820162
This update simplifies how Odoo determines its internal root path by treating it as a runtime value rather than a configurable option. It supports a broader technical cleanup and should not change how users work with the system.
Original PR description
This commit is part of a larger refactor, see associated PR. While `root_path` was defined as an option, in reality it cannot be set nor via the CLI, nor via the config file. Its value is fully defined at runtime and isn't modified anywhere. Companion of https://github.com/odoo/odoo/pull/126099
If an Amazon order has more than one item it was creating for each item an own shipping line even if it had not even a shipping price defined per item line. Info: @wt-io-it Forward-Port-Of: odoo/enterprise#70940
Original PR description
If an Amazon order has more than one item it was creating for each item an own shipping line even if it had not even a shipping price defined per item line. Info: @wt-io-it Forward-Port-Of: odoo/enterprise#70940
Before this PR: - When a partner had no invoices to report but was still included in the data with an empty VAT list (e.g., 'partner_vat': []), this caused a JSON schema error when submitting the data to the government portal. Issue: - The government schema does not accept empty key-value pairs for partner VATs, resulting in submission failures. After this PR: - The key-value pair for partner VAT is only included if there are valid invoice entries associated with the partner. This preve
Original PR description
Before this PR: - When a partner had no invoices to report but was still included in the data with an empty VAT list (e.g., 'partner_vat': []), this caused a JSON schema error when submitting the data to the government portal. Issue: - The government schema does not accept empty key-value pairs for partner VATs, resulting in submission failures. After this PR: - The key-value pair for partner VAT is only included if there are valid invoice entries associated with the partner. This prevents empty entries from being added to the JSON payload, avoiding schema errors. Code change: - A condition was added to check if the partner has invoice data before appending the VAT key to the JSON structure. Task ID: 4239740 Forward-Port-Of: odoo/enterprise#71419
Change ----- UX improvement: a "Saved" message is displayed when leaving the template only if it is active, as it can be confusing for the user to not be able to find it (archived records are not visible by default). This happens when uploading a pdf as a document to sign. opw-4207093 Forward-Port-Of: odoo/enterprise#71078
Original PR description
Change ----- UX improvement: a "Saved" message is displayed when leaving the template only if it is active, as it can be confusing for the user to not be able to find it (archived records are not visible by default). This happens when uploading a pdf as a document to sign. opw-4207093 Forward-Port-Of: odoo/enterprise#71078
[IMP] l10n_mx_edi: Remove support of round_per_line Now the round globally is fully working and since we enforced the round_globally in Mexico, let's force all Mexican users to use the round globally. [FIX] l10n_mx_edi: Fix global invoice taxes aggregator with round globally When the global invoice is made on multiple invoices, aggregating rounded values lead to rounding issues. That's the case for "Subtotal" in the test case added in this commit: Suppose 5 invoices having a singl
Original PR description
[IMP] l10n_mx_edi: Remove support of round_per_line Now the round globally is fully working and since we enforced the round_globally in Mexico, let's force all Mexican users to use the round…
[IMP] l10n_mx_edi: Remove support of round_per_line Now the round globally is fully working and since we enforced the round_globally in Mexico, let's force all Mexican users to use the round globally. [FIX] l10n_mx_edi: Fix global invoice taxes aggregator with round globally When the global invoice is made on multiple invoices, aggregating rounded values lead to rounding issues. That's the case for "Subtotal" in the test case added in this commit: Suppose 5 invoices having a single invoice line with 16% price included tax. The unit price are: 2803.0, 1842.0, 2798.0, 3225.0, 3371.0. 2803 + 1842 + 2798 + 3225 + 3371 = 14039 14039 / 1.16 = 12102.586206897 ≃ 12102.59 Before this commit, when aggregating each 'Subtotal' of CFDI file, one per invoice: 2416.38 + 1587.93 + 2412.07 + 2780.17 + 2906.03 = 12102.58 [IMP] l10n_mx_edi: Cleanup dead code When introducing the dispatching on the negative lines long time ago, we added a config parameter to disable it. Now, it doesn't make any sense to disable it and the config parameter is gone so the method always returns True. Let's remove it. Forward-Port-Of: odoo/enterprise#71370
Currently, even tough the quick_create view are defined in the code base, and defines on the kanban view, the quick create view is not used. Step to reproduce: - Install helpdesk - Open helpdesk app - Open the 'all tickets' or the 'My tickets' view - Select the kanban view - Click on the 'new' button A ticket view form is opened. Expected behavior : the quick create view form should be open in the kanban view. Source of the issue: the 'on_create' attribute is missing in the kanba
Original PR description
Currently, even tough the quick_create view are defined in the code base, and defines on the kanban view, the quick create view is not used. Step to reproduce: - Install helpdesk - Open helpdesk app - Open the 'all tickets' or the 'My tickets' view - Select the kanban view - Click on the 'new' button A ticket view form is opened. Expected behavior : the quick create view form should be open in the kanban view. Source of the issue: the 'on_create' attribute is missing in the kanban definition task - 4047630 version 15.0 - master Forward-Port-Of: odoo/enterprise#71220 Forward-Port-Of: odoo/enterprise#66491
Steps to reproduce: - Create a QP (quantity and pass/fail, also define a failure location) on a product on receipt picking type. - Create a receipt order with any quantity of this product. - Open the picking from the barcode app. - Open the quality wizard. - Fail the check. - From the second wizard, set a partial quantity and a failure location. - Confirm the wizard. - Validate the transfer. Current behavior: Only the passed quantity is added to the stock, and a backorder is created
Original PR description
Steps to reproduce: - Create a QP (quantity and pass/fail, also define a failure location) on a product on receipt picking type. - Create a receipt order with any quantity of this product. - Open the picking from the barcode app. - Open the quality wizard. - Fail the check. - From the second wizard, set a partial quantity and a failure location. - Confirm the wizard. - Validate the transfer. Current behavior: Only the passed quantity is added to the stock, and a backorder is created with the failed quantity. Expected behavior: The whole quantity should be added to the stock with each line moved to its corresponding location. Forward-Port-Of: odoo/enterprise#70629
The vendor dropdown does not close when a extract box is clicked and a creation dialog opens. It would only close after the first click. In this commit the dropdown is closed straight away. Forward-Port-Of: odoo/enterprise#71039
Original PR description
The vendor dropdown does not close when a extract box is clicked and a creation dialog opens. It would only close after the first click. In this commit the dropdown is closed straight away. Forward-Port-Of: odoo/enterprise#71039
This commit adds the possibility in studio to change the default_order attribute on kanban views. Task-3953827 Forward-Port-Of: odoo/enterprise#71356
Original PR description
This commit adds the possibility in studio to change the default_order attribute on kanban views. Task-3953827 Forward-Port-Of: odoo/enterprise#71356
Inside the document folder of a project, create a new folder that is access_internal='view' and access_via_link='none'. Inside that folder create a document that is access_via_link='view'. From the Documents application standpoint, you created a document that cannot be discovered by a public user, unless he get the access-token to that file. But you can access the file via the Project's documents even without the access token, because the conditional `res_id`, `res_model`, `access_vi
Original PR description
Inside the document folder of a project, create a new folder that is access_internal='view' and access_via_link='none'. Inside that folder create a document that is access_via_link='view'. From the…
Inside the document folder of a project, create a new folder that is access_internal='view' and access_via_link='none'. Inside that folder create a document that is access_via_link='view'. From the Documents application standpoint, you created a document that cannot be discovered by a public user, unless he get the access-token to that file. But you can access the file via the Project's documents even without the access token, because the conditional `res_id`, `res_model`, `access_via_link` are met. It means that if you're a logged-in portal user you won't see that file as the `user_permission` is correctly `none`. But you can disconnect, become a public user, and get access to the file. --- An explored solution was to create a dedicated "shared" folder for every project/task, and to place all publicly discoverable files within that folder. Files that should be shared on a link-only manner would be placed elsewhere would not be listed but for the portal users. This solution was rejected because it created too many folders. --- The solution here is to restrict accessing documents to logged-in users, so that the single always-valid `user_permission` field can be used and there's no need to re-engineer something for public users. Forward-Port-Of: odoo/enterprise#70814
Before this commit, auditing a groupby line generated from a custom groupby crashed, because the custom groupby field was assumed to be a field of account.move.line, which it obviously wasn't (that's the very reason custom groupby exist for !). We solve that by calling the domain builder defined for this groupby in order to generate its audit domain. This bug is not reproducible in standard Odoo. Custom groupby on reports were implemented to support the 18.0 refactoring of the Intrastat Re
Original PR description
Before this commit, auditing a groupby line generated from a custom groupby crashed, because the custom groupby field was assumed to be a field of account.move.line, which it obviously wasn't (that's the very reason custom groupby exist for !). We solve that by calling the domain builder defined for this groupby in order to generate its audit domain. This bug is not reproducible in standard Odoo. Custom groupby on reports were implemented to support the 18.0 refactoring of the Intrastat Report, and are at the moment only used there. The Intrastat report does not support audit by clicking the amounts, so it's not subject to the bug. This feature will likely be used more in the future, though. Forward-Port-Of: odoo/enterprise#71102
As the Fixed Establishment is no more an obligation for the government, we remove this information from the xml export of the OSS sales report opw-3981681 Forward-Port-Of: odoo/enterprise#71130 Forward-Port-Of: odoo/enterprise#66876
Original PR description
As the Fixed Establishment is no more an obligation for the government, we remove this information from the xml export of the OSS sales report opw-3981681 Forward-Port-Of: odoo/enterprise#71130 Forward-Port-Of: odoo/enterprise#66876
#### Before this PR: 'Share Availabilities' button was placed out of screen in mobile view. Related Commits - https://github.com/odoo/enterprise/commit/94c376f19b49033eb1c3d8544a6905960ee1ca05, https://github.com/odoo/enterprise/commit/017cf2479044c2ed360917e79eab5f1a0838d6aa #### After this PR: Share button is placed at bottom of screen, like v17.0 Task-4210037 Forward-Port-Of: odoo/enterprise#71163
Original PR description
#### Before this PR: 'Share Availabilities' button was placed out of screen in mobile view. Related Commits - https://github.com/odoo/enterprise/commit/94c376f19b49033eb1c3d8544a6905960ee1ca05, https://github.com/odoo/enterprise/commit/017cf2479044c2ed360917e79eab5f1a0838d6aa #### After this PR: Share button is placed at bottom of screen, like v17.0 Task-4210037 Forward-Port-Of: odoo/enterprise#71163
#### Purpose: The purpose of this task is to add graph view directly from 'Messages' Stat Button. #### Before this PR: When users navigate to 'WhatsApp Messages' from a template's Stat button, only the List View is displayed. Thus, users have to add filters in all 'WhatsApp Messages' to get accurate graph view for a particular template. #### After this PR: Users can access both List and Graph view through 'Messages' stat button. Task-4145998 Forward-Port-Of: odoo/enterprise#69167
Original PR description
#### Purpose: The purpose of this task is to add graph view directly from 'Messages' Stat Button. #### Before this PR: When users navigate to 'WhatsApp Messages' from a template's Stat button, only the List View is displayed. Thus, users have to add filters in all 'WhatsApp Messages' to get accurate graph view for a particular template. #### After this PR: Users can access both List and Graph view through 'Messages' stat button. Task-4145998 Forward-Port-Of: odoo/enterprise#69167