Monday, December 23, 2024
19 changes · saas-17.2
Resolved issues and error corrections
Negative bank journal amounts now display correctly when the currency symbol is configured to appear after the amount. This prevents visual overlap in bank reconciliation screens and makes accounting entries easier to read.
Original PR description
**Issue:** When the currency symbol display position is set to `After Amount`, the currency sign of a negative amount (credit) in a bank journal entry overlaps with the amount.  **Expected:** The `Amount` field should consistently display the currency symbol after the amount when configured as such, even for negative values. **Steps to reproduce:** 1. Activate the Accounting app. 2. Go to `Accounting / Configuration / Accounting / Currencies`. 3. Select the company's currency and enable debug mode. 4. Set the `Display` `Symbol Position` to `After Amount` and save.  5. Navigate to `Accounting / Dashboard` and open the `Bank` journal. 6. Locate an entry with a credit (negative) value. **Cause:** The negative sign (`-`) is correctly displayed before the input field, but it is not added to the "ghost field" used for layout alignment, causing the currency symbol to overlap with the amount. **Fix:** Ensure the negative sign is included before the ghost field as well, aligning the visual layout with the actual value.  opw-4348298
This fix prevents an error when users create or select planning resources that do not have a linked employee. Instead of crashing, the system now safely leaves the avatar empty, allowing planning workflows to continue normally.
Original PR description
Steps to reproduce: --- - Install ``planning`` module - Give the demo user as ``administrator`` in planning. - Log in as Demo user > Go to planning - Click on ``New`` > click on the ``Resource`` field Traceback: --- ``IndexError: tuple index out of range`` The error occurs at [1] because we couldn't find an employee in ``avatar_per_employee_id``. This happens when a new resource is created in the first tab, but the ``employee_id`` is not found in the ``resource`` in the second tab. This commit resolves the above error by returning false if an employee is not present. [1]- https://github.com/odoo/odoo/blob/fb4d758ed78211a61ea797759e1fb3b02b51be60/addons/hr/models/resource.py#L34 sentry-5508268100, 6134007941 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
Fixing permission access error in the test (user does not have access to crm.lead). task-4380712 odoo/odoo#191319 Forward-Port-Of: odoo/enterprise#75965
Original PR description
Fixing permission access error in the test (user does not have access to crm.lead). task-4380712 odoo/odoo#191319 Forward-Port-Of: odoo/enterprise#75965
Add missing index on move_line_id to speedup checking the check_ids of a stock_move_line. See community PR for more info https://github.com/odoo/odoo/pull/190479 Forward-Port-Of: odoo/enterprise#75537
Original PR description
Add missing index on move_line_id to speedup checking the check_ids of a stock_move_line. See community PR for more info https://github.com/odoo/odoo/pull/190479 Forward-Port-Of: odoo/enterprise#75537
### Before The 'Invalid Statements' filter only considered the case of the Ending Balance not matching the Starting Balance + the sum of its transactions. We were not considering the case of the Starting Balance of the statement not matching the previous statement's Ending Balance. ### Now Fixed the condition of the filter to account for the second case. task-4397412 Forward-Port-Of: odoo/enterprise#75710
Original PR description
### Before The 'Invalid Statements' filter only considered the case of the Ending Balance not matching the Starting Balance + the sum of its transactions. We were not considering the case of the Starting Balance of the statement not matching the previous statement's Ending Balance. ### Now Fixed the condition of the filter to account for the second case. task-4397412 Forward-Port-Of: odoo/enterprise#75710
To retrieve the radio button corresponding to the currently-selected status in the statusbar, selector is currently relying on the attribute `aria-label`, but such attribute is incorrect and will be removed. Better relying on the attribute `aria-checked`, which indicates if the radio button is actually checked. Forward-Port-Of: odoo/enterprise#72263 Forward-Port-Of: odoo/enterprise#72063
Original PR description
To retrieve the radio button corresponding to the currently-selected status in the statusbar, selector is currently relying on the attribute `aria-label`, but such attribute is incorrect and will be removed. Better relying on the attribute `aria-checked`, which indicates if the radio button is actually checked. Forward-Port-Of: odoo/enterprise#72263 Forward-Port-Of: odoo/enterprise#72063
Currently, an error occurs when validating stock moves without location. Step to produce: - Install the `mrp_subcontracting` module (make a debugger on). - Create a product, add some quantities, and remove the value of 'Production Location' and 'Inventory Location' from it. - Click on the 'Bills of Materials' button which is in the breadcrumbs of the product form view to create a bom of this product, And set a 'BoM Type' as Subcontracting and add an Administrator as 'Subcontractors'. -
Original PR description
Currently, an error occurs when validating stock moves without location. Step to produce: - Install the `mrp_subcontracting` module (make a debugger on). - Create a product, add some quantities, and…
Currently, an error occurs when validating stock moves without location. Step to produce: - Install the `mrp_subcontracting` module (make a debugger on). - Create a product, add some quantities, and remove the value of 'Production Location' and 'Inventory Location' from it. - Click on the 'Bills of Materials' button which is in the breadcrumbs of the product form view to create a bom of this product, And set a 'BoM Type' as Subcontracting and add an Administrator as 'Subcontractors'. - Go to Inventory / Operations / Transfers / Receipts and create a new 'Receipts', add an Administrator as 'Receive From', and add product in 'Operations' which we created bom. - Open a form view of 'Receive From' (res.partner) and remove value from 'Subcontractor Location' filed which is in the 'Sales & Purchase' tab. - Again come to receipts form view and try to validate it. `ValueError: Expected singleton: stock.location()` This occurs because the system attempts to get 'location_id' from the stock move at [1], but it is not available. Link [1]: https://github.com/odoo/odoo/blob/231952114ae730bb8d4671f4a61f738e8b6dd5b8/addons/stock/models/stock_move.py#L1566 To resolve this issue, add a condition to check if location_id is not available then use the company's subcontracting location as the default value. Sentry-6156032937 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#191005
Steps to reproduce the issue: - Go to the settings and enable multi-routes. - Navigate to the warehouse and attempt to duplicate it. Problem: The operation types “Repair,” “Stock After Manufacturing Operation,” “Picking Before Manufacturing,” and “Manufacturing” are copied instead of creating new records. opw-4386529 Forward-Port-Of: odoo/odoo#189965
Original PR description
Steps to reproduce the issue: - Go to the settings and enable multi-routes. - Navigate to the warehouse and attempt to duplicate it. Problem: The operation types “Repair,” “Stock After Manufacturing Operation,” “Picking Before Manufacturing,” and “Manufacturing” are copied instead of creating new records. opw-4386529 Forward-Port-Of: odoo/odoo#189965
This commit introduces improvements to the order synchronization mechanism. The changes ensure better error handling and provide a more reliable and informative synchronization process. Key Changes: 1. Enhance `_flush_orders` Method - The `_flush_orders` method now has additional error handling to detect RPC errors during synchronization of multiple orders. If an RPC error is detected and multiple orders are being synced, the method will attempt to send each order to the server individuall
Original PR description
This commit introduces improvements to the order synchronization mechanism. The changes ensure better error handling and provide a more reliable and informative synchronization process. Key Changes:…
This commit introduces improvements to the order synchronization mechanism. The changes ensure better error handling and provide a more reliable and informative synchronization process. Key Changes: 1. Enhance `_flush_orders` Method - The `_flush_orders` method now has additional error handling to detect RPC errors during synchronization of multiple orders. If an RPC error is detected and multiple orders are being synced, the method will attempt to send each order to the server individually. 2. Introduce `_flush_orders_retry` Method - This method sends orders to the server one by one and keeps track of the synchronization status (successful, RPC error, or other errors). - It sets the synchronization status to `'connected'`, `'error'`, or `'disconnected'` based on the outcome of individual order synchronization attempts. 3. Improve Error Handling - Enhanced error handling mechanisms to differentiate between various types of errors. - Synchronization status reflects the type of error encountered. opw-3389388 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#144177 Forward-Port-Of: odoo/odoo#126662
This fixes the simple, yet very common case where: - You are creating an expense for one of your employee - The partner of said employee has its field `parent_id` set to be your own company - The expense move commercial_partner_id would then always be yourself - You never pay your employees, only yourself - ??? - Jail task-id: 4345465 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I ha
Original PR description
This fixes the simple, yet very common case where: - You are creating an expense for one of your employee - The partner of said employee has its field `parent_id` set to be your own company - The expense move commercial_partner_id would then always be yourself - You never pay your employees, only yourself - ??? - Jail task-id: 4345465 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#191347 Forward-Port-Of: odoo/odoo#187778
## Description Previously, the scale ticks in Odoo charts did not respect localization settings. This PR resolves the issue by leveraging the formatValue method within the scale tick callback function. Task: [4273769](https://www.odoo.com/odoo/project/2328/tasks/4273769) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189562
Original PR description
## Description Previously, the scale ticks in Odoo charts did not respect localization settings. This PR resolves the issue by leveraging the formatValue method within the scale tick callback function. Task: [4273769](https://www.odoo.com/odoo/project/2328/tasks/4273769) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189562
When field widgets were ported to OWL in 48ef812a, a few ARIA attributes were not adapted correctly. For instance, in the statusbar widget, the title was ported as an `aria-label` attribute ("Current state" and "Not active state"), which overrides the actual status name. This commit fixes the above issue by removing the incorrect `aria-label` attributes and fixing logic for other ones like `aria-checked`. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/s
Original PR description
When field widgets were ported to OWL in 48ef812a, a few ARIA attributes
were not adapted correctly. For instance, in the statusbar widget, the
title was ported as an `aria-label` attribute ("Current state" and "Not
active state"), which overrides the actual status name.
This commit fixes the above issue by removing the incorrect `aria-label`
attributes and fixing logic for other ones like `aria-checked`.
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#184259
Forward-Port-Of: odoo/odoo#183447Users may give gift cards to their customers. Acting like a payment method, gift cards will lower the total amount of a sale order up to 0. Currently, in case of fixed tax applied in the order, the tax amount cannot be covered with the card balance Steps to reproduce - Generate a Gift Card of 100$ - Create a Sale Order with a product having: - price: 90$ - quantity: 1 - A fixed tax of 10$ - Add the gift card to the order Issue: Fixed tax amount will be left uncovered. This
Original PR description
Users may give gift cards to their customers. Acting like a payment method, gift cards will lower the total amount of a sale order up to 0. Currently, in case of fixed tax applied in the order, the tax amount cannot be covered with the card balance Steps to reproduce - Generate a Gift Card of 100$ - Create a Sale Order with a product having: - price: 90$ - quantity: 1 - A fixed tax of 10$ - Add the gift card to the order Issue: Fixed tax amount will be left uncovered. This is an issue because when using the gift card (or anyhow having the total 0), it means the fixed tax cost is supported by the merchant so it should be covered by the gift card opw-4422678 Forward-Port-Of: odoo/odoo#191321
Description of the issue/feature this PR addresses: - In Mexico, failing to assign an appropriate account for cash basis movements can be considered illegal. Therefore, it's essential to set a default one for Mexican companies. Current behavior before PR: - When the 'Cash Basis' (`tax_exigibility`) setting is enabled (via Settings → Accounting → Taxes), no 'Base Tax Received Account' (`account_cash_basis_base_account_id`) is set by default for companies using the 'Mexico' fiscal localizatio
Original PR description
Description of the issue/feature this PR addresses: - In Mexico, failing to assign an appropriate account for cash basis movements can be considered illegal. Therefore, it's essential to set a…
Description of the issue/feature this PR addresses: - In Mexico, failing to assign an appropriate account for cash basis movements can be considered illegal. Therefore, it's essential to set a default one for Mexican companies. Current behavior before PR: - When the 'Cash Basis' (`tax_exigibility`) setting is enabled (via Settings → Accounting → Taxes), no 'Base Tax Received Account' (`account_cash_basis_base_account_id`) is set by default for companies using the 'Mexico' fiscal localization. Desired behavior after PR is merged: - For companies with Mexican fiscal localization, set the default *Base Tax Received Account* to the account with code `899.01.99`. This account, already defined in the [l10n_mx data](https://github.com/odoo/odoo/blob/17.0/addons/l10n_mx/data/template/account.account-mx.csv#L47), is specified by the SAT (_Servicio de Administración Tributaria_, Mexico's primary tax authority) for miscellaneous or generic adjustments (see their [official documentation](http://omawww.sat.gob.mx/fichas_tematicas/buzon_tributario/Documents/codigo_agrupador.pdf#page=22)). opw-[4393526](https://www.odoo.com/odoo/project.task/4393526) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#190279
This PR fixes an issues about the terms & conditions overlapping the rest of the content on the `website_sale` payment page. Prior to this PR, the terms & conditions was positioned using a `position-absolute` with a `bottom-0`, resulting in the element extending to the topside if its content is very long. This led to some overlapping issues with the others elements of the view. To prevent this issue to happen, we position the element with a `top-100` and remove the `<div>` that aimed to ha
Original PR description
This PR fixes an issues about the terms & conditions overlapping the rest of the content on the `website_sale` payment page. Prior to this PR, the terms & conditions was positioned using a…
This PR fixes an issues about the terms & conditions overlapping the rest of the content on the `website_sale` payment page. Prior to this PR, the terms & conditions was positioned using a `position-absolute` with a `bottom-0`, resulting in the element extending to the topside if its content is very long. This led to some overlapping issues with the others elements of the view. To prevent this issue to happen, we position the element with a `top-100` and remove the `<div>` that aimed to handle the spacing at the bottom. We now manage this spacing with a utility class. opw-4373853 | 17.0 | This PR | |--------|--------| | <img width="472" alt="image" src="https://github.com/user-attachments/assets/6b4b768f-9764-45aa-84b8-94fcab059f30" /> | <img width="461" alt="image" src="https://github.com/user-attachments/assets/5cd8548e-9b8f-4036-84dd-3f224779af27" /> | --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#191346
Steps to reproduce - Create a new report with studio - Chose "External Business header/footer" - Try to add a /heading1 below the header - Crash ``` UncaughtPromiseError > TypeError Uncaught Promise > Cannot read properties of null (reading 'parentNode') TypeError: Cannot read properties of null (reading 'parentNode') ``` As `startContainerChild` and `endContainerChild` refers to a dom element that can be changed in the for loop, we can declare both of them after. opw-4368425
Original PR description
Steps to reproduce - Create a new report with studio - Chose "External Business header/footer" - Try to add a /heading1 below the header - Crash ``` UncaughtPromiseError > TypeError Uncaught Promise > Cannot read properties of null (reading 'parentNode') TypeError: Cannot read properties of null (reading 'parentNode') ``` As `startContainerChild` and `endContainerChild` refers to a dom element that can be changed in the for loop, we can declare both of them after. opw-4368425 Forward-Port-Of: odoo/odoo#190191
Currently when we validate a transfer with products tracked by serial number, we may run into a bottleneck when the `quality_mrp` module is installed. That's because there's 1 move_line by Serial Number and inside `_create_assign_production_lot` those move_lines are grouped by `(company_id, product_id, lot_name)`. As we are tracking by Serial Number, each of these group key will be unique. Also, the mls are grouped in key_to_mls using `__union__` which calls `browse` to produce a recordset, effe
Original PR description
Currently when we validate a transfer with products tracked by serial number, we may run into a bottleneck when the `quality_mrp` module is installed. That's because there's 1 move_line by Serial…
Currently when we validate a transfer with products tracked by serial number, we may run into a bottleneck when the `quality_mrp` module is installed. That's because there's 1 move_line by Serial Number and inside `_create_assign_production_lot` those move_lines are grouped by `(company_id, product_id, lot_name)`. As we are tracking by Serial Number, each of these group key will be unique. Also, the mls are grouped in key_to_mls using `__union__` which calls `browse` to produce a recordset, effectively setting the `_prefetch_ids` of the results to `_ids`. Therefore, in the sml `write` override in quality_mrp when there's a condition on `self.sudo().check_ids`, the `_prefetch_ids` of self will only be the id in self, leading to 1 SELECT query by SML, i.e. 1 SELECT query by serial number. This wouldn't be that much of an issue if `quality_check.move_line_id` was properly indexed but that's not the case. So this commit first adds a missing `btree_not_null` index on `quality_check.move_line_id` to change the query plan from Seq Scan to Index Scan. Then we manually set the `_prefetch_ids` in `_create_and_assign_production_lot` to reduce the number of queries. #### speedup In a 17 database with 750 000 quality checks, on hot cache, adding the index makes a single query go from ~50ms to 0.250ms. When doing a transfer of 1000 serial numbers, setting the `_prefetch_ids` reduce the number of queries from 1000 to 1. This query takes around 120ms on hot cache without the index. Both with the index and the `_prefetch_ids`, the total time of the `_create_and_assign_production_lot` method when validating a transer of 1000 serial numbers goes from 50ms * 1000 = 50s -> 2ms * 1 = 2ms. opw-4285293 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#190479
**Issue:** When printing a Purchase Order or Quotation in a company using the Indonesian tax chart, a tax code (Indonesian tax description) appears instead of the tax percentage. **Steps to Reproduce:** 1- Ensure the company uses the Indonesian chart of accounts. - Install the l10n_id module. - Go to Settings > Taxes and set the Fiscal Country to Indonesia. 2- Navigate to Purchase and create a Purchase Order. 3- Add a product line and select an Indonesian tax (ex: 11%). 4- Print the
Original PR description
**Issue:** When printing a Purchase Order or Quotation in a company using the Indonesian tax chart, a tax code (Indonesian tax description) appears instead of the tax percentage. **Steps to…
**Issue:** When printing a Purchase Order or Quotation in a company using the Indonesian tax chart, a tax code (Indonesian tax description) appears instead of the tax percentage. **Steps to Reproduce:** 1- Ensure the company uses the Indonesian chart of accounts. - Install the l10n_id module. - Go to Settings > Taxes and set the Fiscal Country to Indonesia. 2- Navigate to Purchase and create a Purchase Order. 3- Add a product line and select an Indonesian tax (ex: 11%). 4- Print the Purchase Order. The printed Purchase Order displays the tax code (description) instead of the tax percentage. The same behavior occurs in the Sales module regarding quotation printing (see screenshots attached) <img src ="https://github.com/user-attachments/assets/08dd6940-e07e-4e44-9f03-85f8ae2e8914" width=300 /> <img src ="https://github.com/user-attachments/assets/a8d16f6c-c6a0-441f-8c3f-3546387fb4e6" width=300 /> opw-4333143 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#191367 Forward-Port-Of: odoo/odoo#187703
The domain for inverses is not always correct and may crash for computed fields. Resolve the `get_depends` using the `get_domain_list` whenever possible. task-4380712 odoo/enterprise#75965 *FIX for master* in https://github.com/odoo/odoo/pull/191351 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#191319
Original PR description
The domain for inverses is not always correct and may crash for computed fields. Resolve the `get_depends` using the `get_domain_list` whenever possible. task-4380712 odoo/enterprise#75965 *FIX for master* in https://github.com/odoo/odoo/pull/191351 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#191319