Friday, January 17, 2025
88 changes
Enhancements to existing features
When an invoice report is misconfigured, users now see a clear error message instead of a technical crash. This helps administrators quickly identify that no invoice report is configured in the database and resolve the setup issue.
Original PR description
Problem --------- When you use a Invoice report with the checkbox "Invoice report" unselected (misconfiguration), you get a traceback. Objective --------- Replace it with an error message instead, saying there's no invoice report configured in the database. Solution --------- Turn the asserts into a if condition that raises a user error. task-4421065 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
Leaving a Discuss call now also exits full-screen mode if it was active. This prevents users from being stuck in full-screen view after ending a call, making the call experience smoother and less confusing.
Original PR description
Before this commit, leaving call while the call view is full screen would keep the fullscreen mode. This commit fixes the issue by exiting the full screen when leaving the call. Task-4476568
Code cleanup and technical improvements
This update removes leftover unused code from the Restaurant Point of Sale area. It does not change business workflows, but helps keep the system easier to maintain and reduces the chance of confusion in future updates.
Original PR description
Remove dead code forgotten in previous commit
Miscellaneous changes
Problem: When a manufacturing order with a work order that was not planned is completed, a resource.calendar.leave is created for the work order. During this process the work order’s date_finished field is recalculated. This means that this work order reserves a slot in the work center to be finished in the future even though it has already been completed. Purpose: If the work order already has a date_finished value, then that value should be used instead of it being recalculated based on the
Original PR description
Problem: When a manufacturing order with a work order that was not planned is completed, a resource.calendar.leave is created for the work order. During this process the work order’s date_finished…
Problem: When a manufacturing order with a work order that was not planned is completed, a resource.calendar.leave is created for the work order. During this process the work order’s date_finished field is recalculated. This means that this work order reserves a slot in the work center to be finished in the future even though it has already been completed. Purpose: If the work order already has a date_finished value, then that value should be used instead of it being recalculated based on the availability of the work center. This will help ensure that completed work orders are not reserving time in a work center when it has already been completed. Steps to Reproduce on Runbot: 1. Create a new storable product. 2. Create a BoM for this product and navigate to the Operations tab and add an operation. 3. Create a manufacturing order, confirm it, and then produce all without planning it. 4. Navigate to the completed work order and observe the finished date is in the future. 5. Navigate to the work centers working hours’ time off and find the record associated with the work order. 6. Observe that the end date is in the future. opw-4393301 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193705 Forward-Port-Of: odoo/odoo#192393
This fixes an internal website test so its media dialog checks are actually executed. It helps ensure website media features are tested as intended, reducing the chance of unnoticed issues reaching users.
Original PR description
This PR adds the missing run methods in the media dialog tour steps **merged** in [commit](https://github.com/odoo/odoo/commit/bee295f). The run methods are necessary to execute the tour steps Without these methods, the tour steps were not executed properly, and the functionality was not tested as intended. task-4246644
On small screens, a button menu with only one item now displays cleanly without leaving an empty space beside it. This improves the visual polish and usability of forms on mobile devices.
Original PR description
On smaller screen, the statbuttons are grouped in a dropdown (the "lightning" icon) and displayed in two columns. But when only one button is present, it leaves a weird empty cell next to it. This commit fixes it by adding an exception in CSS when only one button is present to remove the useless column and center it. Note: this change doesn't affect the empty cell when an odd number of buttons are displayed. task-4491705
The document layout setup now correctly shows the A4 paper format when Belgian payroll is installed. This prevents confusion during document configuration and helps businesses select the right format for payroll-related reports.
Original PR description
In the document layout configurator, the paper format A4 would not be there if the module l10n_be_hr_payroll is installed. This is because in Belgium, some reports need A4 but in the configurator, we only get paperformat not linked to any report. The solution is to remove the domain for this field in the configurator. Since there will be more paper formats, I renamed the newly created formats in the Belgian payroll to differentiate them.
The website mega menu now handles links that were saved without a URL instead of crashing. This prevents visitors and editors from seeing an error when navigating to pages that are not part of the menu.
Original PR description
Steps to reproduce: - Open the "Menu Editor" dialog. - Add a "Mega Menu Item". - Save the "Menu Editor" dialog. - Enter "Edit Mode". - Open the "Mega Menu". - Select "Images Subtitles" as the "Mega Menu" template option. - Click on the largest image on the right side of the "Mega Menu". - Click the "Create Link" button in the image options. - Leave the input URL empty for this new link. - Save the page. - A link without an "href" attribute is now present in the "Mega Menu". - Edit the browser URL to redirect to a page that is not present in the menu; for example, add "/test" to the current URL. It does not matter whether the page exists or not. - Bug: A traceback occurs. The bug occurred because the function "_updateActiveMenuLinks" (introduced by this commit [1]) called "new URL" on an empty string, as it attempted to process a link without an href attribute. [1]: https://github.com/odoo/odoo/commit/5be12800a59e912997fff39cec57ab70914f2485 opw-4480958
This fixes an issue in Discuss calls on mobile where moving participant cards could make them disappear off screen. Participant cards can now only be dragged when they are in the intended movable state, improving call usability on phones and tablets.
Original PR description
Before this commit, when dragging participant cards on mobile they will get dragged off screen. 1. Open discuss on mobile 2. Get into a call 3. Move the participant cards -> they will disappear This happens because the `drag` function gets called without checking if the participant card is in the inset state (the state in which it can be moved around). This commit fixes the issue by checking that the component is in that state before being able to drag it. task-4491597
Users can now use Escape or Enter when confirming whether to close a live chat. This makes the close confirmation behave as expected and helps operators handle chats more smoothly without relying only on mouse clicks.
Original PR description
Before this commit, the Escape and Enter hotkeys did not work to cancel and confirm the `CloseConfirmation` in livechat. This happened because: - The `keydown' event is not captured without the focused element. - `useAutofocus` doesn't detect the element properly because the active element in the ui service is set by the main tree DOM root, not the shadow root. This PR makes sure that the close confirmation element is focusable on mounting and also puts the focus on the chat window composer on cancel so it's more effective in case the user needs to type or use Esc to reopen close confirmation.
The public sharing page for live spreadsheets no longer shows a download button that led visitors to a 404 error. This avoids a confusing broken action for external viewers when spreadsheets are shared by link.
Original PR description
Steps to reproduce: - install Documents - create a new spreadsheet - hit the Share button - change the sharing settings to "Anyone with the link: Viewer / Musty have the link to access" - open the…
Steps to reproduce: - install Documents - create a new spreadsheet - hit the Share button - change the sharing settings to "Anyone with the link: Viewer / Musty have the link to access" - open the sharing link in an incognito window - hit the download button => 404 not found A public user cannot convert a spreadsheet to an excel file and downlaod it because a route needs to be called to create the excel file. This route is currently not allowed for public users. For frozen spreadsheet, we generate the excel file before-hand (when the internal user shares the spreadsheet). For a regular "live" share though, we cannot pre-generate the excel file since the spreadsheet continues to live and evolve. The `spreadsheet` module needs to be updated for this bug fix to take effect. (otherwise the download button won't do anything, which is not worse than facing a 404 response) See also Enterprise PR. Task: 4440241 opw: 4417519 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The upload button shortcut in Accounting has been changed from Alt+B to Alt+Shift+I. This prevents it from interfering with Odoo's standard back navigation shortcut, making keyboard use smoother and more predictable.
Original PR description
Before this PR: - The Upload Button was assigned the shortcut Alt+B. - This caused a conflict with Odoo's default shortcut for navigating backward. After this PR: - The shortcut for the Upload Button is now updated to Alt+Shift+I. - This resolves the conflict and ensures smooth navigation and functionality. Task ID:-4417310
Invoices sent for a contact linked to a company now use the company's configured EDI format instead of the individual contact's format. This ensures customers receive electronic invoices in the expected company-level format and avoids incorrect document generation.
Original PR description
The invoice edi format should be take from the parent of the partner instead of the partner himself. Steps: - Create an individual partner X and set an edi format - Create a company partner Y and set a different edi format - Make X child of Y - Create an invoice for X, confirm and click on 'Send and print' button -> The edi file is in the format set on X instead of the format set on Y opw-4480527
For Belgium, combination of taxes and their deductibility are many. While our system of Distribution lines can be used in many cases, it's not easy or intuitive to configure, even for advanced accountants. This commit aims at making sure: - The most useful taxes are active by default - We provide a few examples of the most commonly used Deductible taxes as well as examples of specific cases (Deductible IntraCom taxes). task-id 4417039 Forward-Port-Of: odoo/odoo#193860 Forward-Port-Of: o
Original PR description
For Belgium, combination of taxes and their deductibility are many. While our system of Distribution lines can be used in many cases, it's not easy or intuitive to configure, even for advanced accountants. This commit aims at making sure: - The most useful taxes are active by default - We provide a few examples of the most commonly used Deductible taxes as well as examples of specific cases (Deductible IntraCom taxes). task-id 4417039 Forward-Port-Of: odoo/odoo#193860 Forward-Port-Of: odoo/odoo#191350
Issue: * Accrued Expense Entry shows wrong currency symbol for 'Total in Currency' for multicurrency POs. Steps To Reproduce: * In a multicurrency environmentcreate a PO with a currency different than the one of the company and confirm it. * Receive the product and validate it. * On the PO action wheel, create `Accrued Expense Entry`. * Notice 'Total in Currency' is set to the wrong currency. Solution: * In `_compute_move_vals` I set the move's `currency_id` of the accrual move to t
Original PR description
Issue: * Accrued Expense Entry shows wrong currency symbol for 'Total in Currency' for multicurrency POs. Steps To Reproduce: * In a multicurrency environmentcreate a PO with a currency different than the one of the company and confirm it. * Receive the product and validate it. * On the PO action wheel, create `Accrued Expense Entry`. * Notice 'Total in Currency' is set to the wrong currency. Solution: * In `_compute_move_vals` I set the move's `currency_id` of the accrual move to that of the order's currency. * in `create_entries` I prevent the creation of the accrual move if orders have different currencies. * Please note that there were no issues with currency conversions. opw-4072932 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194050 Forward-Port-Of: odoo/odoo#177929
Before this commit: Once receveiving Mercado Pago callback, a JS traceback would occur: ```js TypeError: Cannot read properties of undefined (reading 'payment_method') at Proxy.get_payment ``` opw-4349957 Forward-Port-Of: odoo/odoo#194112
Original PR description
Before this commit: Once receveiving Mercado Pago callback, a JS traceback would occur: ```js TypeError: Cannot read properties of undefined (reading 'payment_method') at Proxy.get_payment ``` opw-4349957 Forward-Port-Of: odoo/odoo#194112
**Current behavior:** The rounding applied during the cost split of a landed cost's cost computation can yield undesirable/unexpected results. **Expected behavior:** Sensible rounding. **Steps to reproduce:** 1. Create some product with arbitrary cost, with avg and real_time costing and valuation, respectively 2. Create a purchase order with 6 lines, all for that product 3. Confirm order & receive products, create bill and add a landed cost line with cost=6.85 4. Post bill a
Original PR description
**Current behavior:** The rounding applied during the cost split of a landed cost's cost computation can yield undesirable/unexpected results. **Expected behavior:** Sensible rounding. **Steps to…
**Current behavior:**
The rounding applied during the cost split of a landed cost's
cost computation can yield undesirable/unexpected results.
**Expected behavior:**
Sensible rounding.
**Steps to reproduce:**
1. Create some product with arbitrary cost, with avg and
real_time costing and valuation, respectively
2. Create a purchase order with 6 lines, all for that product
3. Confirm order & receive products, create bill and add a
landed cost line with cost=6.85
4. Post bill and create the landed cost:
* link to the receipt
* set split method to `equal`
5. Validate the LC, see that the val adjustment lines are
rounded unexpectedly- *specifically all the lines are rounded up
(beyond the per-adjustment-line value) which means the final
adjustment line cost-split share will reflect the cumulative
rounding loss of every adjustment line rounded prior*
E.g.,
<pre>
[ 1.15, 1.15, 1.15, 1.15, 1.15, 1.11 ]
^
</pre>
**Cause of the issue:**
We currently use `rounding_method='UP'`.
**Fix:**
Round HALF-UP. This will minimize the difference between the
true, unrounded split-value and the post-rounding value.
Semi-related fix: try to use consistent `ResCurrency.round()`
methods between `compute_landed_cost()` and `_check_sum()`.
opw-4200916
Forward-Port-Of: odoo/odoo#193861
Forward-Port-Of: odoo/odoo#190449### Before When creating a new vendor bill through Vendors > 'Example Vendor 1'> Vendor Bills (magic button), if the vendor was changed to 'Example Vendor 2' and the draft saved then it would show up under the 'Example Vendor 1' in the Partner Ledger instead of under the correct 'Example Vendor 2'. This is due to the partner_id being defined in the context when going through the 'Example Vendor 1' view. ### Now During the creation of the account move lines we use a context without the
Original PR description
### Before When creating a new vendor bill through Vendors > 'Example Vendor 1'> Vendor Bills (magic button), if the vendor was changed to 'Example Vendor 2' and the draft saved then it would show up under the 'Example Vendor 1' in the Partner Ledger instead of under the correct 'Example Vendor 2'. This is due to the partner_id being defined in the context when going through the 'Example Vendor 1' view. ### Now During the creation of the account move lines we use a context without the default_partner_id. The Partner Ledger now shows the draft bill entry under the right vendor. opw-4407709 Forward-Port-Of: odoo/odoo#193842 Forward-Port-Of: odoo/odoo#192567
Before this commit, markers on the location selector map were misaligned. The misalignment was proportional to the zoom level, as the marker incorrectly used the top-left corner of the anchor as its reference. This commit resolves the issue by defining the correct icon anchor position for markers. Forward-Port-Of: odoo/odoo#193982
Original PR description
Before this commit, markers on the location selector map were misaligned. The misalignment was proportional to the zoom level, as the marker incorrectly used the top-left corner of the anchor as its reference. This commit resolves the issue by defining the correct icon anchor position for markers. Forward-Port-Of: odoo/odoo#193982
Apparently in normal mode (and thus the new headless mode) Chrome does not focus the document. The `activeElement` is correctly set, but `document.hasFocus()` always returns `false` and per-element focus events are suppressed. That makes tests testing or needing focus fail in the new headless mode as well as well as impossible (or at least frustrating) to `debug`. Enabling "focus emulation", which corresponds to the "Emulate a focused page" UI option, seems to resolve the issue. Fixes r
Original PR description
Apparently in normal mode (and thus the new headless mode) Chrome does not focus the document. The `activeElement` is correctly set, but `document.hasFocus()` always returns `false` and per-element focus events are suppressed. That makes tests testing or needing focus fail in the new headless mode as well as well as impossible (or at least frustrating) to `debug`. Enabling "focus emulation", which corresponds to the "Emulate a focused page" UI option, seems to resolve the issue. Fixes reliably failing tests - `/im_livechat:ExternalTestSuite.test_external_livechat` - `/account:TestUI.test_01_account_tax_groups_tour` - `/account_accountant:TestBankRecWidget.test_tour_bank_rec_widget` - `/web_editor:TestOdooEditor.test_odoo_editor_suite` Backport of: odoo/odoo@0aaf98b77feaa15f5eb30e1c251f5765e8afbfa5 Forward-Port-Of: odoo/odoo#193993
When we go to the website preview in the Odoo backend, if the current domain used (to access the backend) is not the same as the one of the previewed website, we redirect the user, and he might have to reconnect. The same is done when using the website switcher. Note: in the first case, the user is warned. We should probably do the same for the second case (?). This is a problem for the Odoo support team. When they connect to a customer database upon user request, the <customer_db_name>.odoo
Original PR description
When we go to the website preview in the Odoo backend, if the current domain used (to access the backend) is not the same as the one of the previewed website, we redirect the user, and he might have…
When we go to the website preview in the Odoo backend, if the current domain used (to access the backend) is not the same as the one of the previewed website, we redirect the user, and he might have to reconnect. The same is done when using the website switcher. Note: in the first case, the user is warned. We should probably do the same for the second case (?). This is a problem for the Odoo support team. When they connect to a customer database upon user request, the <customer_db_name>.odoo.com address is used. But as soon as they are using the website app, they are redirected to the real website domains... where they are disconnected and cannot connect themselves. To fix this issue, we allow setting up a session info parameter to bypass those website redirections. This is not to be done by real users: this will come with bugs (for the support team). Indeed, we are normally redirecting for a reason: many flows rely on using the right domain when visiting a specific website. Depending on what users have in their page, this could also simply make the website preview iframe crash. task-4069779 Forward-Port-Of: odoo/odoo#193648 Forward-Port-Of: odoo/odoo#193122
We now also delete `lib/` directory before deleting/downloading new IoT handlers. In community, this directory does not exist, resulting in Path error while trying to `iterdir()` on it. We now look for files recursively inside `iot_handlers/`, and provide the list to the updated method `unlink_file` that now accepts multiple arguments to avoid excessively switching between rw/ro filesystem modes. Forward-Port-Of: odoo/odoo#193990
Original PR description
We now also delete `lib/` directory before deleting/downloading new IoT handlers. In community, this directory does not exist, resulting in Path error while trying to `iterdir()` on it. We now look for files recursively inside `iot_handlers/`, and provide the list to the updated method `unlink_file` that now accepts multiple arguments to avoid excessively switching between rw/ro filesystem modes. Forward-Port-Of: odoo/odoo#193990
The example of values in the description are translated in other languages. It should not because only the technical values are accepted (which are never translated) It's not needed to backport to 16.0 because function description were not translated at that time. Task: 4471424 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/
Original PR description
The example of values in the description are translated in other languages. It should not because only the technical values are accepted (which are never translated) It's not needed to backport to 16.0 because function description were not translated at that time. Task: 4471424 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#193350 Forward-Port-Of: odoo/odoo#193205
Versions -------- - saas-17.4+ Steps ----- 1. Create a new quotation template; 2. add a header which uses the `date_order` field; 3. configure the mapping from this form field to the record field; 4. print the quotation template. Issue ----- The datetime is formatted as "Jan 16, 2025, 5:59:26 PM", which is different from how dates are formatted, or how datetimes are usually formatted elsewhere in Odoo. Additionally, it may also be too long to fit in the form field. Cause --
Original PR description
Versions -------- - saas-17.4+ Steps ----- 1. Create a new quotation template; 2. add a header which uses the `date_order` field; 3. configure the mapping from this form field to the record field; 4.…
Versions -------- - saas-17.4+ Steps ----- 1. Create a new quotation template; 2. add a header which uses the `date_order` field; 3. configure the mapping from this form field to the record field; 4. print the quotation template. Issue ----- The datetime is formatted as "Jan 16, 2025, 5:59:26 PM", which is different from how dates are formatted, or how datetimes are usually formatted elsewhere in Odoo. Additionally, it may also be too long to fit in the form field. Cause ----- The `format_datetime` function is used without a `dt_format` specified, falling back on the default `'medium'`: https://github.com/odoo/odoo/blob/cbd5531697954ec62d79e0eec2c00bd61cd8b0e4/odoo/tools/misc.py#L1399 Solution -------- In order to get the format defined for the relevant locale in Odoo, `dt_format=False` should be specified in the `format_datetime` call: https://github.com/odoo/odoo/blob/cbd5531697954ec62d79e0eec2c00bd61cd8b0e4/odoo/tools/misc.py#L1427-L1430 opw-4414688 Forward-Port-Of: odoo/odoo#194016
Issue: when the website has a domain `get_base_url` return the domain if the record calling it has a company set on it - call the function with an empty object to get the database url instead Task: 3903743 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193182
Original PR description
Issue: when the website has a domain `get_base_url` return the domain if the record calling it has a company set on it - call the function with an empty object to get the database url instead Task: 3903743 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193182