Daily updates from Odoo
Monday, March 4, 2024
14 changes · saas-17.1
New functionality added to Odoo
This update introduces a new payment method for point-of-sale transactions using Razorpay, a popular payment gateway. This allows businesses to accept payments directly through Odoo's POS system, expanding payment options for customers.
Original PR description
This commit adds the module pos_razorpay to add a new payment method of razorpay to point_of_sale. Task: 3691186 Forward-Port-Of: odoo/odoo#153627
Resolved issues and error corrections
A recent update incorrectly removed visual styles (hatched and striked) from calendar events in the Year view of the HR module. This caused confusion about event statuses (e.g., 'To Approve'). This change restores the correct visual indicators, ensuring accurate event representation.
Original PR description
During the revamp, in commit 97fea91a570d2bb8a0d454be9cbe7ea4269f6699, the classes `.o_event_hatched` and `.o_event_striked` were removed by mistake. This causes confusion with the status of the events in the Year view of the `hr_holidays` module. According to the legend and the visual style of the events, they look like they are all validated when they are actually "To Approve" or "Refused". | Before| After| |-----|-----| |  | | task-3617333 part of task-3575827 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144208
This update fixes a bug preventing detailed account changes (like invoice account modifications) from being visible in financial reports. This ensures accountants and auditors have accurate tracking of financial transactions, improving reporting reliability and compliance. The fix addresses a technical limitation related to sub-model tracking.
Original PR description
Steps to reproduce: - Create an invoice and confirm it - reset to draft - change the account of an aml (product sales -> asset) -> on the log note you will see the detail of the modification `Account: 400000 Product Sales -> 101000 Current Assets` - connect with Demo - go on the same invoice Issue: You will not see the details of the aml account change This is problematic since Accountant and auditors should be able to see it. Cause: Sub-model tracking is not supported. Although we override this constraint in accounting (refer to https://github.com/odoo/odoo/blob/f56de22f10d09e6e34b25cbff04bbb6bf0823e54/addons/account/models/account_move.py#L5058-L5071), it remains inaccessible for users other than base.system. This is because we attempt to locate the account_id field on the model account.move defined in tracking.mail_message_id. opw-3632295 Forward-Port-Of: odoo/odoo#155034 Forward-Port-Of: odoo/odoo#151096
This update resolves an issue where non-admin users accessing the mobile order menu for a restaurant would encounter an error due to restricted image access. The fix grants access to images for all users with valid access tokens, ensuring a smoother ordering experience for customers.
Original PR description
**Current behavior:** Trying to access the mobile order menu for a pos restaurant with some non-default landing page images as a non-admin user will result in an access error. **Expected behavior:**…
**Current behavior:** Trying to access the mobile order menu for a pos restaurant with some non-default landing page images as a non-admin user will result in an access error. **Expected behavior:** The images should load on this page for anyone who has a valid access token for the page route. **Steps to reproduce:** 1. Make a restaurant in the POS application 2. Enable mobile ordering and set a database user with `user` level access to the POS app to be the default user for this newly created restaurant 3. Upload a splash image for the restaurant 3. On the POS dashboard, select the three vertical dot button on the restaurant -> `Mobile Menu` to get the access error **Cause of the issue:** The default user on the restaurant POS will not necessarily have access rights to the `ir.attachment` model/records. **Fix:** Get the images as sudo()- IMO there isn't a reason these should be inaccessible to anybody considering they are intended to be seen on the landing page by people trying to order. opw-3748314 Forward-Port-Of: odoo/odoo#155589
This update resolves a technical issue preventing users from correctly setting up payment providers for child companies. The fix ensures that payment method lines are created only within bank journals specific to the child company, preventing a common error message related to duplicate payment types and names.
Original PR description
…mpany Steps to reproduce: - Create a branch - Select the two companies in the company selector - Go to payment provider and duplicate the "Demo" one: * set the name as "Demo child" * set the company…
…mpany
Steps to reproduce:
- Create a branch
- Select the two companies in the company selector
- Go to payment provider and duplicate the "Demo" one:
* set the name as "Demo child"
* set the company as the child
* delete the journal
- Go back in payment provider and try to select the created payment
provider
Issue:
UserError: "You can't have two payment method lines of the same payment type (%s) and with the same name (%s) on a single journal."
Cause:
When opening the provider view, it triggers:
- payment.provider._compute_journal_id: if there is no journal_id set on the provider and there is a default bank journal (journals are shared between branches) we'll try to link the payment method to this journal.
https://github.com/odoo/odoo/blob/7d39137df61832e4fe2240fef8e33ad7435359e8/addons/account_payment/models/payment_provider.py#L52-L64
If there is no payment method line (pml), we'll create one with the defaul_payment_method (Demo, the one we duplicated) and with the default journal (Bank from parent company)
- account.payment.method.line._compute_name: it sets the pml.name to 'Demo'
https://github.com/odoo/odoo/blob/7e8185ba20476dd3428ce5e0196207b3bc03eccf/addons/account/models/account_payment_method.py#L134-L138
The constraint in
https://github.com/odoo/odoo/blob/7e8185ba20476dd3428ce5e0196207b3bc03eccf/addons/account/models/account_payment_method.py#L140-L151
is raised since we have to pml with the same name (Demo), the same Journal (Bank from parent) and the same payment type (inbound) with different id's.
Solution:
Find only Bank journals created i n the child company
opw-3692146
Forward-Port-Of: odoo/odoo#154183This update addresses an issue where the duration widget sometimes failed to display correctly due to errors in the Babel formatting library. As a temporary solution, the system now attempts to re-format using the standard English (US) locale before raising an error, providing a more reliable display. This is a best-effort fix due to limitations with our base Ubuntu version.
Original PR description
In case of exception of type KeyError during the formatting with Babel instead to raise a Traceback, we first retry with the en_US locale. Babel fixes each week new bug of formatting like the one in the test, but we cannot bump our default babel version since it is not in the stable Ubuntu 22 so it is a best effort fix that will not hide all bugs but is better that nothing. https://github.com/python-babel/babel/pull/827 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 Forward-Port-Of: odoo/odoo#155909
A recent update to the website's header caused dropdown menus (like the user menu and language selection) to disappear when the page was scrolling. This commit corrects this issue by adjusting how the header's height is managed, ensuring dropdowns appear correctly. A new test has been added to prevent this issue from recurring.
Original PR description
Since the commit [1], a new element called "o_header_hide_on_scroll" was introduced in some header templates. This element has the feature of gradually decreasing its height as you start scrolling…
Since the commit [1], a new element called "o_header_hide_on_scroll" was introduced in some header templates. This element has the feature of gradually decreasing its height as you start scrolling the page until it completely disappears. To reduce the height of this element without leaving its contents fully visible (because they maintain their height), we added an "overflow: hidden" property on it. However, this "overflow: hidden" introduced a bug fixed by this commit. Due to this, the dropdowns within the "o_header_hide_on_scroll" element, like "user menu" dropdown or "language selection" dropdown, became invisible. Steps to reproduce the bug: - Go to Website edit mode. - Click on the header. - Choose the "Menu - Sales 2" template from the options. - Select the "Fixed" Scroll Effect from the options. - Click on the "User Menu" dropdown in the header. - Bug: The dropdown menu does not appear. The same issue occurs if you type something in the search bar; the dropdown with the results does not appear either. To fix this, we don't apply "overflow: hidden" on the "o_header_hide_on_scroll" element when the page hasn't been scrolled yet. And if the page has been scrolled just a bit and the user clicks on a dropdown or the search bar, we scroll the page to the top first, and then display the dropdown menu. This commit also add a test tour to prevent the bug from reappearing. [1]: https://github.com/odoo/odoo/commit/143d475c3ab8d755906807bda8edb655c6dd22eb opw-3698887 Forward-Port-Of: odoo/odoo#154979
This update resolves an issue where the document upload button was hidden in the applicant recruitment view. Now, when the 'Documents for Recruitment' setting is disabled, the upload button will be visible, allowing applicants to properly submit their documents. This ensures a smoother recruitment process.
Original PR description
**Description of the issue/feature this PR addresses:** In the kanban view of all applicants within the recruitment module, an issue arises when applicants attempt to upload documents. --- **Current behavior before PR:** upload button is hidden while uncheck the settings from Documents for Recruitment. --- **Desired behavior after PR is merged:** upload button is visible while uncheck the settings from Documents for Recruitment. --- **Fix:** The PR addresses the problem by modifying tree view of ir.attachment and default_res_model in the context. This adjustment is crucial as the current setting results in an incorrect model name, preventing the display of uploaded documents in this model. task-3579833 Forward-Port-Of: odoo/odoo#155958 Forward-Port-Of: odoo/odoo#150593
This update fixes a bug where kiosk orders with a zero total amount would incorrectly redirect users to the home page without printing a receipt. Now, when an order is zero, the system correctly displays the receipt and confirmation page, providing a smoother user experience for kiosk transactions.
Original PR description
Before this commit: =================== If there is an order with a total amount of 0 in kiosk mode, then after the cart page it is redirected to the home page without printing a receipt. After this commit: ================== with this commit, if an order amount is 0 then it will redirect to the confirmation/receipt page like a normal order with the amount without redirecting to the payment page. task - 3773450 Forward-Port-Of: odoo/odoo#155826
This update fixes an issue where multi-selection product attributes weren't appearing in the product configurator popup when using the Point of Sale (PoS) on mobile devices. Previously, this prevented users from fully customizing products during order creation. This change ensures consistent functionality across all devices, improving the PoS user experience.
Original PR description
Current behavior: When adding a product with a multi selection attribute, the attribute is not displayed in the product configurator popup. This only happens when opening it on a mobile device. Steps to reproduce: - Add a product with a multi selection attribute - Open PoS - Add the product to the order - The attribute is not shown on the product configurator popup opw-3711164 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#154893
This update resolves an issue causing excessive error logging on Raspberry Pi 5 devices due to a problem with the display interface. By protecting subprocess calls, the system now handles exceptions more gracefully, ensuring smoother operation once the device is connected to a database.
Original PR description
Currenlty, on raspberry pi 5 our dislay interface is invading the logger with errors due to the absence of both tvservice and the required vcgencmd methods to identify the connected displays The goal…
Currenlty, on raspberry pi 5 our dislay interface is invading the logger with errors due to the absence of both tvservice and the required vcgencmd methods to identify the connected displays The goal of this PR is to avoid this  While searching for a solution to properly detect displays on a raspberry pi 5 we can avoid the excessive log errors by protecting the subprocess calls. When used with vcgencmd, the python wrapper of 'vcgencmd' bash utility is missing the 'Vcgencmd().display_power_state()' method on raspberry pi 5, which causes a subprocess.CalledSubprocessError because the wrapper itself is missing a try/except block arount its subprocess call [here](https://github.com/sushantnadkar/vcgencmd/blob/68578dd887f2e0f62c1e8bf95323574cfc489be0/vcgencmd/vcgencmd.py#L18) Tvservice is not used on new rpi models so there is no need to protect it While the errors will still be present in the logs for a fresh image at the moment, once an rpi5 is connected to a database, it will receive the code from this PR and will handle the exceptions more gracefully [task-3771334](https://www.odoo.com/web#cids=1&menu_id=4720&action=333&active_id=1428&model=project.task&view_type=form&id=3771334) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#155882 Forward-Port-Of: odoo/odoo#155615
This update fixes an issue where clicking the 'Parent Task' button in the portal user interface would sometimes fail to load related task information. The team manually added the necessary search view ID to ensure the button consistently opens the correct task details, improving user experience.
Original PR description
How to reproduce the bug :
- Go to one project from portal user
- Open a task
- Create a subtask of this task
- Open the subtask
- Click on "Parent Task" button
=> Traceback
Fix :
- The search view is not loaded when opening the parent task
- We add manually the search view id in the action opening the
parent
taskid:3551354
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
Forward-Port-Of: odoo/odoo#142559This update fixes an issue where email styling sometimes lost information when both CSS and inline styles were applied to the same element. Specifically, it ensures that margin values are correctly converted during email creation, preventing style conflicts and ensuring consistent visual presentation. This improves the quality and reliability of our email communications.
Original PR description
When inlining styles for e-mails, some styles could be lost if they were defined in css but also had an inline style that started with the same characters. For example, a node with a style attribute defining `margin-top: 10px` and a css style defining `margin: 5px` would end up with `margin-top: 10px` and losing the rest of the information. opw-3650141 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#156087
Features or functions removed from Odoo
This update removes outdated Spanish localization files (es_MX.po) from the Odoo system. As part of the v17 release, the l10n_mx module now exclusively uses es_419. This cleanup streamlines the codebase and ensures consistency.
Original PR description
As of v17, es_MX.po is not used anymore and es_419 is the only language expected to be used for the l10n_mx localizations --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr