Daily updates from Odoo
Navigate
Branch
Wednesday, July 19, 2023
22 changes
New functionality added to Odoo
Odoo can now send message notifications to users through browser and PWA push notifications, even when the Odoo tab or app is closed. This brings web notifications closer to the mobile app experience and helps users stay informed about important activity in real time.
Original PR description
* = test_mail_enterprise WebPush allows to send data to the user browser/app(PWA) even when tab/app is closed. Web push is a "constant" link between the ServiceWorker of browser/app and a WebPush…
* = test_mail_enterprise
WebPush allows to send data to the user browser/app(PWA) even when
tab/app is closed. Web push is a "constant" link between the
ServiceWorker of browser/app and a WebPush server.
Note that each browser have it's owns custom WebPush server.
e.g.:
* Chrome: https://fcm.googleapis.com/
* Firefox: https://updates.push.services.mozilla.com/
* Safari: https://web.push.apple.com/
* Edge: https://wns2-ln2p.notify.windows.com/
WebPush introduces some cryptographic notion to ensure some the
reliability of the data sent:
1. VAPID: "Voluntary Application Server Identification" is the standard
used to generate the public and the private to sign the message
between the browser and the WebPush server
2. JWT: "JSON Web Token" is the standard used to sign the payload to the
WebPush server
3. ECE: "Encrypted Content-Encoding" is the standard used by WebPush to
encrypt the data of the payload to avoid sending RAW data
outside trusted network.
Simplified steps how to WebPush works:
1. The Javascript code of a web page subscribes to the WebPush server
(using the VAPID key generated at mail_entreprise install).
2. The WebPush server replay with a subscription (and some other infos
like the unique URL endpoint per subscription where to send a
notification)
3. The application (odoo-bin in our case) sends a post request to the
WebPush server using the specific URL endpoint of the user (using JWT
and ECE).
4. The WebPush server sends back to the browser the encrypted payload.
5. The browser decrypts the payload and sends it to the ServiceWorker
linked to the subscription.
Here a [Sequence diagram](https://w3c.github.io/push-api/index.html#fig-example-flow-of-events-for-subscription-push-message-delivery-and-unsubscription) of all interactions to process a web push notification.
In Odoo, we use WebPush to send Notification to the user.
This commit aims to have a parity with the Android/iOS Mobile App at
the notification level.
Notes:
There are some ways to encrypt (ECE) the message for WebPush:
* AESGCM128: this is a draft
* AESGCM: very well documented
* AES128GCM: RFC8188 Standard encoding
We implement only the RFC one as it is the only one implemented in all
major updated browser (Chrome, Firefox, Safari, Edge, ...)
You need to allow the desktop "Notification" and "Push" inside your
browser. For iOS Devices, it only works on iOS 16.4+ and it's requiring
Odoo to first be added to the Home Screen. It's delivered silently,
meaning no sound, vibration, haptics or screen wake.
Note:
Notifications are sent directly if there are less than 5 notifications,
otherwise we use a cron triggered immediately.
Also, we have changed the value of the "QueryCount" as `mail_enterprise`
executes a new query to search the devices associated with the partner.
We have added a "try/except" for any Exception before the
`push_to_end_point` method as we want to avoid blocking a normal flow
just for a not mandatory push notification if something happens during
the push to the endpoint.
See:
https://github.com/odoo/enterprise/commit/d0ae70103dd1c169debe8fcb0918f80310c85e42
Links:
- https://www.rfc-editor.org/rfc/rfc8030
- https://www.rfc-editor.org/rfc/rfc8188
- https://www.rfc-editor.org/rfc/rfc8291
- https://www.rfc-editor.org/rfc/rfc8292
- https://w3c.github.io/push-api/index.html
- https://autopush.readthedocs.io/en/latest/http.html
- https://web.dev/push-notifications-web-push-protocol/
- https://github.com/web-push-libs/encrypted-content-encoding
- https://github.com/web-push-libs/pywebpush
- https://github.com/web-push-libs/vapid
- https://caniuse.com/push-api
Task ID: 3123678
Co-authored-by: Romeo Fragomeli <rfr@odoo.com>Appointment managers can now plan staff and resource bookings in a Gantt-style timeline, making availability and scheduling conflicts easier to see at a glance. The update also adds practical tools to record and manage resource leave directly from appointment workflows, so unavailable courts, rooms, equipment, or staff are better reflected in scheduling.
Original PR description
PURPOSE This merge commit aims to introduce a gantt view to allow users to easily manage the appointments of staff and resources from the backend. It also introduces a leave management interface for…
PURPOSE This merge commit aims to introduce a gantt view to allow users to easily manage the appointments of staff and resources from the backend. It also introduces a leave management interface for the resources. SPECS The merge commit is split into 4 different sub-commits: - add the main resource on calendar.event This is essentially a preparatory commit as having a (stored) field containing the appointment resource on the calendar.event model is necessary to be able to create a gantt view grouping bookings by the resource. This field is populated by copying the resource of the booking line, if there is only one (from the booking_line_ids relationship). - add the gantt view to the appointment module As explained previously, this is the main commit that adds the gantt view to manage resource bookings as well as staff meetings (based on the appointment type configuration). Through this view, one can manage for example a tennis court business, by being able to quickly create bookings for its tennis courts (and seeing at a glance which ones are available). - improve appointment actions & menus The commit purpose is mainly to open the right view for the right use case. Based on the appointment type configuration (resources / people, manage capabilities, ...), it might be more appropriate to open either a gantt, a calendar view, a list view, ... - add a leave management interface for resources We add additional menus & wizards to make it easier for the end user to encode leaves for the appointment resources. See underlying commits for more details. Task-3101589
Enhancements to existing features
Standard projects can now be created without being tied to a specific company, making them easier to use in multi-company setups. Field service projects remain company-specific to preserve correct operations, while related profitability calculations and field service flows were adjusted accordingly.
Original PR description
This commit's purpose is to complement its community part. The goal is to keep the projects of type 'field service' company dependant, while still allowing standart project to have no company_id. Some small update were also added for the correct computation of the project profitability panel. task-3084819
Keyboard shortcuts have been standardized across many Odoo screens so users can rely on the same keys for common actions. Confirm or default actions now use Alt+Q, while cancel actions use Alt+X, making navigation faster and more predictable.
Original PR description
This commit makes hotkey uses more coherent throughout the entire codebase by setting alt+q as main shortcut for confirm and default actions and alt+x for cancel actions. related to https://github.com/odoo/odoo/pull/127469 task-3370463
Odoo now supports India-specific recurring payment requirements when customers save a card for subscriptions through Stripe. This helps businesses comply with RBI e-mandate rules by using subscription details during card setup, while also preventing a saved-payment warning from appearing in the wrong payment flow.
Original PR description
The Reserve Bank of India (RBI) issued a directive (amended subsequently in December 2020 and March 2021) that introduces additional security measures for recurring payments on India-issued cards. These measures include:
- Banks must register cardholders and create an e-mandate through a
one-time process, using additional factor authentication (AFA)
like 3D Secure (3DS).
- Banks must alert cardholders at least 24 hours before charges take
place and give them the ability to opt out of transactions.
- Recurring transactions over 15,000 INR (or equivalent in other
currencies) must go through AFA each time.
After this commit, Stripe will create an e-Mandate for every Indian-based card newly saved in Odoo with the values of the linked subscription.
See also:
- https://github.com/odoo/odoo/pull/123573
- https://github.com/odoo/upgrade/pull/4748
- https://github.com/odoo/documentation/pull/4719
task-3322020Enterprise visuals were adjusted to better align with the shared product interface while keeping plan-specific styling where useful. The burger menu naming was standardized to avoid build issues, and button and divider colors were refined so users can more clearly recognize the Enterprise experience.
Original PR description
This PR follows the tutorial of the R&D UX/UI Requires : - https://github.com/odoo/odoo/pull/115690 task-3234820
The rich text editor used across appointments, knowledge articles, and Studio reports has been modernized so it no longer loads older supporting code unnecessarily. This should make screens that include editable HTML content lighter and better aligned with the newer Odoo interface framework, without changing the main user workflow.
Original PR description
The goal of the community PR is to remove all dependency to legacy assets in the wysiwyg because the wysiwyg is loaded on a lot of form view through the html_field, thus defeating the purpose of the legacy assets being lazy loaded. Therefore, the wysiwyg is now an Owl component. This commit adapt the enterprise code to work with the new wysiwyg. task-3175256
Resolved issues and error corrections
Knowledge article categories now use a missing database index, helping searches, filters, grouping, and related cleanup actions run more efficiently. This should improve performance in common Knowledge views without changing how users work.
Original PR description
Add missing index on `category` of `knowledge.article`, used in many filters of the search view and the group by `category`. Also used in a few methods like `_check_sidebar_display` and during unlinking of partners. task-3420528
Several app pages now correctly report access and missing-page errors instead of treating them as successful requests. This helps users see the right error message and prevents confusing behavior in affected workflows.
Original PR description
Some json-controllers were returning http exceptions (e.g. NotFound, Forbidden) instead of raising them causing the RPC error handler in the JS framework to ignore them.
Code cleanup and technical improvements
This update prepares Odoo to use one standard translation method instead of two, reducing confusion for future maintenance. It also adjusts automated guided tours and tests so translated text is only loaded when ready, helping keep validation stable across many business modules.
Original PR description
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.
In this commit,
- the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
- the lazytranslate function _lt() returns _t() function.
**Corollaries :**
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.
**Example :**
```
registry.category("web_tour.tours").add("example", {
test: true,
steps: () => [
{...},
{...},
],
});
```
task-3292454
Community: https://github.com/odoo/odoo/pull/124157Miscellaneous changes
Steps to reproduce: - create a product with an operation on its BOM - create a quality point with: -- operation: manufacturing -- workoder operation: the one set on the product -- control per : product(15.0) / quauntity(16.0) - create an MO for the created product - an extra quality check is created on the MO Bug: the domain for lot type was missing the filter on operation type Fix: apply the same filter for all measure_on types opw-3337069 Forward-Port-Of: odoo/enterprise#4429
Original PR description
Steps to reproduce: - create a product with an operation on its BOM - create a quality point with: -- operation: manufacturing -- workoder operation: the one set on the product -- control per : product(15.0) / quauntity(16.0) - create an MO for the created product - an extra quality check is created on the MO Bug: the domain for lot type was missing the filter on operation type Fix: apply the same filter for all measure_on types opw-3337069 Forward-Port-Of: odoo/enterprise#44295 Forward-Port-Of: odoo/enterprise#42900
OCR only should update the currency when it is adding invoice line and there is no already added invoice lines. When there is an invoice line already, the currency considered to be correct. Forward-Port-Of: odoo/enterprise#44276 Forward-Port-Of: odoo/enterprise#43743
Original PR description
OCR only should update the currency when it is adding invoice line and there is no already added invoice lines. When there is an invoice line already, the currency considered to be correct. Forward-Port-Of: odoo/enterprise#44276 Forward-Port-Of: odoo/enterprise#43743
The domain validation done at confirmation in the domain selector dialog has been reintroduced in https://github.com/odoo/odoo/pull/128709/commits/d3eb3fe58ddd677a3f63b097a3390afe887f4349 by calling a new route /web/domain/validate. This makes necessary to adapt some pivot/list tests in documents_spreadsheet. Forward-Port-Of: odoo/enterprise#44255
Original PR description
The domain validation done at confirmation in the domain selector dialog has been reintroduced in https://github.com/odoo/odoo/pull/128709/commits/d3eb3fe58ddd677a3f63b097a3390afe887f4349 by calling a new route /web/domain/validate. This makes necessary to adapt some pivot/list tests in documents_spreadsheet. Forward-Port-Of: odoo/enterprise#44255
Improve filtered to only cancel uncanceled sub. With have a lot of old subscritpion invali that have been cancelled and since we try to write on it, it raises a constraints. Maysbe _action_cancel could also be smarter and filter itself the already canceled sub. Forward-Port-Of: odoo/enterprise#44227 Forward-Port-Of: odoo/enterprise#43232
Original PR description
Improve filtered to only cancel uncanceled sub. With have a lot of old subscritpion invali that have been cancelled and since we try to write on it, it raises a constraints. Maysbe _action_cancel could also be smarter and filter itself the already canceled sub. Forward-Port-Of: odoo/enterprise#44227 Forward-Port-Of: odoo/enterprise#43232
This solves a bug that allows to generate Delivery Guides in returns when "DTE Status in the SII" has the value "Pending to be Sent" or "Rejected" After the PR: The warning msg saying that a sequence is not there does not appear in state other than done. Forward-Port-Of: odoo/enterprise#44025 Forward-Port-Of: odoo/enterprise#40340
Original PR description
This solves a bug that allows to generate Delivery Guides in returns when "DTE Status in the SII" has the value "Pending to be Sent" or "Rejected" After the PR: The warning msg saying that a sequence is not there does not appear in state other than done. Forward-Port-Of: odoo/enterprise#44025 Forward-Port-Of: odoo/enterprise#40340
Before this commit ===================== - In tablet view Continue Consumption is not working as expected in this case - instead of keeping the actual consumption step as is, and creating a new step after this one with 0 quantity input by default,but it does the opposite and when click on Continue button the quantity done is becoming 0. - Validate and Continue Consumption buttons are not showing when all steps have been completed. After this commit ===================== - Consump
Original PR description
Before this commit ===================== - In tablet view Continue Consumption is not working as expected in this case - instead of keeping the actual consumption step as is, and creating a new step after this one with 0 quantity input by default,but it does the opposite and when click on Continue button the quantity done is becoming 0. - Validate and Continue Consumption buttons are not showing when all steps have been completed. After this commit ===================== - Consumption step creating a new step with 0 quantity input by default and when click on continue button quantity done not becoming 0. - Made Validate and Continue Consumption buttons showing when all steps have been completed. - Rename button name 'Continue Production' to 'Continue Consumption'. Task id: 3212121 Forward-Port-Of: odoo/enterprise#40113
In the action_reload_ai_data method, the logger is updated to use the 'warning' level instead of the 'error' level. this error might be generated due to some customer mistake such as the date being incorrect in relation to the associated journal entry's sequence number Handled the traceback by changing the logger level to a warning. Traceback: ``` Error while reloading AI data on account.move 29: ValidationError("The Date (11/30/2022) doesn't match the sequence number of the related J
Original PR description
In the action_reload_ai_data method, the logger is updated to use the 'warning' level instead of the 'error' level. this error might be generated due to some customer mistake such as the date being incorrect in relation to the associated journal entry's sequence number
Handled the traceback by changing the logger level to a warning.
Traceback:
```
Error while reloading AI data on account.move 29: ValidationError("The Date (11/30/2022) doesn't match the sequence number of the related Journal Entry (BILL/2023/06/0001)\nYou will need to clear the Journal Entry's Number to proceed.\nIn doing so, you might want to resequence your entries in order to maintain a continuous date-based sequence.")
```
sentry-4280815461
Forward-Port-Of: odoo/enterprise#44181-Install l10n_mx_reports -Go to Accounting -> Reporting -> Audit Reports -> Trial Balance -Download "SAT (XML)" -The XML filename ends with "CT", and it should be "BN", as it was in 15 and before correction of #42325 opw-3327936 Forward-Port-Of: odoo/enterprise#44245
Original PR description
-Install l10n_mx_reports -Go to Accounting -> Reporting -> Audit Reports -> Trial Balance -Download "SAT (XML)" -The XML filename ends with "CT", and it should be "BN", as it was in 15 and before correction of #42325 opw-3327936 Forward-Port-Of: odoo/enterprise#44245
**Before this commit**: Body content is the same as tmeplate **After**: Body content is the same as the template *: account_followup, hr_appraisal, hr_appraisal_survey Community: https://github.com/odoo/odoo/pull/128953 Forward-Port-Of: odoo/enterprise#44278
Original PR description
**Before this commit**: Body content is the same as tmeplate **After**: Body content is the same as the template *: account_followup, hr_appraisal, hr_appraisal_survey Community: https://github.com/odoo/odoo/pull/128953 Forward-Port-Of: odoo/enterprise#44278
Milk testing pad issue: - [dbo] voip: answer/hangup icons are misaligned when someone calls you https://tinyurl.com/232m5fde task-3415013 part of task-3326263 Forward-Port-Of: odoo/enterprise#43600
Original PR description
Milk testing pad issue: - [dbo] voip: answer/hangup icons are misaligned when someone calls you https://tinyurl.com/232m5fde task-3415013 part of task-3326263 Forward-Port-Of: odoo/enterprise#43600
- fixed clipping belgian options when posting closing entry caused from simple refactoring problem - remove useless options of 'horizontal group' and 'extra options' from closing entry pdf - Task-id: 3375250 Forward-Port-Of: odoo/enterprise#43405 Forward-Port-Of: odoo/enterprise#42910
Original PR description
- fixed clipping belgian options when posting closing entry caused from simple refactoring problem - remove useless options of 'horizontal group' and 'extra options' from closing entry pdf - Task-id: 3375250 Forward-Port-Of: odoo/enterprise#43405 Forward-Port-Of: odoo/enterprise#42910
- Wkhtmltopdf have a 'smart-shrinking' feature that automatically shrink the font size if the document's size is too long. It doesn't work on RTL document for some reason - This is a workaround where in the table, if some sentence is too long, we'll force break it - Also an improvement for LTR where it won't shrink the font size anymore Before - after (RTL)     Before - after (LTR)   Task-id: 3264554 Forward-Port-Of: odoo/enterprise#43947 Forward-Port-Of: odoo/enterprise#43309