Daily updates from Odoo
Thursday, April 30, 2026
91 changes
21 changes
Resolved issues and error corrections
This update strengthens the security of Xendit payments by requiring a valid access token linked to the specific transaction being processed. Previously, payments could be executed without this verification, creating a potential risk. Now, payments are restricted to the correct transaction, improving data integrity and security.
Original PR description
**Description of the issue/feature this PR addresses:** The `/payment/xendit/payment` endpoint did not enforce validation of an access token tied to the transaction when processing direct payment requests. **Current behavior before PR:** The endpoint accepted public requests using only the transaction reference, allowing payment execution without verifying that the request was linked to the intended transaction. **Desired behavior after PR is merged:** The endpoint now requires a valid access_token associated with the transaction (reference) before processing. This ensures that payment execution is restricted to the correct transaction. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261912 Forward-Port-Of: odoo/odoo#260258
This update ensures the IRN (Invoice Reference Number) generated during E-Invoicing is correctly saved and displayed on the invoice itself, both in the PDF and the invoice form. Previously, the IRN was only present in the PDF but not on the invoice record, now it's consistently saved for easier tracking and reporting.
Original PR description
**Steps to reproduce:** * Install module *Indian - GSTR with E-invoice (l10n_in_edi_gstr)*. * Configure *Indian integration* with required credentials (E-Invoicing, E-Way bill, etc.). * Save the…
**Steps to reproduce:** * Install module *Indian - GSTR with E-invoice (l10n_in_edi_gstr)*. * Configure *Indian integration* with required credentials (E-Invoicing, E-Way bill, etc.). * Save the settings. * Create a *customer invoice*. * Post the invoice. * Send the invoice through *E-Invoicing (EDI)*. * Open the generated *Invoice PDF* and the *form view*. **Observed behavior:** * The *IRN number* is correctly present in the *Invoice PDF*. * However, it is *not saved/displayed* in the invoice form view. **Cause:** * The invoice flow did not store the *IRN number* on the invoice after receiving the EDI response, even though the value was available. **Fix:** * Inherit *_l10n_in_edi_send_invoice*. * Add a condition after the invoice is sent and the JSON response is received. * When the *IRN number* is present in the response, set it on the *l10n_in_irn_number* field of the invoice (in lower case). opw-6097923 Forward-Port-Of: odoo/enterprise#115522 Forward-Port-Of: odoo/enterprise#114350
This update fixes an issue where the leave balance report was incorrectly calculating employee leave accruals and balances, particularly when leaves were taken over multiple periods. The fix ensures accurate reporting by addressing timezone discrepancies and improving the calculation of overlapping leave allocations. This improves the reliability of leave tracking data.
Original PR description
__ISSUE__: - FIFO balance miscalculation for non-overlapping allocations. cumulative_allocated_days was partitioned globally by (employee, leave_type), but taken_per_allocation scoped leaves to each…
__ISSUE__:
- FIFO balance miscalculation for non-overlapping allocations. cumulative_allocated_days was partitioned globally by (employee, leave_type), but taken_per_allocation scoped leaves to each allocation's date range. This caused the FIFO formula to silently absorb leaves from one period into another's allocation capacity.
ex:
Alloc A (20 days) 2025, taken leaves 15 days
Alloc B (20 days) 2026, taken leaves 5 days
report: 2025: (15 taken), (5 left)
2026: (7 taken), (20 left)
- Left" rows shifted by one year in non-UTC timezones. Allocation date_from/date_to (Date fields) were cast to timestamp as midnight UTC. In negative-UTC /positive-UTC timezones midnight UTC of Dec 31 renders as the prev/next day.
__FIX__:
- detect overlap groups using a running MAX(date_to) and partition the cumulative sums within each overlap group. This way non-overlapping allocations are treated as independent, while overlapping or open-ended allocations still share FIFO within their group.
- offset allocation dates by 12 hours so no timezone can shift them across a day boundary.
- opw-5169606
- opw-5352114
Forward-Port-Of: odoo/odoo#259083
Forward-Port-Of: odoo/odoo#257873This update corrects a reporting issue within the GSTR-3B report for Indian companies using the '18% IGST (IMP-Service)' tax. The previous configuration resulted in the tax not being accurately reflected in the report. This fix ensures correct reporting of service taxes, aligning with Indian tax regulations.
Original PR description
**Steps to reproduce:** - Install l10n_in_reports - Switch to an Indian company (e.g. IN Company) - Create a bill with a Service product and "18% IGST (IMP-Service)" tax - Confirm the bill - Go to "Accounting / Reporting / India / GSTR-3B" **Issue:** In "4. (A) (2) Import of services" section of the report, the bill that has been created is not taken into account. **Cause:** The "18% IGST (IMP-Service)" tax has a distribution of: * 100% of the tax in "100570" account with "IGST" tax tag * -100% of the tax in same account with "IGST" tax tag Therefore, both distribution lines with the tax tag cancel themselves. opw-6116356 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#260631
This update resolves a bug that prevented users from scheduling rental tours correctly. Previously, attempts to set times in the past would cause scheduling errors. The fix ensures tours always use valid, future dates and times, improving the reliability of the rental booking process.
Original PR description
Since 605c8b47d52854e36c7cb822ccb2d40de44c4c3c, rourly rental products default to a rental period starting at the next hour of the current day. Tours override the time of the rental period, but not the date. If the tours tries to set a time which is in the past, the datepicker will discard the time, breaking the tour. Scenario: Running the tour between 11am-11:59am breaks test_website_sale_renting_ui: - Product page shows default times: today 12pm (start) to 1pm (end) - Tour tries to set start time to 8am - Datepicker rejects 8am (it's before the current time 11am-11:59am) and keeps 12pm - Tour then sets end time to 12pm, resulting in equal start and end times - Equal times are invalid, cart addition fails, tour breaks This commit, extracts the existing utility function into a shared helper that returns a guaranteed future date (next Monday + offset), ensuring tours always set valid times regardless of when they run. runbot-243459
This update resolves an issue where multi-company invoices were experiencing errors due to incorrect tax calculations. The change ensures tax information is handled securely, preventing crashes when products from different companies are involved. This improves the reliability of invoicing for businesses using Odoo's multi-company functionality.
Original PR description
Description of the issue this commit addresses: In multi-company setups, invoice line tax recomputation could read product or account taxes in user context and trigger an AccessError on account.tax when products carry taxes from another company. Desired behavior after this commit is merged: This patch hardens account.move.line tax recomputation paths by reading tax M2M values in sudo and returning filtered results in normal env, so compute logic no longer crashes on cross-company tax records. Ticket [link](https://www.odoo.com/odoo/project.task/6036638) opw-6036638 Forward-Port-Of: odoo/odoo#260948
This update resolves an issue where backorder returns weren't properly associated with the original delivery. The change ensures that when a backorder is created from a return, the return's ID is correctly set, allowing for accurate tracking and reporting of returned items within the delivery context. This improves inventory accuracy and reporting.
Original PR description
### Steps to reproduce: - Create, confirm and validate a delivery for 2 units of a product A - Click Return > Return All - Validate the return for 1 unit and backorder #### > The backorder does not belong to the return list of the delivery ### Cause of the issue: Backorder pickings are created by copying the picking to backorder: https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L1580-L1593 https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L1571-L1578 However, the `return_id` is a `copy=False` field that is not manully set during this copy process: https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L558 opw-6111544 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261831 Forward-Port-Of: odoo/odoo#259804
This update resolves an issue where users could unintentionally bypass tax group restrictions when changing Argentinian fiscal packages. The system now explicitly checks for a 'force_delete' flag, ensuring that tax group deletions are handled correctly and restoring the previous behavior. This prevents data inconsistencies and maintains the integrity of Argentinian tax reporting.
Original PR description
Commit 947e4dc9de3a replaced MODULE_UNINSTALL_FLAG with an explicit 'force_delete' context flag, and as the commit message warns, callees that relied on the previous flag must now detect 'force_delete' on their own. There is no automatic bypass anymore. **STEP TO REPRODUCE** 1.- Install l10n_ar 2-. Select one argentinian regime (fiscal package) & save 3-. Try to change package **FIX** Detect 'force_delete' in check_uninstall_required and return early, restoring 19.0 behavior. Manual deletions of the tax group are still blocked. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261561
This update enhances the visual clarity of form fields by ensuring consistent styling for required, readonly, invalid, and focused states. The changes prioritize clear indication of the active field and improve overall usability. This ensures users can easily identify and interact with the correct fields within the application.
Original PR description
Before this commit, the focus style wasn't applied on a required field. We now have improved consistency across field states and their visual design. Here’s how to visually distinguish each field state: **Required**: the border is more prominent **Readonly**: the label is greyed out (as well as the background color) **Invalid**: the background color is red **Focused**: the border color is green We no longer want to change the label color for simplicity. For example, if you see a thicker green border with a greyed-out background, it means the field is **focused**, **readonly**, and **required**. Note: the "invalid" style is removed when the field receives focus. We chose not to support this combination. 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
This update resolves an issue where generating timesheets would produce errors when a previously employed employee was archived and a related holiday was still active. The fix prevents timesheet generation from considering time off requests for archived employees, ensuring accurate timesheet calculations. This improves data integrity and prevents potential reporting discrepancies.
Original PR description
[FIX] project_timesheet_holidays: Exclude archived employees from time-off # Description of the issue/feature this PR addresses: ## Steps to Reproduce: 1. Create a time off for Employee A (it should…
[FIX] project_timesheet_holidays: Exclude archived employees from time-off # Description of the issue/feature this PR addresses: ## Steps to Reproduce: 1. Create a time off for Employee A (it should affect the timesheets). 2. Create a new public holiday (global time off) that overlaps with Employee A’s time off. 3. Archive Employee A. 4. Delete the public holiday created in step 2. 5. An error related to timesheet generation appears. ## Expected Behavior: - The public holiday / global time off should be deleted without any error. # Desired behavior after PR is merged: ## Fix (Implemented): When regenerating timesheets due to changes in holidays or time off, leaves related to archived employees should not be taken into account. A check was added inside the `_generate_timesheets` function in `project_timesheet_holidays/models/hr_holidays.py` to exclude leaves belonging to archived employees. ## Alternative Fix (Not Implemented): Instead of filtering out leaves linked to archived employees, we could delete those leaves when an employee is archived. However, this approach is not ideal, as archived employees may be reactivated later and would still need their previously requested time off to be preserved. ## Version: This bug appears in both version 17.0 and 19.0. I assumed that it also appears in 18.0 but didn't directly test ## Task: [5474038](https://www.odoo.com/odoo/project/4105/tasks/5474038) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261909 Forward-Port-Of: odoo/odoo#244203
This update fixes a discrepancy in the sale details report by accurately reflecting cash rounding adjustments. Now, the report displays the total cash rounding applied during a session, ensuring a more precise representation of sales transactions, especially when cash payments are involved. This improves reporting accuracy and provides a clearer picture of financial data.
Original PR description
The sale details report total_paid was computed from sum(order.amount_total), which does not include the cash rounding adjustment. This caused a discrepancy between the displayed total and the sum of individual payment lines when cash rounding is enabled. Use the sum of actual payment amounts instead, which naturally includes cash rounding since payments are recorded with their rounded values. opw-5253018 Forward-Port-Of: odoo/odoo#261884 Forward-Port-Of: odoo/odoo#254401
This update fixes an issue where byproducts added directly to manufacturing orders weren't correctly linked to the stock moves, preventing accurate tracking of origin. The change ensures byproducts added through the MO are properly associated with stock movements, resolving a discrepancy in location data. This improves the reliability of production tracking.
Original PR description
When we add a byproduct followed by SN directly in the MO it will not have the its location as production. Steps to reproduce: ------------------- * Create product tracked by Serial number * Create a…
When we add a byproduct followed by SN directly in the MO it will not have the its location as production. Steps to reproduce: ------------------- * Create product tracked by Serial number * Create a Manufacturing order * Add the Product tracked by serial number on the MO as byproduct * Confirm the MO * Go to shop floor * Add the by-product quantity and create a new serial number. * Close production and go back to the MO in manufacturing * Open stock moves -> the by-product does not have "production" for origin Observation: ------------- When we add the byproduct directly in the MO, they will be added to move_byproduct_ids in the MO but not in byproduct_ids on the stock.move because byproduct_ids it's a [link](https://github.com/odoo/odoo/blob/d14bf6289da21065860ff959185c47b947a7418c/addons/mrp/models/stock_move.py#L50-L52) between the stock.move and the BOM. When adding the byproduct in shopfloor, it will create the quant: https://github.com/odoo/enterprise/blob/06be616bb4d74f0a089e8e318d25c2424594f813/mrp_workorder/static/src/mrp_display/mrp_record_line/stock_move.js#L163-L171 Additionaly when creating the quant it will decide the source location depending if the product its a byproduct: https://github.com/odoo/enterprise/blob/1d10ee238a50e7bdb552efdeafc068c5127cd49a/mrp_workorder/static/src/mrp_display/mrp_record_line/stock_move.js#L189-L192 The issue arise because it check if the product it's a byproduct by checking byproduct_ids and since our product was added directly on the MO and not from the BOM it will not appear in byproduct_ids https://github.com/odoo/enterprise/blob/dc5bb0fe8e15063f977970841bdaf8aff1a61e41/mrp_workorder/static/src/mrp_display/mrp_record_line/stock_move.js#L108-L110 #### Additional notes: The default value for [byproduct_id](https://github.com/odoo/odoo/blob/abb5777cc8324cff0cdf841a8ae42413060dcf92/addons/mrp/models/mrp_production.py#L1263) when creating the stock move is false opw-5974582 Forward-Port-Of: odoo/enterprise#110122
This update fixes an issue where the ewallet discount was incorrectly included in delivery calculations. The change adjusts the pricing logic to accurately exclude ewallet amounts from delivery costs, ensuring consistent and accurate shipping charges for customers. This improves the overall customer experience and billing accuracy.
Original PR description
Issue: --- Ewallet line is included in delivery pricing. Steps to reproduce: 1- Create a delivery method `based on rules`. 2- In pricing set rules: - price <= 99 => delivery price = 30 - price > 99…
Issue: --- Ewallet line is included in delivery pricing. Steps to reproduce: 1- Create a delivery method `based on rules`. 2- In pricing set rules: - price <= 99 => delivery price = 30 - price > 99 => delivery price = 50 3- Create a eWallet with balance = 200. 4- Create a SO add a line with product. Set the SOL unit amount to 100. 5- Click on `add a shipping`. Add the created delivery method. 6- As you see, the delivery amount is correctly calculated. 7- Now apply the eWallet using `reward` button. 8. Update the shipping cost. The shipping cost is 30, which is not expected. Cause: --- In calculation of shipping amount the ewallet is not taken into account. Even though technically it's considered a discount, ewallet is not functionally the same as discount. However, in `_get_price_available` we cannot have information about `ewallet` lines as it doesn't depend on `sale_loyalty`. Fix: --- We use `_compute_amount_total_without_delivery` which is overridden in `sale_loyalty_delivery` to exclude ewallet and gift cards. opw-6124209 Forward-Port-Of: odoo/odoo#260134
This update fixes an error in the Datev general ledger export that resulted in incorrect tax rates. The issue stemmed from how multiple tax repartition lines were handled, leading to amounts being replaced instead of added. This ensures accurate tax reporting for Datev customers.
Original PR description
With l10n_de_reports: - Configure a foreign currency with an exchange rate. - Configure a tax with multiple repartition lines. - Create a vendor bill in this foreign currency with this tax. - In the general ledger export the datev csv. In the datev csv the rate is wrong. In the method _l10n_de_datev_get_csv, we build a tax_amount dict. However when one tax has multiple lines, the amount is replaced and not added. opw-6010097 Forward-Port-Of: odoo/enterprise#115535 Forward-Port-Of: odoo/enterprise#110453
This update corrects a display issue on rental product pages when 'continue selling' is enabled. Previously, the available quantity was incorrectly shown as 2 regardless of the rental period. The fix ensures the quantity accurately reflects the remaining availability based on the selected rental timeframe, improving the customer experience.
Original PR description
**Issue**: The displayed available quantity on the ecommerce product page is incorrect for rental products when "continue selling" is enabled. **Steps to reproduce**: - Create a rental product…
**Issue**: The displayed available quantity on the ecommerce product page is incorrect for rental products when "continue selling" is enabled. **Steps to reproduce**: - Create a rental product tracked in stock with a quantity of 5 - Enable "continue selling" and "show available quantity below 10" - Go to the ecommerce page of this product - Rent 3 units for a given period, confirm and pay - Return to the ecommerce product page -> Whatever the selected renting period, the displayed quantity is always 2 **Cause**: The website displays `free_qty`: https://github.com/odoo/enterprise/blob/41c729e22c5fd1abb690f8335e933f793be0b319/website_sale_stock_renting/static/src/xml/website_sale_stock_renting_product_availability.xml#L15 `free_qty` is computed in: https://github.com/odoo-dev/odoo/blob/0935829ddaecd7b2b6eec9157f8f790b546d06ff/addons/website_sale_stock/models/product_template.py#L36 which leads to: https://github.com/odoo/enterprise/blob/41c729e22c5fd1abb690f8335e933f793be0b319/website_sale_stock_renting/models/website.py#L10 and ultimately relies on: https://github.com/odoo/odoo/blob/37bf1703c7478a3010b71cd60bbb43b3295a605b/addons/stock/models/product.py#L213 This computation does not take the selected renting period into account. There is a period-aware computation here: https://github.com/odoo/enterprise/blob/41c729e22c5fd1abb690f8335e933f793be0b319/website_sale_stock_renting/models/website.py#L15C17-L21C1 but it is only triggered when `product.allow_out_of_stock_order` is False (i.e. when "continue selling" is disabled). opw-[5354163](https://www.odoo.com/web#id=5354163&view_type=form&model=project.task) Forward-Port-Of: odoo/enterprise#108493 Forward-Port-Of: odoo/enterprise#103333
This update resolves an issue impacting the accuracy of real margin reports within the Odoo system. The changes adjust the report's structure to ensure correct aggregation of data, leading to more reliable margin calculations. This improves the financial reporting capabilities for sales teams.
Original PR description
Adjust the real margins pivot report structure --- task-6168613
This update resolves a bug that prevented users without project access from correctly linking project values to sales quotations or rental orders. The change uses a temporary access method to ensure project information is included, allowing for accurate order creation even without direct project permissions. This improves the functionality of the sales and rental processes.
Original PR description
Before this commit if a lead is converted into either of sales quotation or rental quotation, if the user doesnt have access to project but has access to sales and CRM, it throws a error to read the project. Rationale: - Even when there is no access to project, it is neccesary for the project value to be linked in the suqsequent quotation or rental order. So using a sudo to to read the value and assigning it as a default value is neccessary.
This update fixes a potential timeout issue in the website builder when users upload multiple images simultaneously. Previously, a 10-second timeout would trigger errors, but this change allows builder actions to remain active until image uploads are complete, improving the user experience and preventing frustrating errors.
Original PR description
Steps to reproduce: 1.Drop a gallery slider 2.Add multiple images at the same time 3.Wait more than 10 seconds before finalizing uploads 4.A toaster error is displayed Before this change: Builder actions relying `this.dependencies.media.openMediaDialog` inside their `apply` method could time out while the media dialog was still open. This was due to OperationPlugin enforcing a default 10s timeout, even when the user was still interacting with the dialog (e.g., selecting or uploading images).(see PR[1]) After this change: The timeout is disabled by using `this.canTimeout = false` for actions that open the media dialog using apply method, ensuring they remain active until the media dialog completes and preventing false timeout errors. [1]:https://github.com/odoo/odoo/pull/233079 task-6131455
This update fixes an issue impacting how sales advantages are calculated. Specifically, discounts are now excluded from these calculations, ensuring more accurate and reliable advantage reporting. This change improves the accuracy of sales performance analysis.
Original PR description
for the computation of advantages. Only exclude rewards of type discount for the advantage calculation. opw-6159239
This update fixes a slow performance issue that occurred when searching for stock quantities based on certain product selections. Previously, the system would fetch all available quantities regardless of a specified limit, leading to delays. Now, the system respects the limit defined in the search criteria, resulting in significantly faster response times.
Original PR description
## Problem: During an `onchange` call, if a field is defined in the `fields_spec` with a `limit` attribute, the `fetch` method doesn't respect it, and will fetch all records satisfying the domain. In…
## Problem: During an `onchange` call, if a field is defined in the `fields_spec` with a `limit` attribute, the `fetch` method doesn't respect it, and will fetch all records satisfying the domain. In certain circumstances, this leads to slow requests. ## Solution: Enforce the `limit` when fetching if it is present. ## Steps to reproduce: - Have a product with many quant records 1. Open a picking for this product in Barcode 2. Change the lot/serial The frontend will send an `onchange` request that includes `product_stock_quant_ids` in the `fields_spec` (with default `limit` 40). Odoo will fetch all quants for this product regardless of the limit, and the request will take a while to resolve. ## Benchmark: <table> <thead> <tr> <th># of quants</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>17193</td> <td>~9s</td> <td>~400ms</td> </tr> </tbody> </table> opw-6041705 Forward-Port-Of: odoo/odoo#261904 Forward-Port-Of: odoo/odoo#259983
This update resolves a bug that prevented users from scheduling rental tours correctly. Previously, attempts to set times in the past were rejected, leading to broken booking processes. The fix ensures tours always use valid, future dates, improving the reliability of the rental booking experience.
Original PR description
Since 605c8b47d52854e36c7cb822ccb2d40de44c4c3c, rourly rental products default to a rental period starting at the next hour of the current day. Tours override the time of the rental period, but not the date. If the tours tries to set a time which is in the past, the datepicker will discard the time, breaking the tour. Scenario: Running the tour between 11am-11:59am breaks test_website_sale_renting_ui: - Product page shows default times: today 12pm (start) to 1pm (end) - Tour tries to set start time to 8am - Datepicker rejects 8am (it's before the current time 11am-11:59am) and keeps 12pm - Tour then sets end time to 12pm, resulting in equal start and end times - Equal times are invalid, cart addition fails, tour breaks This commit, extracts the existing utility function into a shared helper that returns a guaranteed future date (next Monday + offset), ensuring tours always set valid times regardless of when they run. runbot-243459
15 changes
Resolved issues and error corrections
This update fixes a critical issue where gift cards and e-wallets could be reused after being refunded, leading to potential misuse. It now prevents refunds and ensures order lines are created correctly when products are linked to multiple loyalty programs, improving program accuracy and preventing data inconsistencies.
Original PR description
Previously, it was possible to refund a gift card or e-wallet after creation. However, the associated code remained usable, allowing the gift card or e-wallet to be reused, which is not the expected behavior. To address this, refunds for gift cards and e-wallets are now prevented. Additionally, when a product is part of the trigger products for multiple gift card or e-wallet programs, it was not possible to create separate order lines for the same product with different programs selected. The second line was merged into the first. A condition has been added to prevent merging when different programs are selected. --- Task: https://www.odoo.com/odoo/project/1737/tasks/6052281 Forward-Port-Of: odoo/odoo#261647 Forward-Port-Of: odoo/odoo#256896
This update strengthens the security of Xendit payments by requiring a valid access token linked to the specific transaction. Previously, payments could be processed without this verification, creating a potential risk. Now, payments are restricted to the correct transaction, improving security and preventing unauthorized payments.
Original PR description
**Description of the issue/feature this PR addresses:** The `/payment/xendit/payment` endpoint did not enforce validation of an access token tied to the transaction when processing direct payment requests. **Current behavior before PR:** The endpoint accepted public requests using only the transaction reference, allowing payment execution without verifying that the request was linked to the intended transaction. **Desired behavior after PR is merged:** The endpoint now requires a valid access_token associated with the transaction (reference) before processing. This ensures that payment execution is restricted to the correct transaction. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261912 Forward-Port-Of: odoo/odoo#260258
This update resolves an issue where the 'Remove Format' function would get stuck in an infinite loop when used with icons and background colors in the To-do app. The fix ensures that icons are correctly processed during format removal, preventing the loop and restoring normal functionality.
Original PR description
Steps to reproduce: =================== 1. Open the To-do app and pick any task. 2. In the description add text and an icon with a bg color. `(you can add this: <i class="fa rounded rounded-circle…
Steps to reproduce: =================== 1. Open the To-do app and pick any task. 2. In the description add text and an icon with a bg color. `(you can add this: <i class="fa rounded rounded-circle fa-user bg-o-color-1 fa-4x" contenteditable="false"></i>)` 3. Select all and click "Remove format". Result: -> Traceback due to an infinite loop. Cause: ====== Remove format calls `removeAllColor()`, which loops forever at: https://github.com/odoo/odoo/blob/626bde21a25366d0bb29662bae2057c247a1638e/addons/html_editor/static/src/main/font/color_plugin.js#L194-L194 Why: _applyColor doesn't remove the icon's background class, so hasAnySelectedNodeColor keeps returning true and the removal loop never terminates. This happens because `font` is already the `<i>` element with the `fa` class, using `querySelectorAll` on it won't include the element itself, so the icon is never checked or updated. https://github.com/odoo/odoo/blob/6cdc6f55886ea48e90f9023a6c6142bf072745b9/addons/html_editor/static/src/main/font/color_plugin.js#L290 Solution: ========= Check if the font itself has the fa class before doing the `querySelectorAll`, and include it in the nodes to check for color. Test Impact: ============ Before this fix, a `<span>` containing an icon was wrapped in a `<font>` when applying color, treating the icon as a normal span (without size) instead of applying the color directly. https://github.com/odoo/odoo/blob/8792c2d38eb0aadac8d778d83fd76f270404ecd5/addons/html_editor/static/src/main/font/color_plugin.js#L397 opw-5928627 Forward-Port-Of: odoo/odoo#261405 Forward-Port-Of: odoo/odoo#248449
This update corrects a reporting issue within the GSTR-3B report for Indian companies using the '18% IGST (IMP-Service)' tax. Previously, the report incorrectly excluded bills with this tax. The fix adjusts the tax distribution to ensure accurate reporting of IGST liabilities, resolving a discrepancy in import of services.
Original PR description
**Steps to reproduce:** - Install l10n_in_reports - Switch to an Indian company (e.g. IN Company) - Create a bill with a Service product and "18% IGST (IMP-Service)" tax - Confirm the bill - Go to "Accounting / Reporting / India / GSTR-3B" **Issue:** In "4. (A) (2) Import of services" section of the report, the bill that has been created is not taken into account. **Cause:** The "18% IGST (IMP-Service)" tax has a distribution of: * 100% of the tax in "100570" account with "IGST" tax tag * -100% of the tax in same account with "IGST" tax tag Therefore, both distribution lines with the tax tag cancel themselves. opw-6116356 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#260631
This update resolves an issue where multi-company invoice calculations were failing due to incorrect tax access permissions. The change ensures tax calculations are performed securely, regardless of the company context, preventing errors and improving invoice processing reliability.
Original PR description
Description of the issue this commit addresses: In multi-company setups, invoice line tax recomputation could read product or account taxes in user context and trigger an AccessError on account.tax when products carry taxes from another company. Desired behavior after this commit is merged: This patch hardens account.move.line tax recomputation paths by reading tax M2M values in sudo and returning filtered results in normal env, so compute logic no longer crashes on cross-company tax records. Ticket [link](https://www.odoo.com/odoo/project.task/6036638) opw-6036638 Forward-Port-Of: odoo/odoo#260948
This update fixes an issue where backorders created from returns weren't properly associated with the original return. Previously, the system didn't correctly set a link between the backorder and the return, leading to reporting discrepancies. This change ensures that backorders generated from returns are accurately tracked within the return process.
Original PR description
### Steps to reproduce: - Create, confirm and validate a delivery for 2 units of a product A - Click Return > Return All - Validate the return for 1 unit and backorder #### > The backorder does not belong to the return list of the delivery ### Cause of the issue: Backorder pickings are created by copying the picking to backorder: https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L1580-L1593 https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L1571-L1578 However, the `return_id` is a `copy=False` field that is not manully set during this copy process: https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L558 opw-6111544 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261831 Forward-Port-Of: odoo/odoo#259804
This update resolves an issue preventing the MPESA payment method from correctly processing transactions initiated by Safaricom. It disables CSRF checks on callback endpoints and ensures URLs use HTTPS, addressing a common error related to invalid URLs. Additionally, the code now incorporates a 'till number' for transactions, improving data accuracy.
Original PR description
1. The `MPESA` payment method needs a callback url where it does a `POST` request with the transaction details. Since the call comes from safaricom, CSRF will block those requests. This commit will…
1. The `MPESA` payment method needs a callback url where it does a `POST` request with the transaction details. Since the call comes from safaricom, CSRF will block those requests. This commit will disable CSRF checks on the callback endpoints which are expected to be called from an external service 2. Sometimes the `web.base.url` parameter is automatically set to http. But safaricom expects https for all the urls. So we need to ensure that the urls we send on `lipa_na_mpesa_register_urls` use https, otherwise the registration fails with an `invalid url` error. Additionally, I added the error message in case of error 4. In addition to the business short code we also need a till number for transactions. Since this is stable, I've added the till number as an extension of the business shortcode field and then parse it before usage. On master there is a new PR which will properly separate the fields Task-[6045833](https://www.odoo.com/odoo/project/1737/tasks/6045833) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#254993
This update resolves an issue where unreconciling bank statements with batch payments would unexpectedly revert invoices to draft due to approval checks triggered by third-party modules. The fix allows for the necessary repost to occur even when approvals are pending, preventing users from needing to manually re-enter data. This ensures smoother reconciliation processes.
Original PR description
When unreconciling a batch payment from a bank statement line, delete_reconciled_line() resets the linked invoice to draft to recompute its amount_residual, then re-posts it. If a third-party module…
When unreconciling a batch payment from a bank statement line, delete_reconciled_line() resets the linked invoice to draft to recompute its amount_residual, then re-posts it. If a third-party module (e.g. Studio Approvals) silently rejects action_post for the current user, the invoice stays in draft and the user has to redo the work manually. This internal repost is not a business action, the move was already approved when initially posted, so it can run as sudo to bypass approval checks. Steps to reproduce: 1. Add a Studio Approval rule on account.move.action_post with an approver other than the current user 2. As a user without that approval right, post a vendor bill and register a payment 3. Add the payment to a batch payment 4. Reconcile a bank statement line with the batch payment 5. With the user without approval rights, try to unreconcile the bank statement line (delete_reconciled_line) - Expected: the bill stays Posted. - Actual (before fix): the bill silently rolls back to Draft because action_post is rejected by the approval hook. opw-6121448 Forward-Port-Of: odoo/enterprise#115341 Forward-Port-Of: odoo/enterprise#115241
This update fixes a discrepancy in the sale details report by accurately reflecting cash rounding adjustments. Now, the report displays the total cash rounding applied during a session, aligning the displayed total with actual payment amounts. This ensures greater accuracy and transparency in sales reporting.
Original PR description
The sale details report total_paid was computed from sum(order.amount_total), which does not include the cash rounding adjustment. This caused a discrepancy between the displayed total and the sum of individual payment lines when cash rounding is enabled. Use the sum of actual payment amounts instead, which naturally includes cash rounding since payments are recorded with their rounded values. opw-5253018 Forward-Port-Of: odoo/odoo#261884 Forward-Port-Of: odoo/odoo#254401
This update fixes an issue where the Datev export CSV incorrectly reported tax rates when a vendor bill used multiple tax repartition lines. The fix ensures that all tax amounts are accurately included in the CSV, improving the reliability of financial data exports to Datev.
Original PR description
With l10n_de_reports: - Configure a foreign currency with an exchange rate. - Configure a tax with multiple repartition lines. - Create a vendor bill in this foreign currency with this tax. - In the general ledger export the datev csv. In the datev csv the rate is wrong. In the method _l10n_de_datev_get_csv, we build a tax_amount dict. However when one tax has multiple lines, the amount is replaced and not added. opw-6010097 Forward-Port-Of: odoo/enterprise#115535 Forward-Port-Of: odoo/enterprise#110453
This update resolves an issue preventing users from switching between company localization types (Companies vs. Associations & Foundations) for Belgian businesses. The fix clears references to old accounts within cash rounding settings, allowing the localization switch to complete without errors. This ensures accurate reporting and functionality for Belgian clients.
Original PR description
### Issue before this commit: Switching the fiscal localization of a Belgian company from "Companies" to "Associations and Foundations" caused a traceback during the chart reload process. The…
### Issue before this commit:
Switching the fiscal localization of a Belgian company from "Companies" to "Associations and Foundations" caused a traceback during the chart reload process. The operation failed because some accounts from the previous localization could not be deleted.
### Steps to reproduce the issue:
1. Download Accounting
2. Create a new Belgian company
3. Switch to that company
4. Go into Settings -> Fiscal Localization
5. Switch to Associations and Foundations
6. Traceback: The operation cannot be completed: Another model is using the record you are trying to delete. The troublemaker is: 'Account Cash Rounding' (account.cash.rounding). Thanks to the following constraint: 'Profit Account' (profit_account_id). How about archiving the record instead?
### Cause of the issue:
The Belgian localization creates a default cash rounding method ("Round to 0.05") linked to specific profit and loss accounts. When switching localization, it was tried to delete the old chart of accounts, but these accounts are still referenced by account.cash.rounding through profit_account_id and loss_account_id, which use ondelete='restrict'. This prevents account deletion and blocks the localization change. Commit that caused the issue: https://github.com/odoo/odoo/commit/412fc9bed36645dd950c9a60d9b6ffdd9b4bce67
### Reason to introduce the fix:
Before reloading the Belgian chart template, the fix clears the profit_account_id and loss_account_id on the existing cash rounding records. This removes the blocking references, allows the old accounts to be deleted safely, and lets the fiscal localization switch complete successfully without affecting existing cash rounding configurations.
opw-6050537
Forward-Port-Of: odoo/odoo#260145This update resolves a bug where editing previously edited messages caused unexpected behavior like selecting the "(edited)" label and losing content after saving. The fix removes the "(edited)" span from the editor's content, ensuring correct editing functionality and a smoother user experience.
Original PR description
When editing an already-edited message, the `(edited)` span was included in the editor's editable content because `prepareBodyForEditing` (formerly `getNonEditableMentions`) passed the raw body…
When editing an already-edited message, the `(edited)` span was included in the editor's editable content because `prepareBodyForEditing` (formerly `getNonEditableMentions`) passed the raw body directly to the composer. This caused two issues: - CTRL+A would select the `(edited)` label, allowing it to be styled, repositioned, or accidentally deleted. - CTRL+A + Backspace + retype left the body empty after saving, because the self-closing `<span class="o-mail-Message-edited"/>` in the stored HTML was parsed by browsers as an open tag (spans are not void elements), swallowing subsequent content as its children. Fix: strip `.o-mail-Message-edited` from the body before loading it into the editor. The server always re-appends a fresh `(edited)` span at the end when saving, so removing it from the editor content is safe and correct. Also align the mock server with the real server behavior: - Place the span *inside* the last `div`/`p` element instead of after it. Rename `getNonEditableMentions` → `prepareBodyForEditing` to reflect that the function now covers both making mentions non-editable and stripping the edited label. task-6172161 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update fixes an issue where combo products weren't consistently ordered according to their choices, leading to incorrect item sequences in sales orders. The fix ensures combo items are always displayed in the intended order defined by the combo selection, improving the accuracy and reliability of the point-of-sale system.
Original PR description
When creating a combo product, its items were not ordered according to the combo choice sequence, and extra items were always appended at the end. As a result, combo items could appear in the wrong order. This fix ensures that, when computing combo prices and merging combo items with extra items before creating the order lines, the correct sequence is derived from the parent product. All items are then sorted based on this sequence so that they consistently follow the order defined by the combo choices. --- Task: https://www.odoo.com/odoo/project/1737/tasks/6064642 Forward-Port-Of: odoo/odoo#261633 Forward-Port-Of: odoo/odoo#255596
This update resolves a performance issue where changing a product's lot/serial in a stock picking could trigger slow requests due to Odoo fetching all stock quantities without respecting a defined limit. The fix ensures that the system respects the limit during these onchange calls, resulting in significantly faster response times.
Original PR description
## Problem: During an `onchange` call, if a field is defined in the `fields_spec` with a `limit` attribute, the `fetch` method doesn't respect it, and will fetch all records satisfying the domain. In…
## Problem: During an `onchange` call, if a field is defined in the `fields_spec` with a `limit` attribute, the `fetch` method doesn't respect it, and will fetch all records satisfying the domain. In certain circumstances, this leads to slow requests. ## Solution: Enforce the `limit` when fetching if it is present. ## Steps to reproduce: - Have a product with many quant records 1. Open a picking for this product in Barcode 2. Change the lot/serial The frontend will send an `onchange` request that includes `product_stock_quant_ids` in the `fields_spec` (with default `limit` 40). Odoo will fetch all quants for this product regardless of the limit, and the request will take a while to resolve. ## Benchmark: <table> <thead> <tr> <th># of quants</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>17193</td> <td>~9s</td> <td>~400ms</td> </tr> </tbody> </table> opw-6041705 Forward-Port-Of: odoo/odoo#261904 Forward-Port-Of: odoo/odoo#259983
This update resolves an issue where printers connected as IoT devices weren't correctly loaded within the Point of Sale system. Previously, these printers were unusable. This change ensures all printers, regardless of their IoT connection, are properly integrated into the PoS workflow.
Original PR description
preparation printers were not loaded in PoS as IoT devices making them unusable. Forward-Port-Of: odoo/enterprise#115768
13 changes
Resolved issues and error corrections
This update fixes a performance issue where updating a product's lot or serial number in a picking could trigger slow requests due to fetching all stock quantities. The change ensures that the system respects the specified limit when retrieving quantities, resulting in significantly faster update times. This improves the overall responsiveness of the barcode picking process.
Original PR description
## Problem: During an `onchange` call, if a field is defined in the `fields_spec` with a `limit` attribute, the `fetch` method doesn't respect it, and will fetch all records satisfying the domain. In certain circumstances, this leads to slow requests. ## Solution: Enforce the `limit` when fetching if it is present. ## Steps to reproduce: - Have a product with many quant records 1. Open a picking for this product in Barcode 2. Change the lot/serial The frontend will send an `onchange` request that includes `product_stock_quant_ids` in the `fields_spec` (with default `limit` 40). Odoo will fetch all quants for this product regardless of the limit, and the request will take a while to resolve. ## Benchmark: <table> <thead> <tr> <th># of quants</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>17193</td> <td>~9s</td> <td>~400ms</td> </tr> </tbody> </table> opw-6041705 Forward-Port-Of: odoo/odoo#259983
This update strengthens the security of Xendit payments by requiring a valid access token linked to the specific transaction. Previously, payments could be processed without this verification, creating a potential risk. Now, payments are restricted to the correct transaction, improving security and preventing unauthorized payments.
Original PR description
**Description of the issue/feature this PR addresses:** The `/payment/xendit/payment` endpoint did not enforce validation of an access token tied to the transaction when processing direct payment requests. **Current behavior before PR:** The endpoint accepted public requests using only the transaction reference, allowing payment execution without verifying that the request was linked to the intended transaction. **Desired behavior after PR is merged:** The endpoint now requires a valid access_token associated with the transaction (reference) before processing. This ensures that payment execution is restricted to the correct transaction. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261912 Forward-Port-Of: odoo/odoo#260258
This update corrects a reporting issue where the '18% IGST (IMP-Service)' tax wasn't accurately reflected in the GSTR-3B report. The fix adjusts how tax distributions are handled, ensuring the correct service tax amount is imported. This ensures accurate tax reporting for Indian businesses.
Original PR description
**Steps to reproduce:** - Install l10n_in_reports - Switch to an Indian company (e.g. IN Company) - Create a bill with a Service product and "18% IGST (IMP-Service)" tax - Confirm the bill - Go to "Accounting / Reporting / India / GSTR-3B" **Issue:** In "4. (A) (2) Import of services" section of the report, the bill that has been created is not taken into account. **Cause:** The "18% IGST (IMP-Service)" tax has a distribution of: * 100% of the tax in "100570" account with "IGST" tax tag * -100% of the tax in same account with "IGST" tax tag Therefore, both distribution lines with the tax tag cancel themselves. opw-6116356 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#260631
This update resolves an issue where multi-company invoices were experiencing errors due to incorrect tax calculations. The change ensures that tax data is handled securely, preventing access errors when products from different companies are involved. This improves invoice processing reliability for businesses using Odoo's multi-company feature.
Original PR description
Description of the issue this commit addresses: In multi-company setups, invoice line tax recomputation could read product or account taxes in user context and trigger an AccessError on account.tax when products carry taxes from another company. Desired behavior after this commit is merged: This patch hardens account.move.line tax recomputation paths by reading tax M2M values in sudo and returning filtered results in normal env, so compute logic no longer crashes on cross-company tax records. Ticket [link](https://www.odoo.com/odoo/project.task/6036638) opw-6036638 Forward-Port-Of: odoo/odoo#260948
This update resolves an issue where backorders created from returns weren't properly associated with the original return. The fix ensures the `return_id` is correctly set during the backorder creation process, allowing for accurate tracking and reporting of returned items. This improves the reliability of our inventory management system.
Original PR description
### Steps to reproduce: - Create, confirm and validate a delivery for 2 units of a product A - Click Return > Return All - Validate the return for 1 unit and backorder #### > The backorder does not belong to the return list of the delivery ### Cause of the issue: Backorder pickings are created by copying the picking to backorder: https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L1580-L1593 https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L1571-L1578 However, the `return_id` is a `copy=False` field that is not manully set during this copy process: https://github.com/odoo/odoo/blob/9ad995ff6b59a6a2fdfbbd6cf385fe27568dd3ea/addons/stock/models/stock_picking.py#L558 opw-6111544 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#261831 Forward-Port-Of: odoo/odoo#259804
This update resolves an issue preventing the MPESA payment method from correctly processing transactions initiated by Safaricom. Specifically, it disables CSRF checks on callback endpoints and ensures URLs use HTTPS, addressing a common error related to invalid URLs. Additionally, the code now incorporates the till number for transactions, streamlining the process.
Original PR description
1. The `MPESA` payment method needs a callback url where it does a `POST` request with the transaction details. Since the call comes from safaricom, CSRF will block those requests. This commit will…
1. The `MPESA` payment method needs a callback url where it does a `POST` request with the transaction details. Since the call comes from safaricom, CSRF will block those requests. This commit will disable CSRF checks on the callback endpoints which are expected to be called from an external service 2. Sometimes the `web.base.url` parameter is automatically set to http. But safaricom expects https for all the urls. So we need to ensure that the urls we send on `lipa_na_mpesa_register_urls` use https, otherwise the registration fails with an `invalid url` error. Additionally, I added the error message in case of error 4. In addition to the business short code we also need a till number for transactions. Since this is stable, I've added the till number as an extension of the business shortcode field and then parse it before usage. On master there is a new PR which will properly separate the fields Task-[6045833](https://www.odoo.com/odoo/project/1737/tasks/6045833) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#254993
This update fixes an issue where the Datev CSV export incorrectly calculated tax amounts for vendor bills with multiple tax repartition lines. The fix ensures accurate tax reporting by correctly summing the tax amounts when multiple lines are associated with a single tax, improving the reliability of financial data exports.
Original PR description
With l10n_de_reports: - Configure a foreign currency with an exchange rate. - Configure a tax with multiple repartition lines. - Create a vendor bill in this foreign currency with this tax. - In the general ledger export the datev csv. In the datev csv the rate is wrong. In the method _l10n_de_datev_get_csv, we build a tax_amount dict. However when one tax has multiple lines, the amount is replaced and not added. opw-6010097 Forward-Port-Of: odoo/enterprise#115535 Forward-Port-Of: odoo/enterprise#110453
This update resolves an issue where incorrect Nemhandel identifiers were generated when Danish company VAT numbers with the 'DK' prefix were entered. The change removes the 'DK' prefix from CVR numbers, ensuring accurate identifier generation and a better experience for Danish businesses using Odoo.
Original PR description
Before this PR: - When a user enters a full VAT number with the 'DK' prefix in the company registry, the Nemhandel identifier becomes incorrect and results in a cryptic error being returned to the client. After this PR: - The prefix is removed if the CVR contains the 'DK' country code, to ensure the correctness of the Nemhandel identifier. task-5449059 Forward-Port-Of: odoo/odoo#261856 Forward-Port-Of: odoo/odoo#261719
This update resolves an issue where IoT-connected printers weren't correctly configured within Odoo's Point of Sale (PoS) system. Previously, these printers were unusable. This change ensures all printers, including those connected via IoT, are properly loaded and functional within the PoS environment.
Original PR description
preparation printers were not loaded in PoS as IoT devices making them unusable.
This update resolves an issue causing FEC imports to crash for French association companies in Guadeloupe and Martinique. The fix prevents the import process from incorrectly attempting to link asset models, which were unexpectedly included in the account templates. This ensures smoother and more reliable FEC imports for our French users.
Original PR description
Description of the issue: Importing an FEC on saas-19.1 can crash for French association companies in Guadeloupe or Martinique. During the import, account data is completed from the fr_comp account…
Description of the issue: Importing an FEC on saas-19.1 can crash for French association companies in Guadeloupe or Martinique. During the import, account data is completed from the fr_comp account templates. Since 19.1, those templates may include asset_model_ids, which makes the import try to resolve asset XML IDs that do not exist for that company setup. Steps to reproduce: 1. Create a new company with Guadeloupe or Martinique for country. 2. Set the French associations chart of accounts on it. 3. Go to Accounting -> Configuration -> Chart of Accounts. 4. Import the FEC file linked on the ticket. 5. Import fails with traceback. Desired behavior after fix: FEC import should keep the existing template completion behavior, but it should not copy asset_model_ids onto imported accounts. Importing an FEC for French association companies in Guadeloupe or Martinique should therefore no longer crash because of unrelated asset model references. Ticket [link](https://www.odoo.com/odoo/project.task/6053048) opw-6053048
This update corrects a problem that occurred when switching accounting chart templates, specifically when changing from a company to an association localization. The change ensures that old accounting records are properly removed during template updates, preventing errors related to foreign key constraints. This improves stability and prevents disruptions during localization adjustments.
Original PR description
**Issue:** Switching chart template/localization (Belgium Companies -> Belgium Associations) produces an error: ``` The operation cannot be completed: update or delete on table "account_account"…
**Issue:** Switching chart template/localization (Belgium Companies -> Belgium Associations) produces an error: ``` The operation cannot be completed: update or delete on table "account_account" violates RESTRICT setting of foreign key constraint "account_cash_rounding_profit_account_id_fkey" on table "account_cash_rounding" DETAIL: Key (id)=(1919) is referenced from table "account_cash_rounding" ``` **Steps to reproduce:** 1) install l10n_be module 2) make a new belgium company 3) go to accounting > configurations 4) change the fiscal localization package to "Belgium- Associations and Foundations" **Cause:** `account.cash.rounding` was not included in the chart template cleanup models. As a result, old `account.account` records were unlinked while still referenced by cash rounding records with `ondelete='restrict'` **Solution:** Include `account.cash.rounding` in `TEMPLATE_MODELS` so cleanup removes cash rounding records before deleting old accounts. And Add an assertion in `test_change_coa` to ensure old cash rounding records are deleted during COA switch. opw-6165374 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update resolves an issue where the 'PayableRoundingAmount' was incorrectly calculated as a cash rounding. The fix creates the invoice first and then applies post-fix adjustments to the untaxed amount, aligning with standard tax rounding methods. This ensures accurate invoice generation and compliance with UBL standards.
Original PR description
PayableRoundingAmount is not necessarily a cash rounding. It might also be the difference between the untaxed amount per line regarding the global untaxed amount due to the global tax rounding method. The idea in this commit is to create the invoice first and then, just like the code fixing the taxes, to post fix the untaxed amount after. opw-6151984 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#260992
This update fixes an issue where invoices were incorrectly including non-validated timesheets in sales orders. The change ensures that invoices only reflect the quantity of timesheets that have been fully validated, aligning with the 'only validated TS' invoicing policy. This prevents over-invoicing and maintains accurate financial records.
Original PR description
**Steps to reproduce** - Settings: Timesheets > Invoicing policy = only validated TS. - Have a service product with an invoicing policy based on timesheets. - Create a sales order using this product.…
**Steps to reproduce** - Settings: Timesheets > Invoicing policy = only validated TS. - Have a service product with an invoicing policy based on timesheets. - Create a sales order using this product. - From the SO, click on the "Recorded" smart button and create 2 timesheets. Validate only one of them. - Invoice the SO, using a timesheets period that includes both TS. - Notice that the quantity of the invoice line includes the non-validated timesheet. **Cause** The domain excluding non-validated timesheets provided by `_timesheet_compute_delivered_quantity_domain` is not considered since c3b6053b09222d4bd2237e7de589a63fbef118f1 **Change** Since the purpose of the previous fix was to exclude timesheets linked to an invoice with a date before the "Invoicing Switch Threshold", this can be achieved by tweaking the `timesheet_domain` slightly, similar to the `_timesheet_domain_get_invoiced_lines` domain. opw-6116670 Forward-Port-Of: odoo/odoo#261621 Forward-Port-Of: odoo/odoo#259224
3 changes
Resolved issues and error corrections
This update ensures that barcode validations in the stock picking app correctly check if a destination has been scanned before processing. Previously, the system didn't verify destination scanning, even when enabled. This change ensures accurate validation and prevents issues with incomplete picking processes.
Original PR description
### Steps to reproduce: - In the settings: Enable "Storage Locations" - Inventory > Configuration > Warehouse Management > Operation Types - On receipts, in the Barcode App tab enable: "Force a…
### Steps to reproduce: - In the settings: Enable "Storage Locations" - Inventory > Configuration > Warehouse Management > Operation Types - On receipts, in the Barcode App tab enable: "Force a destination on all products" - Open the barcode app, create a new receipt - Scan a product > Validate #### > You are not blocked by the fact that you did not scan any destination even just to validate the default one ### Cause of the issue: The `barcode_validation_after_dest_location` operation type setting is not used at any point in the barcode app. ### Note: Line in the barcode app are always created a with a `location_dest_id`: https://github.com/odoo/enterprise/blob/a220fc61d9076decdb987421df9330a1c2c20546/stock_barcode/static/src/models/barcode_picking_model.js#L1310-L1322 In particular, even if the setting says: Force a destination on all products. It should rather be interpreted as force a destination scan before validation. Note that a destination scan will not necessarily update a single line but rather all concerned lines at once: https://github.com/odoo/enterprise/blob/a220fc61d9076decdb987421df9330a1c2c20546/stock_barcode/static/src/models/barcode_picking_model.js#L1558-L1576 It is therefore a valid call to check if a location dest was scanned to determine if the a destination was set on each product before validation of the picking, even if it is just to confirm the default destination. ### Note 2: We modify the `_get_barcode_config` to only provide a `barcode_validation_after_dest_location` if locations re enabled otherwise users enabling the option without the ability to scan locations would be soft lock and unable to validate their picking. That same logic already being applied to the `restrict_scan_dest_location` config parameter: https://github.com/odoo/enterprise/blob/6afe02e3e836df2822d7cae8aebbd5bdde6b34cc/stock_barcode/models/stock_picking_type.py#L109 opw-6110690 Forward-Port-Of: odoo/enterprise#115534 Forward-Port-Of: odoo/enterprise#114429
This update resolves an issue where the Mod347 BOE export incorrectly included Spanish companies with invoices below the threshold. The fix removes an unnecessary search that was adding these companies to the export, ensuring only relevant partners are included based on the primary reporting requirements. This improves the accuracy of the BOE export for Spanish businesses.
Original PR description
Fix a bug in mod347 BOE export. Steps to reproduce: 1- Create an invoice with a spain Company, with an amount lower than 3 005,06€ 2- Add a Type for mod347 3- Create a cash payment 4- Export the mod347 BOE The partner will appear in the BOE with all line at 0. But this partner shouldn't be in the export. This is due because of a search on account.partial.reconcile, which add partners to the export if a cash payment is found in the period. But this search is not usefully as there is no legal indication that these partners should be in the export in this case, as the partners should only be returned by the main queries. Backport of PR #84317 opw-5960226 Forward-Port-Of: odoo/enterprise#114672 Forward-Port-Of: odoo/enterprise#110947
This update resolves a bug that caused crashes when sending invoices with attached images. The system incorrectly synced orphaned attachments, leading to versioning conflicts and data loss. The fix ensures attachments are properly linked during the printing process, improving invoice reliability.
Original PR description
Steps to reproduce: - Set a journal with documents folder sync. - Create and post a customer invoice. - Add an image attachment via a log note. - Click Send & Print. -> KeyError:…
Steps to reproduce: - Set a journal with documents folder sync. - Create and post a customer invoice. - Add an image attachment via a log note. - Click Send & Print. -> KeyError: `proforma_pdf_attachment` Cause: Adding an image via log note sets it as the main attachment, but it is intentionally orphaned (res_model=False) to prevent UI clutter. `documents_account` incorrectly syncs this unlinked file, creating a workspace document with a missing model. During "Send & Print", the official invoice PDF replaces the image as the main attachment. The document versioning logic intercepts this swap and attempts to re-parent the new PDF to match the orphaned document. This destroys the PDF's linkage to the invoice, causing a crash when the system later attempts to fetch the PDF. Solution: Since the base module now suppresses premature document creation during the message post, we explicitly handle the sync ourselves. We override `_fix_attachments_on_record_from_files_data` to iterate over the validated attachments and trigger document creation only for files that retained their `res_model`. We also add a check inside `_update_or_create_document` to strictly block orphaned attachments. opw-5930888
7 changes
Resolved issues and error corrections
This update resolves an issue where invoices rejected by the Italian tax system (SdI) remained marked as 'sent' in Odoo, preventing users from resubmitting them. The change automatically clears the 'is_move_sent' flag when an invoice is rejected, allowing for correct resubmission and streamlining the invoicing process. This ensures Italian businesses can quickly correct errors and avoid delays.
Original PR description
When an invoice is rejected by the SdI or by a PA partner, the move remained flagged as sent, preventing the user from resending it after fixing the underlying issue. Override write() on account.move to clear is_move_sent whenever l10n_it_edi_state transitions to 'rejected' or 'rejected_by_pa_partner', so the invoice can be re-submitted. task-4490454 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#260591
This update resolves an issue where Spanish invoices with amounts below a certain threshold were incorrectly appearing in the Mod347 BOE export. The fix eliminates a redundant search process, ensuring that only relevant partners are included based on the primary data requirements. This improves the accuracy of the BOE export for Spanish businesses.
Original PR description
Fix a bug in mod347 BOE export. Steps to reproduce: 1- Create an invoice with a spain Company, with an amount lower than 3 005,06€ 2- Add a Type for mod347 3- Create a cash payment 4- Export the mod347 BOE The partner will appear in the BOE with all line at 0. But this partner shouldn't be in the export. This is due because of a search on account.partial.reconcile, which add partners to the export if a cash payment is found in the period. But this search is not usefully as there is no legal indication that these partners should be in the export in this case, as the partners should only be returned by the main queries. Backport of PR #84317 opw-5960226 Forward-Port-Of: odoo/enterprise#114672 Forward-Port-Of: odoo/enterprise#110947
This update fixes an issue where quantities were incorrectly doubled when settling POS sales orders using the 'Pick then Deliver' warehouse method. The fix ensures accurate lot quantity tracking by filtering move lines correctly, preventing double-counting of inventory. This improves the reliability of sales order fulfillment.
Original PR description
When settling a sale order in POS after validating the delivery, quantities and lots were wrong for lot-tracked products with warehouse "Pick then Deliver (2 steps)": quantity doubled when loading…
When settling a sale order in POS after validating the delivery, quantities and lots were wrong for lot-tracked products with warehouse "Pick then Deliver (2 steps)": quantity doubled when loading SN/Lots. Steps to reproduce: ------------------- * Create a product with Tracking by lots * In Inventory, set warehouse Outgoing Shipments to "Pick then Deliver (2 steps)" * Create a quotation with the product and confirm it * Validate the delivery * In POS, settle the sale order from Quotation/Order * When asked "Do you want to load the SN/Lots linked to the Sales Order?", click Yes > Observation: Quantity doubled. Why the fix: ------------ read_converted() used move_line_ids from all moves linked to the sale line. With 2-step, both pick and delivery moves have move_line_ids with the same lots, so quantities were counted twice. We now use move lines from exactly one picking and filter by sale_line_id. opw-6001585 Forward-Port-Of: odoo/odoo#261729 Forward-Port-Of: odoo/odoo#253539
This update optimizes the process of preparing data for workcenter visualizations, resulting in significantly faster performance. By streamlining the check for workorders and pre-calculating resource calendar durations, the system now responds much quicker, especially with large datasets. This improves overall system responsiveness.
Original PR description
Before this commit, calling the method `_prepare_graph_data` with a recordset of workcenters, would traverse the recordset and then check if all the workcenters has at least one workorder by fetching…
Before this commit, calling the method `_prepare_graph_data` with a recordset of workcenters, would traverse the recordset and then check if all the workcenters has at least one workorder by fetching the field `order_ids` for all the workcenters. This can be too slow in cases where the workcenters have a lot of workorders and in addition to that there is no need to do this repeatedly for every workcenter. In this commit, I have modified the check by invoking a `search_count` on the workorders before iterating over the recordset and in addition to that I have pre-computed the sum of the duration hours of the attendances related to a `resource_calendar` as multiple workcenters might have the same `resource_calendar` The benchmark done below, was on a database that contained 78 workcenters. | Workorders | Before | After | | :--- | :--- | :--- | | 1380828 | 12s | 0.16s | | 138082 | 1.21s | 0.14s | | 13808 | 0.21s | 0.09s | opw-6040077 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#256812
This update fixes a slow performance issue that occurred when searching for stock quantities with a large number of items. The change ensures that Odoo respects the specified limit during these searches, dramatically reducing the time it takes to retrieve data. This improves the responsiveness of key features like picking and barcode operations.
Original PR description
## Problem: During an `onchange` call, if a field is defined in the `fields_spec` with a `limit` attribute, the `fetch` method doesn't respect it, and will fetch all records satisfying the domain. In certain circumstances, this leads to slow requests. ## Solution: Enforce the `limit` when fetching if it is present. ## Steps to reproduce: - Have a product with many quant records 1. Open a picking for this product in Barcode 2. Change the lot/serial The frontend will send an `onchange` request that includes `product_stock_quant_ids` in the `fields_spec` (with default `limit` 40). Odoo will fetch all quants for this product regardless of the limit, and the request will take a while to resolve. ## Benchmark: <table> <thead> <tr> <th># of quants</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>17193</td> <td>~9s</td> <td>~400ms</td> </tr> </tbody> </table> opw-6041705 Forward-Port-Of: odoo/odoo#259983
This update fixes an issue where invoices in multi-company branches weren't correctly calculating prices with taxes included. Previously, the unit price didn't adjust to exclude the original tax. This change ensures accurate pricing and tax calculations when using fiscal positions across different company branches.
Original PR description
When operating in a multi-company branch environment, the unit price of a product with price-included taxes is not correctly recalculated when applying a fiscal position. Steps to reproduce: - Create a tax that is included in the price (e.g., 10% incl). - Assign this tax to a product (e.g., Product A). - Create a fiscal position that maps this 10% tax to a different tax. - Create a branch (child company) of your main company. - Create an invoice in the new branch using the fiscal position and add an invoice line for Product A. Issue: The unit price of the product on the invoice line remains the full tax-included amount rather than being reduced to exclude the original 10% tax. opw-5931302 Forward-Port-Of: odoo/odoo#260840 Forward-Port-Of: odoo/odoo#256897
This update resolves an issue where the 'PayableRoundingAmount' was incorrectly calculated as a cash rounding. The fix creates the invoice first and then applies post-fix adjustments to the untaxed amount, aligning with standard tax rounding methods. This ensures accurate invoice processing and reporting related to UBL and CII standards.
Original PR description
PayableRoundingAmount is not necessarily a cash rounding. It might also be the difference between the untaxed amount per line regarding the global untaxed amount due to the global tax rounding method. The idea in this commit is to create the invoice first and then, just like the code fixing the taxes, to post fix the untaxed amount after. opw-6151984 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#260992
1 change
Resolved issues and error corrections
This update resolves an issue where Spanish cash payments weren't correctly appearing in the Mod347 BOE export for invoices under €3,005.06. The fix prevents unnecessary partners from being included in the export by refining the search criteria, ensuring only relevant partners are generated. This improves the accuracy of the BOE reports for Spanish businesses.
Original PR description
Fix a bug in mod347 BOE export. Steps to reproduce: 1- Create an invoice with a spain Company, with an amount lower than 3 005,06€ 2- Add a Type for mod347 3- Create a cash payment 4- Export the mod347 BOE The partner will appear in the BOE with all line at 0. But this partner shouldn't be in the export. This is due because of a search on account.partial.reconcile, which add partners to the export if a cash payment is found in the period. But this search is not usefully as there is no legal indication that these partners should be in the export in this case, as the partners should only be returned by the main queries. Backport of PR #84317 opw-5960226 Forward-Port-Of: odoo/enterprise#114672 Forward-Port-Of: odoo/enterprise#110947
11 changes
Resolved issues and error corrections
This update resolves a bug where rental tour scheduling was failing due to invalid time selections. The fix ensures tours always use a valid future date, preventing errors when attempting to book tours at times before the current day. This improves the reliability of the rental booking process.
Original PR description
Since 605c8b47d52854e36c7cb822ccb2d40de44c4c3c, rourly rental products default to a rental period starting at the next hour of the current day. Tours override the time of the rental period, but not…
Since 605c8b47d52854e36c7cb822ccb2d40de44c4c3c, rourly rental products default to a rental period starting at the next hour of the current day. Tours override the time of the rental period, but not the date. If the tours tries to set a time which is in the past, the datepicker will discard the time, breaking the tour. Scenario: Running the tour between 11am-11:59am breaks test_website_sale_renting_ui: - Product page shows default times: today 12pm (start) to 1pm (end) - Tour tries to set start time to 8am - Datepicker rejects 8am (it's before the current time 11am-11:59am) and keeps 12pm - Tour then sets end time to 12pm, resulting in equal start and end times - Equal times are invalid, cart addition fails, tour breaks This commit, extracts the existing utility function into a shared helper that returns a guaranteed future date (next Monday + offset), ensuring tours always set valid times regardless of when they run. runbot-243459 Forward-Port-Of: odoo/enterprise#115687
This update resolves an issue where the XML files generated for the Hong Kong payroll system were not using the correct encoding format, preventing proper processing by the IRD platform. The fix includes adding a required file header and ensuring the correct encoding is used, ensuring accurate data transmission.
Original PR description
Following recent tests, we noticed that the encoding used when exporting our XML files doesn't follow the required format. We noticed two issues during testing: - The IRD platform expects the file to have BOM included. - The encoding in the header must be capitalized. We solve this in this commit by prepending the BOM bytes to the xml bytes; and making sure to capitalize the URF-8 in the header. task-6150470 --- Note: There will be a lot to do during forward ports, as these have changed quite a bit. (XML support for the other file types, and a proper testing file, at least) Forward-Port-Of: odoo/enterprise#115582 Forward-Port-Of: odoo/enterprise#115227
This update fixes an issue where the IRN number, generated during e-invoicing, wasn't saved to the invoice itself. Now, the IRN number is correctly displayed in both the invoice PDF and the invoice form view after the EDI submission process. This ensures accurate record-keeping and compliance with Indian regulations.
Original PR description
**Steps to reproduce:** * Install module *Indian - GSTR with E-invoice (l10n_in_edi_gstr)*. * Configure *Indian integration* with required credentials (E-Invoicing, E-Way bill, etc.). * Save the…
**Steps to reproduce:** * Install module *Indian - GSTR with E-invoice (l10n_in_edi_gstr)*. * Configure *Indian integration* with required credentials (E-Invoicing, E-Way bill, etc.). * Save the settings. * Create a *customer invoice*. * Post the invoice. * Send the invoice through *E-Invoicing (EDI)*. * Open the generated *Invoice PDF* and the *form view*. **Observed behavior:** * The *IRN number* is correctly present in the *Invoice PDF*. * However, it is *not saved/displayed* in the invoice form view. **Cause:** * The invoice flow did not store the *IRN number* on the invoice after receiving the EDI response, even though the value was available. **Fix:** * Inherit *_l10n_in_edi_send_invoice*. * Add a condition after the invoice is sent and the JSON response is received. * When the *IRN number* is present in the response, set it on the *l10n_in_irn_number* field of the invoice (in lower case). opw-6097923 Forward-Port-Of: odoo/enterprise#115522 Forward-Port-Of: odoo/enterprise#114350
This update fixes an issue where leave calculations were incorrectly recomputed due to outdated employee version references. The change ensures that time off calculations now accurately reflect the employee's active status at the time the leave was created, leading to more reliable time off reporting.
Original PR description
The employee_type_id, job_id and structure_type_id fields on hr.leave were stored related fields pointing to current_version_id. This caused all time offs to be recomputed whenever the employee's current version changed, and stored the current version's values instead of those active at the time of the leave. Replace the related fields with a compute based on date_from, resolving the version active at the leave's start date. task-6175086 Forward-Port-Of: odoo/enterprise#115607
This update fixes an issue where outstanding amounts weren't accurately calculated after a refund was processed within a point-of-sale transaction. Previously, only the original order total was considered. Now, refund orders are included, ensuring the correct net due amount is displayed and settled, improving financial accuracy.
Original PR description
Step to reproduce - install "pos_settle_due" - have a customer, A and a pos with payment method "customer Account" - start pos, add 3 qty of product with unit price 10$ with partner A - use payment method "customer Account" i.e. of type "pay_later" (do not invoice orders) - refund 1 qty of previous order using same payment method - go to partner list, notice A has 20$ as due - click on "hamburger btn" > settle due amount Observation: - notice we only get the order amount as due i.e order with 30$ - we should have received the refund order too, so that net due of 20$ can be processed Cause: - currently, we didn't considered refunds orders at all, when settling dues Fix: - now we consider order with total < 0 i.e refund orders to be included for settlement opw-5869313 Forward-Port-Of: odoo/enterprise#114143 Forward-Port-Of: odoo/enterprise#107883
This update enhances the Odoo Enterprise sign process to be more user-friendly on touch screen devices. The changes address usability issues and optimize the interface for touch interactions, making it easier for users to complete sign requests. Unrelated changes from another branch have been removed.
Original PR description
Sign is not well optimized for touch screen users, fields can't be placed and other operations are also hard. This PR is made to fix that. Task: 5001223
This update streamlines the calculation of payslips by restoring a previously removed wizard and implementing inline computation. This change enhances the accuracy and efficiency of payroll processing, ensuring employees receive correct payments. It addresses a previous removal that impacted the functionality of the payroll system.
Original PR description
We replace the previously removed payslip line edition wizard with inline payslip computation Forward-Port-Of: odoo/enterprise#112972
This update fixes an issue where the Datev CSV export incorrectly calculated tax amounts when a vendor bill had multiple tax repartition lines. The fix ensures that all tax amounts are accurately included in the export, improving the reliability of financial reporting for Datev.
Original PR description
With l10n_de_reports: - Configure a foreign currency with an exchange rate. - Configure a tax with multiple repartition lines. - Create a vendor bill in this foreign currency with this tax. - In the general ledger export the datev csv. In the datev csv the rate is wrong. In the method _l10n_de_datev_get_csv, we build a tax_amount dict. However when one tax has multiple lines, the amount is replaced and not added. opw-6010097 Forward-Port-Of: odoo/enterprise#115535 Forward-Port-Of: odoo/enterprise#110453
This update ensures that the expiration date from a GS1 barcode on a packaging is correctly applied when creating a new lot in Odoo. Previously, the system didn't recognize the due date on the packaging, leading to incorrect lot expiration settings. This fix improves inventory accuracy and reduces the risk of expired stock.
Original PR description
Issue
-----
Scanning a GS1 barcode containing:
- packaging
- lot
- due date
disregards the due date when creating the new lot.
Steps to reproduce
-----
- Enable GS1 nomenclature & packagings
- Create a product
- barcode 23456789012344
- packaging with barcode 01234567890128
- some on hand quantity
- Create a delivery for a full packaging of the product
- Open the delivery in barcode
- Scan 02 01234567890128 15 270101 10 LOT1
- Validate
- Open the lot
> Expiration date is set to today
Cause
-----
The code expects the product be scanned, there is no logic to retrieve it from the packaging when missing.
-----
Ticket:
opw-6073489
Forward-Port-Of: odoo/enterprise#114327
Forward-Port-Of: odoo/enterprise#112490This update ensures that missing payslip alerts are triggered only when the payroll closing date has passed. Previously, alerts were raised regardless of the closing date status. This change improves the accuracy of payroll reporting and helps ensure timely payment processing, particularly around end-of-period payroll runs.
Original PR description
In this commit, missing payslip in a payrun issue will be raised only if the payroll closing date is due (old conditions remains). task-6008297 Forward-Port-Of: odoo/enterprise#115646 Forward-Port-Of: odoo/enterprise#112182
This update fixes an issue where byproducts added directly to manufacturing orders weren't correctly linked to stock movements. Now, byproducts added to MOs are accurately tracked, ensuring correct inventory updates and reporting. This improves the accuracy of production tracking and reduces potential discrepancies.
Original PR description
When we add a byproduct followed by SN directly in the MO it will not have the its location as production. Steps to reproduce: ------------------- * Create product tracked by Serial number * Create a…
When we add a byproduct followed by SN directly in the MO it will not have the its location as production. Steps to reproduce: ------------------- * Create product tracked by Serial number * Create a Manufacturing order * Add the Product tracked by serial number on the MO as byproduct * Confirm the MO * Go to shop floor * Add the by-product quantity and create a new serial number. * Close production and go back to the MO in manufacturing * Open stock moves -> the by-product does not have "production" for origin Observation: ------------- When we add the byproduct directly in the MO, they will be added to move_byproduct_ids in the MO but not in byproduct_ids on the stock.move because byproduct_ids it's a [link](https://github.com/odoo/odoo/blob/d14bf6289da21065860ff959185c47b947a7418c/addons/mrp/models/stock_move.py#L50-L52) between the stock.move and the BOM. When adding the byproduct in shopfloor, it will create the quant: https://github.com/odoo/enterprise/blob/06be616bb4d74f0a089e8e318d25c2424594f813/mrp_workorder/static/src/mrp_display/mrp_record_line/stock_move.js#L163-L171 Additionaly when creating the quant it will decide the source location depending if the product its a byproduct: https://github.com/odoo/enterprise/blob/1d10ee238a50e7bdb552efdeafc068c5127cd49a/mrp_workorder/static/src/mrp_display/mrp_record_line/stock_move.js#L189-L192 The issue arise because it check if the product it's a byproduct by checking byproduct_ids and since our product was added directly on the MO and not from the BOM it will not appear in byproduct_ids https://github.com/odoo/enterprise/blob/dc5bb0fe8e15063f977970841bdaf8aff1a61e41/mrp_workorder/static/src/mrp_display/mrp_record_line/stock_move.js#L108-L110 #### Additional notes: The default value for [byproduct_id](https://github.com/odoo/odoo/blob/abb5777cc8324cff0cdf841a8ae42413060dcf92/addons/mrp/models/mrp_production.py#L1263) when creating the stock move is false opw-5974582 Forward-Port-Of: odoo/enterprise#115548 Forward-Port-Of: odoo/enterprise#110122
4 changes
Resolved issues and error corrections
This update fixes an issue where financial reports (Balance Sheet, P&L, Tax Report) were printed with zoomed-in views due to a default paper format setting. The change ensures reports now use the standard Euro paper format, resolving the printing problem and improving report clarity.
Original PR description
for financial reports DIN 5008 paper format (dpi=70, postal margins) was applied to all reports because it is set as the company default by both the Swiss and German localizations. This caused financial reports (Balance Sheet, P&L, Tax Report) to appear zoomed in when printed to PDF. DIN 5008 is only appropriate for documents sent by post (invoices, credit notes, follow-up letters). Override `get_paperformat` in each localization to return the standard Euro format when rendering accounting reports. task-6053938
This update fixes a previous issue where users wouldn't receive any notification when their phone number country wasn't supported for SMS card details. Now, users receive an email notification, and a more robust error system is implemented for flows lacking email fallbacks, ensuring better user experience and troubleshooting.
Original PR description
When a user request the card details, if the country of the phone number of the user isn't supported by IAP, it would silently fail. Now, we are sending an email in case the phone number isn't supported. In case some flow don't/can't have any email fallback, we will add the a generic error and a more detailed one for the country not being supported. task-6065232
This update prevents users from accidentally modifying core return type settings within the master data. This change ensures that small adjustments don't disrupt critical business processes. Users can still add new return types without restriction.
Original PR description
Backport of [0a6328d](https://github.com/odoo/enterprise/commit/0a6328d4cecc1d931cd29f83a9d8efd6d32f19db) to resolve opw-6107995 Issue: - Users can easily edit return types coming from master data. - Even small experiments (e.g., changing category or states) may break critical behavior. Solution: - For such records, made critical fields (category and states) readonly in the form view. - User added records remain fully editable. Impact: - Prevents accidental or harmful changes to predefined return types. - Still allows users to add their own return types safely. TaskID-5060125 Part-of: odoo/enterprise#93874
This update resolves an issue where the system incorrectly skipped remuneration declarations in certain payroll scenarios, particularly when employees had no worked days in a period but still received a bonus. The change ensures accurate calculation of all required remuneration declarations, improving payroll accuracy for Belgian businesses.
12 changes
Resolved issues and error corrections
This update resolves an issue where attachments weren't uploading reliably when navigating between records in the chatter. The fix ensures attachments are correctly associated with the intended record, preventing data inconsistencies and improving the attachment upload experience. This improves data integrity and user confidence.
Original PR description
Currently, when uploading a bunch of attachments or a big one to the chatter, if you click on the pager (e.g. next) before the upload is complete, the attachments that have not yet been uploaded are uploaded to the next record. Due to the persistence of the Chatter component during record navigation and the fact that the `FileUploader` logic is tied to `state.thread`, an async callback that finishes after a record switch will attempt to update the currently active thread rather than the one that initiated the upload. With this change we tie uploader lifecycle to a specific record and ensure the completion callback only affects that record. task-5119290
This update resolves an issue where vendor bills were incorrectly grouped in journal entries, appearing in multiple statuses. The fix adds a necessary search method to the 'status_in_payment' field, ensuring accurate grouping and reporting based on bill status. This improves the reliability of financial data analysis.
Original PR description
Step to reproduce - create a vendor bill, for say 100$ i.e Bill 1 - post it - go to journal entry menu - group by: "status_in_payment" - expand the lines Observation: - after group by, suppose we get 2 groups in journal entry (Draft, Not Paid) - when we expand. Bill 1 is present in both group (Bill 1 should be in Not paid) - in each group we get all the records Cause: - `status_in_payment` is a compute field, for web_search to work, this fields need a `search` method which is absent here. - in this case, we just set domain = [] - hence, we got above unexpected results https://github.com/odoo/odoo/blob/e7f4a88432d9696800d1f2b9e28bf92320c97422/odoo/osv/expression.py#L1179-L1187 Fix: - Add the search method for this fields opw-6109572 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update ensures correct handling of vendor identification when importing KSeF bills. It now requires the Polish NIP number (without the 'PL' prefix) to be used, aligning with Polish tax regulations for foreign companies operating in Poland. This is crucial for proper KSeF compliance and accurate invoice processing.
Original PR description
When we import bills from KSeF, the vendor (`Podmiot1`) XML tag must include a Polish `NIP` number XML tag. The `NIP` is the base number composing a polish `vat` number, but without the prefix `PL`.…
When we import bills from KSeF, the vendor (`Podmiot1`) XML tag must include a Polish `NIP` number XML tag. The `NIP` is the base number composing a polish `vat` number, but without the prefix `PL`. This is true even if the vendor is from another country like Luxembourg: if they have a stable organization in Poland and sells in Poland - then they have to use a polish `NIP` to use the KSeF and issue their invoices. Two issues: - We search the vendor by `NIP` as it was a `vat` number, but we add the `vendor_country` code as prefix instead of `PL`. I.e. we search for `LU012345678` instead of `PL012345678`. - When we don't find the vendor in the database, we create one using the `NIP` number coming straight from the tag, as it was a `vat` number. I.e. for a partner in Luxembourg, `vat` will become `LU012345678` instead of `PL012345678` ref: https://ksef.podatki.gov.pl/media/4u1bmhx4/information-sheet-on-the-fa-3-logical-structure.pdf Ticket [link](https://www.odoo.com/odoo/project.task/6148039) opw-6148039
This update resolves an issue where the Swedish EC Sales Report exported to KVR (a key accounting format) displayed decimal values instead of the required integer format. This fix ensures accurate reporting for Swedish businesses, aligning with local tax regulations and improving data integrity.
Original PR description
**PROBLEM** EC Sales Report in Sweden needs to be reported with integer values. **STEP TO REPRODUCE** 1. Install l10n_se 2. On the se company, create a invoice with lines with EU tax and confirm it. 3. Go to Accounting/Reporting/EC Sale List and export to KVR. 4. Notices the KVR uses numbers with decimals places. opw-6045289 Forward-Port-Of: odoo/enterprise#114292
This update corrects an issue where barcode-created internal transfers incorrectly displayed zero demand and used the wrong warehouse locations in inventory reports. The fix ensures that scanned quantities accurately reflect demand and that moves are linked to the correct sub-locations, improving inventory accuracy and reporting.
Original PR description
When creating an internal transfer from the Barcode app, stock moves auto-created from scanned lines showed incorrect data in the Moves Analysis list view: - Demand (product_uom_qty) was always 0. -…
When creating an internal transfer from the Barcode app, stock moves auto-created from scanned lines showed incorrect data in the Moves Analysis list view: - Demand (product_uom_qty) was always 0. - Source and destination locations showed the picking's generic header location (e.g. WH/Stock → WH/Stock) instead of the actual sub-locations scanned by the operator. Steps to reproduce: ------------------- * Open the Barcode app and start a new internal transfer. * Add a product from WH/Stock/Shelf to WH/Stock/Shelf2 with qty 8. * Validate the transfer. * Open Inventory > Reporting > Moves Analysis > List View. > Observation: the move shows Demand = 0, From = WH/Stock, To = WH/Stock. Why the fix: ------------ When barcode saves a transfer it writes move_line_ids directly on the picking without pre-existing moves. stock.move.line.create() calls _prepare_stock_move_vals() to auto-create the backing move. Core stock intentionally sets product_uom_qty = 0 for open pickings (so that backorder/procurement logic is not affected), and reads source/dest locations from the picking header rather than from the individual line. For the barcode "scan-first" flow these two defaults are wrong: - The scanned quantity IS the demand; there is no separate planning step. - Sub-location scanning stores the real locations on the line, not on the picking header. _prepare_stock_move_vals is overridden in stock_barcode to set product_uom_qty = self.quantity and propagate the line's locations to the move. For kit (phantom BOM) products, action_explode() deliberately relies on product_uom_qty == 0 as a signal to derive the BOM factor from the actual total scanned quantity (move.quantity) rather than from the first-scan demand, which would be captured too early. A second override in stock_barcode_mrp reverts product_uom_qty back to 0 for kit products only, while keeping the location fix. opw-6150750
This update fixes an issue where the Point of Sale dashboard incorrectly displayed all POS locations under the default warehouse, even when a specific POS was configured with a different warehouse and operation type. The change ensures that the POS dashboard accurately reflects the warehouse associated with each POS based on its setup, improving inventory management and reporting.
Original PR description
When filtering pos by warehouse_id, all pos are under the same warehouse even if we had configure an Operation Type from a different warehouse for a specific pos. Steps to reproduce: ------------------- * Setup a second warehouse in the company * Add the new POS operation type picking for the second warehouse on the POS settings * Group by warehouse in the POS dashboard > Observation: It always shows the first warehouse Why the fix: ------------ The warehouse_id field on pos.config was a plain Many2one with a static default that always set it to the first warehouse of the company. Convert warehouse_id into a computed stored editable field that derives from picking_type_id.warehouse_id. This ensures the warehouse stays in sync when the operation type changes, while still allowing manual override for the Ship Later feature. opw-6104652
This update corrects a bug where B2C customer EDI invoices incorrectly prioritized the phone number over the mobile number. The fix ensures the mobile number is used as the primary contact information, improving data accuracy for electronic invoices and compliance with tax regulations. This change impacts how customer contact details are transmitted in EDI formats.
Original PR description
Current behavior: -- B2C partner type used `partner.phone` instead of `partner.mobile` for the `CustomerPhone` EDI JSON field, ignoring mobile even when present. Expected behavior: -- B2C prioritizes `partner.mobile`, falls back to `partner.phone` when mobile is absent. Steps to reproduce: -- 1. Create B2C partner with both mobile and phone set. 2. Generate EDI invoice JSON. 3. Observe `CustomerPhone` uses phone instead of mobile. If the `phone` field is instead empty for B2C, an error occurs Cause of the issue: -- B2C branch resolved `partner.phone` as primary instead of `partner.mobile`. Fix: -- B2C now resolves `partner.mobile or partner.phone` before calling `_reformat_phone_number`, ensuring mobile is prioritized with phone as fallback. opw-6120115 - I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change fixes an issue where products were incorrectly displayed on the website when viewing from a company other than their designated one. The update ensures product searches respect the currently selected website company, preventing incorrect product visibility and potential sales order errors. This improves data accuracy and user experience.
Original PR description
# Setup Have 2 companies : A & B # How to reproduce - Set your website's company to Company B - Create product X : - Company : Company A - Published - Name : xyz - Go to Users > Any User > Acces…
# Setup
Have 2 companies : A & B
# How to reproduce
- Set your website's company to Company B
- Create product X :
- Company : Company A
- Published
- Name : xyz
- Go to Users > Any User > Acces Rights > Allowed Companies => leave only Company A
- Connect as that user on the website
- Go to the Shop tab and search xyz
# The problem
The product X is displayed, even though we currently use the company B's website and the product is limited to company A.
This causes problem later when Sales Order are created using that product.
If you set the Allowed Companies of the user to both Company A and Company B, then the product is correctly hidden
# Why
When you search something in the search bar, the server does a `_search_with_fuzzy()` that ends up calling a simple `model.search()`.
In our case, this search should not return product X because there is an `ir.rule` that hides product not in the current company :
https://github.com/odoo/odoo/blob/0bb5ac6c1a87367c1ebb343ad6e6e6e56188cf13/addons/product/security/product_security.xml#L34-L38
But the `website` module has some particular rule about setting the current company :
https://github.com/odoo/odoo/blob/0bb5ac6c1a87367c1ebb343ad6e6e6e56188cf13/addons/website/models/ir_http.py#L249-L261
So, in our case, since the user does not have company B in its allowed companies, then
`allowed_company_ids` = Company A. So `('company_id', 'parent_of', company_ids)` is trucy and the product is displayed
# Proposed solution
Doing the search with `with_company` raise an AccessError because the company is not present in the allowed_companies. Chaging the allowed companies logic seems risky because it
may lead to unintended side effects.
We instead enforce the website's company in the search's domain
opw-6115647
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis update resolves an issue where tax amounts were incorrectly being added to invoice base amounts when tax information was missing. This ensures accurate tax calculations and reporting for UBL invoices, improving financial data integrity. The change is a straightforward fix to the underlying code.
Original PR description
--- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update ensures that when reserving stock for packaged products, the system correctly considers the available quantity of full packages. Previously, a large stock of full packages was incorrectly ignored, leading to inaccurate reservation calculations. This fix now accurately respects the 'Reserve Only Full Packagings' setting.
Original PR description
Issue ----- Forced full packaging reservation setting is ignored when there is a big quant in stock. Steps to reproduce ----- - Enable packagings - Create a product category "Super Category" -…
Issue
-----
Forced full packaging reservation setting is ignored when there is a big quant in stock.
Steps to reproduce
-----
- Enable packagings
- Create a product category "Super Category"
- Reserve Packagings: Reserve Only Full Packagings
- Create a stored product "AAA"
- Product Category: Super Category
- 50 units on hand
- Packaging: 6-Pack (6 units)
- Create a delivery for 15 units of AAA
> Reservation is made for 15 units
Cause
-----
The rounding to a multiple of the packaging quantity takes the stock quant into account. For our example case, we have 8 full 6-Packs on hand, so the `available_quantity` gets set to 48 when doing
https://github.com/odoo/odoo/blob/5e458236ca2ff2ab92c4893495e7a721be902c40/addons/stock/models/stock_quant.py#L923-L925
This leads to the reservation quantity being min(15, 48) = 15
https://github.com/odoo/odoo/blob/5e458236ca2ff2ab92c4893495e7a721be902c40/addons/stock/models/stock_quant.py#L927
-----
Ticket:
opw-5974333
Forward-Port-Of: odoo/odoo#257342This update fixes a slow performance issue that occurred when Odoo fetched inventory data based on 'onchange' events. Specifically, when a user changed a product's lot or serial number, Odoo was retrieving all related inventory records without a limit, leading to delays. This change ensures that Odoo respects the defined limit during these fetches, resulting in significantly faster response times.
Original PR description
## Problem: During an `onchange` call, if a field is defined in the `fields_spec` with a `limit` attribute, the `fetch` method doesn't respect it, and will fetch all records satisfying the domain. In certain circumstances, this leads to slow requests. ## Solution: Enforce the `limit` when fetching if it is present. ## Steps to reproduce: - Have a product with many quant records 1. Open a picking for this product in Barcode 2. Change the lot/serial The frontend will send an `onchange` request that includes `product_stock_quant_ids` in the `fields_spec` (with default `limit` 40). Odoo will fetch all quants for this product regardless of the limit, and the request will take a while to resolve. ## Benchmark: <table> <thead> <tr> <th># of quants</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>17193</td> <td>~9s</td> <td>~400ms</td> </tr> </tbody> </table> opw-6041705 Forward-Port-Of: odoo/odoo#259983
This update corrects a bug where the tax amount on purchase bills was incorrectly reset to a default value. The issue stemmed from how the system recomputes taxes after price adjustments on bills, specifically during the bill confirmation process. This fix ensures the tax amount accurately reflects the manual setting.
Original PR description
**Steps to reproduce:** - create a storable product avco auto - make sure that a purchase tax is set in 'General Information' - create and confirm a PO for 30 quantities with a price of 0 - receive…
**Steps to reproduce:** - create a storable product avco auto - make sure that a purchase tax is set in 'General Information' - create and confirm a PO for 30 quantities with a price of 0 - receive the products - create and validate a delivery for 10 units of the product - from the PO create the bill - set a date and save - set a price of 100 - on the Bill set the total tax at 500 (it's bellow 'untaxed amount' on the bottom right of the bill and should be 450 before you change it, if the tax is 15%) - confirm the bill **Current behavior:** The total tax was reset to 450 **Expected behavior:** It should stay 500 as it was manually set **Cause of the issue:** The total tax amount is computed based on the tax lines in Journal Items https://github.com/odoo/odoo/blob/2744396733bb3ad60813e9e093d67192c0d38b36/addons/account/models/account_move.py#L1171 So the problem is actually that a recomputation of the balance of the tax account.move.line (the one with the account "tax paid" in journal items) is triggered when we confirm the Bill. That's because : When we confirm the bill, because the price is different than the one on the PO, _apply_price_difference does 2 things : (1) it creates an svl (with corresponding amls) for the quantities that are still in stock (here 20) (2) it adds amls on the bill (crediting stock interim received and debiting expense) to compensate the cogs deficit for the already out of stock quantities (here 10). cf https://github.com/odoo/odoo/pull/126536 for more details When we create those amls from (2), the create method from account.move.lines calls super() inside a context manager calling _sync_dynamic_lines(). https://github.com/odoo/odoo/blob/5583cbcebae00d8122dce5ce929b650929966a90/addons/account/models/account_move_line.py#L1628-L1635 the yield of sync_dynamic_lines() is inside a context manager calling _sync_tax_lines. https://github.com/odoo/odoo/blob/5583cbcebae00d8122dce5ce929b650929966a90/addons/account/models/account_move.py#L3250 Therefore, the first half of sync_tax_lines() (untill the yield) is ran before the call to super and the rest (from the yield) is ran after the call to super. Because we added two lines in the account.move, get_changed_lines will return those 2 new line and because there is a tax_ids on the new lines round_from_tax will be False. https://github.com/odoo/odoo/blob/5583cbcebae00d8122dce5ce929b650929966a90/addons/account/models/account_move.py#L3034-L3041 Therefore we won't reach continue. https://github.com/odoo/odoo/blob/73d73c5c6606e0b34c754bfc4de035840951dd3b/addons/account/models/account_move.py#L3055-L3059 And the tax line will be recomputed using _prepare_tax_line() https://github.com/odoo/odoo/blob/73d73c5c6606e0b34c754bfc4de035840951dd3b/addons/account/models/account_move.py#L3065 Here is why there is a tax_ids on the new lines : The field is precompute so if we don't set a value for it, _compute_tax_ids will be ran to compute it. As the account move on which the lines are added is a bill, the tax_ids will the supplier_tax_id of the product. https://github.com/odoo/odoo/blob/73d73c5c6606e0b34c754bfc4de035840951dd3b/addons/account/models/account_move_line.py#L898-L901 **Fix:** There is no need for a tax_ids on these lines as they are not meant to (and should'nt) impact the taxes. opw-5413798
4 changes
Resolved issues and error corrections
This fix addresses an error that occurred when users attempted to process multiple refunds for the same customer within a single payment transaction. The change prevents users from selecting multiple refunds, ensuring the system functions correctly and avoids data inconsistencies. This improves the reliability of the point-of-sale refund process.
Original PR description
After the fix, when selecting multiple refunds not belonging to a same order, a user error will appear, preventing an odoo error later in the flow.…
After the fix, when selecting multiple refunds not belonging to
a same order, a user error will appear, preventing an odoo
error later in the flow.
_____________________________________________________
## Short functional explanation of the error
Selecting several refunds from the same customer in the same transaction, and making sure to print an invoice at every operation caused an error.
## Reproduction Steps
1. Go to the point of sales module, and create an order for a specific customer. Proceed to the payment and make sure that finalizing the payment will create an invoice, before confirming the payment.
2. Create a second order for the same customer, and proceed the same way as in step 1.
3. On the product screen, click on "refund".
4. Select one order that you've just completed. Then, setup the quantity at 1 and click on refund.
5. Do step 4 again but this time, select the second order that you've just completed.
6. Click on payment, then click on invoice then try to validate the payment.
The error occurs:
Expected singleton: account.move(720, 722)
Traceback (most recent call last):
File "/data/build/odoo/odoo/models.py", line 5896, in ensure_one
_id, = self._ids
ValueError: too many values to unpack (expected 1)
## Causes of the problem
It is due to an ensure_one() in python. Indeed, in the file point_of_sale/models/pos_order.py,in the function _prepare_invoice_vals(self), an error occured on the line:
vals['ref'] = _('Reversal of: %s', self.refunded_order_ids.account_move.name)
self.refunded_order_ids.account_move.name is supposed to be a singleton, but in the case where a transaction has several refund order, this isn't the case anymore, causing the error.
## Explanation of the fix
After the fix, when you select a second refund after selecting one, the previous one will be replaced by the current one, preventing users to select 2 refunds in the same transaction. In the code, this is translated as:
in the point_of_sale/static/src/app/screens/ticket_screen.js file, in the onDoRefund() function, when a refund (= orderline) is created, we check that there are less than 2. If not, we remove the previous ones.
______________________________________________________________
opw-4791231
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-prThis update fixes a bug preventing changes to Sales Orders (customer, state) in draft mode from being logged in the chatter. The previous system suppressed all tracking data, but this change ensures that user-initiated modifications are accurately recorded for better auditability and communication. This improves transparency and collaboration around sales order updates.
Original PR description
**Problem:** Changes to tracked fields (customer, state) on draft Sales Orders are not logged in the chatter, even though these fields have `tracking` enabled. **Steps to reproduce:** 1. Create a…
**Problem:** Changes to tracked fields (customer, state) on draft Sales Orders are not logged in the chatter, even though these fields have `tracking` enabled. **Steps to reproduce:** 1. Create a Sales Order, do not confirm 2. Change the customer → no log in chatter 3. Confirm the SO, then cancel it 4. Set it back to Quotation → no log in chatter **Current behavior:** No chatter entry is created for either change. **Expected behavior:** Both changes should appear in the chatter since `partner_id` (tracking=1) and `state` (tracking=3) have tracking enabled. **Cause of the issue:** `_track_finalize` discards ALL tracking data whenever the SO is in `draft` state. This was originally intended to avoid noise from catalog product additions, but it also suppresses legitimate field changes like customer updates and state transitions back to draft. **Fix:** Instead of blanket-suppressing all tracking on draft SOs, only discard tracking when the change originates from the product catalog (`_update_order_line_info`), which sets a `catalog_skip_tracking` context flag. This preserves the original noise-reduction intent while allowing real user-initiated field changes to be tracked. Backport of: 311bf3426fb241cd5036db58c6c317fe0e81ab87 opw-6106537
This update resolves an issue where discounts weren't being imported accurately due to rounding discrepancies. The fix ensures that discount amounts are imported exactly as they appear on the original invoice, preventing subtotal mismatches. This improves data integrity during invoice processing, particularly for Italian VAT imports.
Original PR description
**PROBLEM** When importing an invoice, we don't want to round the discounts, to avoid discrepancy between the subtotal computed by Odoo, and the subtotal of the file we import. To do this, we change the decimal precision of discount to 100 digits when importing files. However, float_round wasn't built with this in mind, in float round, we add a small epsilon to fix some rounding issue. This small epsilon changes the amount of the discount (50.0 -> 0.5000000000004) and this changes the subtotal. **STEP TO REPRODUCE** 1. Install l10n_edi_it. 2. Change the VAT number of IT Company to 05098540288 (to match the one on the file to import). 3. Import the file present in the bug ticket. 4. Notice the subtotal of the line doesn't match what's in the invoice. **FIX** We skip rounding of the discount on import. Ticket [link](https://www.odoo.com/odoo/project.task/6046324) opw-6046324
This update resolves an issue where stock synchronization with Amazon was failing due to incorrect fulfillment channel data. The system now uses a more reliable field from the Amazon Listings API to determine channel availability, defaulting to FBM when necessary to ensure stock remains synchronized. This change also improves the process of updating FBM stock configurations.
Original PR description
During the upgrade from XML-based feeds to the new JSON Listings API for stock management, we chose to use Amazon's API to fetch a listing's fulfillment channel information. However, Amazon does not…
During the upgrade from XML-based feeds to the new JSON Listings API for stock management, we chose to use Amazon's API to fetch a listing's fulfillment channel information. However, Amazon does not provide a clear answer for a given listing. After some research, we assumed an offer was FBM when the listing contained a `merchant_shipping_group`, because this setting is specific to FBM listings. See also e6d620e4b200cadabb00ce37ab03289cfeb4ae58. This assumption was flawed: Amazon can keep the shipping group even after a listing switches to FBA, which can block stock synchronization. This commit uses the `fulfillmentAvailability` field from the Listings API instead. This field stores the available quantity for each fulfillment channel in which the listing is sold. When multiple fulfillment channels are present, the offer defaults to FBM so stock synchronization can continue. The `sale_amazon_channel_management` module can then be installed to manually select and disambiguate the channel. This commit also upgrades the patching method used to update the FBM stock to ensure user specific configuration aren't overriden during the synchronization. opw-6064896 opw-5152359