Friday, May 29, 2026
139 changes
7 changes
Enhancements to existing features
This update enhances the analytic reporting feature by adding a 'product category' field to the account.analytic.line model. This allows users to group and analyze expenses by product category within their reports, providing more granular insights into spending patterns.
Original PR description
Add the related (non-stored) 'product_category' field on the account.analytic.line model to make it available in the Analytic Reporting "Group By" task-6219418 Forward-Port-Of: odoo/odoo#266378
Resolved issues and error corrections
This update resolves an issue where the POS restaurant dashboard broke due to inconsistent record IDs between testing and production environments. The change removes reliance on these IDs, adapting the dashboard's data selection to ensure stability across all environments. This improves the reliability of the dashboard for both testing and live operations.
Original PR description
## Description of the issue/feature this PR addresses: Commit 050ecd2 introduced random serial numbers for records, which caused dashboards relying on static record IDs to break. Later, commit 87f0bee restricted this behavior to environments with `ODOO_RUNBOT` or `ODOO_TEST` enabled. As a result, production keeps stable IDs while testing environments still use random ones. Because of this difference, relying on record IDs is no longer safe, As values differ between testing and production. This PR removes the direct use of record IDs in the POS restaurant dashboard and adapts the domain accordingly. Task: [6054252](https://www.odoo.com/odoo/project/2328/tasks/6054252) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
9 changes
Resolved issues and error corrections
This update fixes an issue where employees on flexible schedules were incorrectly flagged for overtime. The change adjusts how overtime rules calculate hours worked, now accurately considering the employee's flexible calendar hours and any scheduled leaves. This ensures accurate overtime reporting for employees with varied work arrangements.
Original PR description
1 change
Resolved issues and error corrections
This update prevents a frustrating 'Invalid Operation' error during bill matching when no new purchase order lines need to be added. Previously, Odoo would attempt to update a bill, even with zero residual lines, causing a block in the process. Now, the system correctly skips the update if no new lines are required, ensuring smooth bill matching.
Original PR description
2 changes
Enhancements to existing features
This update enhances the analytic reporting feature by adding a 'product category' field to the core accounting model. This allows users to group and analyze expenses by product category within their reports, providing more granular insights into spending patterns. It's an improvement that streamlines reporting and analysis.
Original PR description
Add the related (non-stored) 'product_category' field on the account.analytic.line model to make it available in the Analytic Reporting "Group By" task-6219418 Forward-Port-Of: odoo/odoo#266378
2 changes
Resolved issues and error corrections
This update fixes an issue where a quality check failure incorrectly reduced the component quantity in a subcontracting order. The change ensures that the component quantity remains accurate, preventing stock discrepancies. This improves the reliability of production tracking within the system.
Original PR description
3 changes
New functionality added to Odoo
This update adds the ability to group analytic reports by product category. Previously, reports were limited to grouping by other fields. This enhancement provides more granular insights into spending by product type, improving financial analysis and reporting accuracy.
Original PR description
Add the related (non-stored) 'product_category' field on the account.analytic.line model to make it available in the Analytic Reporting "Group By" task-6219418
1 change
Resolved issues and error corrections
This update corrects an error in the Peru Accounting Reports (l10n_pe_reports) module that caused the SUNAT/SIRE system to reject DAM reports. The fix ensures that only the required 3-digit customs dependency code is used in field 8 of the report, aligning with SUNAT regulations. This prevents report rejections and ensures accurate data submission.
Original PR description
This update ensures that backorders created during POS sales are correctly linked to the original POS order. Previously, these backorders lacked a connection, making inventory management more complex. This fix improves order traceability and reporting accuracy within the Point of Sale system.
Original PR description
The delivery transfer for a product tracked by serial number is not linked to the POS order when there is no available stock. When validating a POS delivery in real time, stock can split the transfer…
The delivery transfer for a product tracked by serial number is not linked to the POS order when there is no available stock. When validating a POS delivery in real time, stock can split the transfer into a completed picking and a backorder (e.g. one line fully delivered with lots, another serial-tracked line with no stock and no serial number). Steps to reproduce: ------------------- * Setup two products: one tracked by qunatity with some quantity on-hand an other tracked by SN but no quantity on-hand * Open Pos * Sell in one order, both products without providing SN * Validate payment * Open Inventory: two deliveries sould exist under Inventory Overview of PoS Orders > Observation: The first picking shows the POS order as Source Document but the backorder has no source document and is not linked to the POS order. Why the fix: ------------ Pos Origin (Source Document, POS order, session) was only written on the pickings returned by `_create_picking_from_pos_order_lines`, which did not include pickings created during `_action_done()`. Extend the write to the initial pickings and their backorders so every transfer stays tied to the originating `pos.order`. opw-6090606 Forward-Port-Of: odoo/odoo#266509 Forward-Port-Of: odoo/odoo#259370
This update corrects a bug in the overtime calculation process. Previously, overlapping overtime rules were incorrectly combined, leading to inaccurate overtime intervals. This fix ensures overtime is calculated correctly, preventing potential discrepancies in employee pay.
Original PR description
**Issue:** When computing timing overtime rules, overlapping intervals from different rules were accidentally merged before the overlap resolution step. As a result, the overlap generation logic no longer had access to the original rule boundaries and could not correctly create the final overtime intervals. **Solution:** Keep the original intervals from each rule untouched until the final overlap resolution step so overlaps can be properly sliced and resolved when generating the final overtime intervals. Task: 6168492 Forward-Port-Of: odoo/odoo#266096
This update prevents a critical error during bill matching in Odoo when no new purchase order lines need to be added. Previously, attempting to match a posted bill with zero residual lines would trigger a system error. Now, the system gracefully handles this scenario, ensuring the matching process completes successfully and avoids data corruption.
Original PR description
**Description of the issue/feature this PR addresses:** This PR fixes an "Invalid Operation" UserError during the Bill Matching process. The error occurs when Odoo attempts to call the line addition…
**Description of the issue/feature this PR addresses:** This PR fixes an "Invalid Operation" UserError during the Bill Matching process. The error occurs when Odoo attempts to call the line addition method on a Posted Vendor Bill, even when there are no new residual lines to add. This triggers a write attempt on read-only fields (such as invoice_line_ids) of a validated account move, which is prohibited by Odoo’s ORM. Furthermore, this addresses a functional inconsistency: Odoo allows users to select "Posted" bills in the matching view, but the underlying code is not prepared to handle a "zero residual" scenario on a validated move. If Odoo intends to prevent matching on posted bills, they should be filtered out from the view; since they are available to select, the system must be able to process them when no further modifications to the accounting entries are required. **Current behavior before PR:** When performing a match between a posted Vendor Bill and Purchase Order lines where the "residual" (lines left to add) is zero: The system executes _add_purchase_order_lines() regardless of whether the recordset of lines is empty. Odoo's ORM detects an update attempt on a posted record. A UserError is raised: "You cannot modify the following readonly fields on a posted move: invoice_line_ids". This blocks the user from completing the matching process even if the lines are already technically accounted for. **Desired behavior after PR is merged:** The system will check if residual_purchase_order_lines contains any records before attempting to update the bill. If there are no lines to add, the method call is skipped. The matching process completes successfully without attempting an illegal write on a posted move. **Steps to Reproduce** 1) Create a Purchase Order (PO): Add a product (e.g., "Acoustic Bloc Screens") and confirm the order. 2) Create a Vendor Bill manually: Do not use the "Create Bill" button from the PO. Instead, go to Accounting -> Vendors -> Bills and create a new bill for the same vendor and product. 3) Post the Bill: Set a bill date and click Confirm to move it to the "Posted" state. 4) Open Bill Matching: Go back to the Purchase Order and click the Bill Matching button (or navigate to the matching view). 5) Select Lines: Select the PO line and the corresponding Bill line (which are already equal in quantity/price). 6) Trigger the Match: Click on the Match button. Observe Error: An "Invalid Operation" popup appears, preventing the link because Odoo tries to "add" zero lines to a posted invoice. **Video:** https://drive.google.com/file/d/12aeZIx1JRRSKA9TaWfXy0TeSOgMUMQcg/view --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#241171
This pull request optimizes the performance of the account report sheet by streamlining CSS styling and reducing unnecessary DOM calculations. By using CSS variables and more direct selectors, the changes minimize visual rendering impacts, particularly on large tables, leading to a smoother user experience. This resolves performance bottlenecks related to hover effects and table styling.
Original PR description
Forward-Port-Of: odoo/enterprise#118674 Forward-Port-Of: odoo/enterprise#118490
This update resolves an issue preventing users from unreconciling SEPA CT payments with a 'pending' online status. Previously, the system incorrectly blocked this process, causing delays in bank statement reconciliation. The fix allows internal unreconciliation flows to bypass validation, ensuring accurate bank statement matching.
Original PR description
**Issue:** The account_online_payment module overrides `action_draft` to raise a UserError for sepa_ct payments belonging to a batch with a `payment_online_status` = 'pending' or 'accepted'. This…
**Issue:** The account_online_payment module overrides `action_draft` to raise a UserError for sepa_ct payments belonging to a batch with a `payment_online_status` = 'pending' or 'accepted'. This blocks the bank statement unreconciliation process. When `delete_reconciled_line` is called, it tries to set payments to draft and re-post them, despite it being an internal process not a manual user modification. **Steps to reproduce:** - Setup a 'sepa_ct' payment method on a bank journal. - Create a bill with a vendor with a trusted bank account. - Create a payment for that bill with a 'sepa_ct' payment method. - Add the payment to a batch. - Manually set the `payment_online_status` = 'pending'. - Create a bank transaction and reconcile it with the batch. - Try to unreconcile the lines on the transaction - Result: UserError 'You cannot modify a payment that has already been sent to the bank.' **Fix:** Pass a context flag to `action_draft` during the unreconciliation flow so that the validation is skipped when the call originates from the internal unreconcile flow. OPW-6080464 Forward-Port-Of: odoo/enterprise#118342 Forward-Port-Of: odoo/enterprise#117921
**Steps to reproduce:** - Create a flexible 32h/week calendar (8h/day, 4 days) - Assign it to an employee with the Default Ruleset - Create attendances: 8h on Monday, Tuesday, Friday, and Saturday…
**Steps to reproduce:** - Create a flexible 32h/week calendar (8h/day, 4 days) - Assign it to an employee with the Default Ruleset - Create attendances: 8h on Monday, Tuesday, Friday, and Saturday (32h total, matching the weekly budget) - Select the list view and go to the month of the attendances - Employee shows 16:00 Worked Extra Hours (8h on Fri + 8h on Sat) **Cause:** `resource.calendar._attendance_intervals_batch` generates work intervals for flexible calendars by front loading the weekly hour budget onto the first days of the week (Mon 8h, Tue 8h, Wed 8h, Thu 8h for a 32h calendar), But days beyond the budget (Fri, Sat, Sun) get zero hours. The two overtime rule paths relies on these synthetic intervals: 1) The quantity rule: `_get_daterange_overtime_undertime_intervals_for_quantity_rule()` computed `expected_duration` by intersecting the synthetic schedule with each day. For Fri/Sat the intersection was empty (expected = 0) -> all worked hours counted as overtime. https://github.com/odoo/odoo/blob/b31fd6816521ff43fb3a9ec37e79e9a9d628d357/addons/hr_attendance/models/hr_attendance_overtime_rule.py#L302-L304 **update** solved by: https://github.com/odoo/odoo/pull/265120/changes/94d4bfffa053cd78ce07ff07ab14b53e8d931053 2) The timing rule: `_get_rules_intervals_by_timing_type()` derived "work_days" from the synthetic schedule and inverted them to get "non_work_days". (Fri, Sat, Sun) were classified as non-working days, therefore, any attendance on those days triggered full overtime. https://github.com/odoo/odoo/blob/b31fd6816521ff43fb3a9ec37e79e9a9d628d357/addons/hr_attendance/models/hr_attendance_overtime_rule.py#L421-L433 **Solution:** For flexible calendars in the overtime rule consumer: - Quantity rules: read expected hours directly from the calendar's `hours_per_day` / `hours_per_week` instead of the synthetic schedule intervals, subtracting any leaves in the period - Timing rules: treat the entire attendance date range (minus leaves) as potential work days, so that `non_work_days` is empty for flexible employees (they can work any day of the week) opw-6067063 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#263840
This update fixes a bug that prevented purchase matching from working correctly when vendor bills only used a description for identification, rather than a product. The change ensures that purchase matching processes vendor bills accurately, regardless of whether a product is specified, improving data consistency and reducing potential errors.
Original PR description
### Issue before this commit: Opening the Purchase Matching wizard would crash if the vendor bill contained lines with a description and a Unit of Measure (UoM), but no product selected. ### Steps to…
### Issue before this commit: Opening the Purchase Matching wizard would crash if the vendor bill contained lines with a description and a Unit of Measure (UoM), but no product selected. ### Steps to reproduce the issue: 1. Enable Units of Measure in Settings 2. Create and confirm a Vendor Bill setting a description and a UoM, but leave the Product field empty. 3. Click on "Purchase matching" smart button 4. The system throws a traceback with the error: "The unit of measure Unit defined on the order line doesn't belong to the same category as the unit of measure False defined on the product." ### Cause of the issue: In the purchase.bill.line.match model, the field product_uom_qty was computed by calling _compute_quantity using line.product_uom_id. Since product_uom_id is a related field on product_id.uom_id, it returns False when no product is set. The UoM conversion logic cannot handle a False destination category, leading to the crash. ### Reason to introduce the fix: Make purchase matching robust when imported vendor bills contain lines identified only by their description and not by a product. Note that for `purchase.bill.line.match` corresponding to an account.move.line but not related to any product, the `product_uom_qty` should match the quantity of the `aml_id` instead of attempting a UoM conversion based on a missing product UoM for the behavior to be consistent with the inverse method: https://github.com/odoo/odoo/blob/59d6232979b8499fde6cb700df1870e2e38d0d3e/addons/purchase/models/purchase_bill_line_match.py#L45-L54 opw-5911526 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#266269 Forward-Port-Of: odoo/odoo#257827
This update fixes a previous issue where payment transaction details weren't consistently saved in Odoo, particularly when payments were received via polling instead of webhooks. The fix ensures all relevant payment information, including card details, is now captured and stored correctly, improving the reliability of payment processing for Viva Wallet transactions.
Original PR description
After odoo/odoo#236454, a bug was introduced where the transaction details would only be saved if the payment was resolved via webhook, not via polling. This commit fixes the issue by using the same field names in the webhook payload as is received from the polling endpoint. In addition, the card number and card brand fields are now saved too. opw-6244960 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#266788 Forward-Port-Of: odoo/odoo#266629
This update resolves a problem where the system incorrectly identified employees when using Point of Sale (POS) with multiple companies. The issue stemmed from a change in how downpayment products were set, leading to conflicting company data. The fix ensures employees are correctly associated with the appropriate company during POS operations.
Original PR description
Step to reproduce: - install point_of_sale with demo - have two company and 1 pos in each company - install pos_hr - install pos_sale Observation: - we get a traceback ``` File…
Step to reproduce:
- install point_of_sale with demo
- have two company and 1 pos in each company
- install pos_hr
- install pos_sale
Observation:
- we get a traceback
```
File "/src/saas-19.2/odoo/orm/fields_misc.py", line 115, in __get__
raise ValueError("Expected singleton: %s" % record) from None
ValueError: Expected singleton: res.company(7, 8)
```
- and pos_sale is not installed
Cause:
- when installing `pos_sale` `_ensure_downpayment_product` is called.
- this sets downpayment product on every `pos.config` record.
- this triggers write call from pos_hr, which tries to identify users for pos
- this uses `with_company(self.company)` <----- actual issue
- here self has two config, each from different company, hence `with_company`
raises singleton error
why not in earlier verison:
- before commit [1] we only set downpayment product on only pos_config_main
- now we set it on every pos.config, so now self contain multiple records
[1] https://github.com/odoo/odoo/commit/a3f9114434c7cab8757b0283698662792e6b7946
Fix:
- compute users by first grouping them over company_id
related pr: https://github.com/odoo/odoo/pull/254026
opw-6217135
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis update fixes an issue where task defaults were lost when navigating between weeks in the planning calendar view. Now, when switching to the next week using the arrows, the previously selected task is automatically preserved, ensuring a smoother scheduling experience. This improves usability and reduces the need for manual task selection.
Original PR description
Issue: ---------------------------------------- The default values aren't kept when using the previous/next arrows in planning calendar view. Steps to reproduce:…
Issue: ---------------------------------------- The default values aren't kept when using the previous/next arrows in planning calendar view. Steps to reproduce: ---------------------------------------- - Go on a Project task - Click the "To Schedule" button - Switch to calendar view - If we create now, the new slot will have the task as default value - Click the arrow to switch to next week - If we create there will be no default values Cause: ---------------------------------------- Since 7b844902e5c3a7aeedda6cc2be61366caad2d144 the context is lost when using the arrows. When switching to calendar view `load()` is called with the context in the params: https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/web/static/src/model/model.js#L163-L164 But when using the arrows, it is called with only a date: https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/web/static/src/views/calendar/calendar_controller.js#L426 So `...params.context,` is empty, and the context is only `hide_planned_dates: true,`. Solution: ---------------------------------------- If no context is specified in params, we use the one in `this.meta` to allow changing the context by giving it in the params but keeping the previous context when it's not given. opw-6211055
This update corrects a bug where duplicated Manufacturing Orders created with the 'Replenish on Order' feature were incorrectly linked to the original Sales Order. The fix prevents the duplication of the Sales Order ID during Manufacturing Order creation, ensuring that duplicated orders are independent and don't show incorrect links.
Original PR description
Version: --------- - 19.0+ Steps to reproduce: -------------------- 1.Install modules `sale_management`, `purchase`, and `mrp`. 2. Go to Settings and enable the MTO (Replenish on Order) route. 3.…
Version:
---------
- 19.0+
Steps to reproduce:
--------------------
1.Install modules `sale_management`, `purchase`, and `mrp`.
2. Go to Settings and enable the MTO (Replenish on Order) route.
3. Create a product with:
i. Configure a Vendor under the Purchase tab.
ii. Set the route to MTO.
iii. Create a Bill of Materials for the product.
5. Create a Sale Order with the configured product and confirm it.
6. Open the generated Manufacturing Order.
7. Duplicate the Manufacturing Order.
Issue:
------
* The duplicated Manufacturing Order shows a smart button
linked with the Sale Order, which is incorrect.
Root Cause:
------------
This issue is coming form this [Commit](https://github.com/odoo/odoo/commit/2713876dbc70d3984e584a9037a2206dcda4e84a#diff-2b9de2e50ff5e1dc0362b825bac2b07623770fb3275b3257ef972f255f3ccb8b)
* During Sale Order confirmation, the flow
`action_confirm` → `_action_confirm` → `_action_launch_stock_rule`
→ `run` → `_run_pull` → `_action_confirm` calls
`_prepare_procurement_values`.
which gather all procurement values.
In sale_stock, the super call adds `sale_line_id` to the
generated Manufacturing Order when using MTO:
https://github.com/odoo/odoo/blob/0352c5e8543b75083cf555c3d5b4f164f949b465/addons/sale_stock/models/stock.py#L138-L140
* So, when the Sale Order is confirmed, the generated
Manufacturing Order contains sale_line_id, and when this
Manufacturing Order is duplicated, the sale_line_id is also
copied.
* In sale_mrp, the smart button uses sale_line_id to compute
the linked Sale Order count:
https://github.com/odoo/odoo/blob/0352c5e8543b75083cf555c3d5b4f164f949b465/addons/sale_mrp/models/mrp_production.py#L19
Solution:
-----------
* Prevent copying of sale_line_id when duplicating a
Manufacturing Order, ensuring duplicated records are not
linked to any Sale Order.
---
opw-6113149
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#259128This update resolves a crash that occurred when sending final invoices to ZATCA for sales orders with multiple down-payment references. The fix prevents a software error caused by attempting to process both reversed and active down-payment invoices simultaneously. It now prioritizes non-reversed down payments, ensuring accurate ZATCA reporting.
Original PR description
Sending the final invoice of a sale order to ZATCA crashed with `ValueError: Expected singleton: account.move(a, b)` when the sale order had multiple down-payment references. Steps to reproduce: 1.…
Sending the final invoice of a sale order to ZATCA crashed with `ValueError: Expected singleton: account.move(a, b)` when the sale order had multiple down-payment references. Steps to reproduce: 1. Configure a SA company and setup ZATCA 2. Create a sale order and confirm it 3. Deliver the product line. 3. From the sale order, create a down-payment invoice (fixed amount, e.g. 115) and post it (DP1). 4. On DP1, click "Credit Note" and choose "Full refund and new draft invoice"; validate. DP1 becomes `reversed` and a new draft down-payment DP2 is created. Post DP2. 5. From the sale order, create the final regular invoice and post it. 6. Send the final invoice to ZATCA (or generate its XML) -> `ValueError: Expected singleton: account.move(a, b)`. Root cause: _l10n_sa_get_line_prepayment_vals looks up the related down-payment move through the down-payment sale order line shared with the product line. The filter matched any out_invoice with _is_downpayment() == True, so the reversed DP1 and the active DP2 both ended up in the recordset, and reading .name raised the singleton error. Prefer non-reversed down-payment moves when available, but fall back to reversed ones if no alternative exists (e.g. when generating a credit note of the final invoice after the original down-payment was itself reversed). opw-6116265 Forward-Port-Of: odoo/odoo#264435 Forward-Port-Of: odoo/odoo#259384
This pull request optimizes the performance of the account report sheet by streamlining CSS styling and reducing unnecessary DOM calculations. By using CSS variables and more direct selectors, the changes minimize visual rendering impacts, particularly on large tables, leading to a smoother user experience. This resolves performance bottlenecks related to hover effects and table styling.
Original PR description
Forward-Port-Of: odoo/enterprise#118674 Forward-Port-Of: odoo/enterprise#118490
This update fixes an issue where overtime calculations were inaccurate due to overlapping rules. The fix ensures that original overtime intervals are preserved, allowing for correct overlap resolution and accurate overtime generation. This improves the reliability of overtime tracking.
Original PR description
**Issue:** When computing timing overtime rules, overlapping intervals from different rules were accidentally merged before the overlap resolution step. As a result, the overlap generation logic no longer had access to the original rule boundaries and could not correctly create the final overtime intervals. **Solution:** Keep the original intervals from each rule untouched until the final overlap resolution step so overlaps can be properly sliced and resolved when generating the final overtime intervals. Task: 6168492 Forward-Port-Of: odoo/odoo#266096
**Description of the issue/feature this PR addresses:** This PR fixes an "Invalid Operation" UserError during the Bill Matching process. The error occurs when Odoo attempts to call the line addition…
**Description of the issue/feature this PR addresses:** This PR fixes an "Invalid Operation" UserError during the Bill Matching process. The error occurs when Odoo attempts to call the line addition method on a Posted Vendor Bill, even when there are no new residual lines to add. This triggers a write attempt on read-only fields (such as invoice_line_ids) of a validated account move, which is prohibited by Odoo’s ORM. Furthermore, this addresses a functional inconsistency: Odoo allows users to select "Posted" bills in the matching view, but the underlying code is not prepared to handle a "zero residual" scenario on a validated move. If Odoo intends to prevent matching on posted bills, they should be filtered out from the view; since they are available to select, the system must be able to process them when no further modifications to the accounting entries are required. **Current behavior before PR:** When performing a match between a posted Vendor Bill and Purchase Order lines where the "residual" (lines left to add) is zero: The system executes _add_purchase_order_lines() regardless of whether the recordset of lines is empty. Odoo's ORM detects an update attempt on a posted record. A UserError is raised: "You cannot modify the following readonly fields on a posted move: invoice_line_ids". This blocks the user from completing the matching process even if the lines are already technically accounted for. **Desired behavior after PR is merged:** The system will check if residual_purchase_order_lines contains any records before attempting to update the bill. If there are no lines to add, the method call is skipped. The matching process completes successfully without attempting an illegal write on a posted move. **Steps to Reproduce** 1) Create a Purchase Order (PO): Add a product (e.g., "Acoustic Bloc Screens") and confirm the order. 2) Create a Vendor Bill manually: Do not use the "Create Bill" button from the PO. Instead, go to Accounting -> Vendors -> Bills and create a new bill for the same vendor and product. 3) Post the Bill: Set a bill date and click Confirm to move it to the "Posted" state. 4) Open Bill Matching: Go back to the Purchase Order and click the Bill Matching button (or navigate to the matching view). 5) Select Lines: Select the PO line and the corresponding Bill line (which are already equal in quantity/price). 6) Trigger the Match: Click on the Match button. Observe Error: An "Invalid Operation" popup appears, preventing the link because Odoo tries to "add" zero lines to a posted invoice. **Video:** https://drive.google.com/file/d/12aeZIx1JRRSKA9TaWfXy0TeSOgMUMQcg/view --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#241171
Resolved issues and error corrections
This update prevents a critical error during bill matching in Odoo when no new purchase order lines need to be added. Previously, attempting to match a 'Posted' bill with zero residual lines would trigger a system error. Now, the system correctly handles this scenario, ensuring smooth bill matching and preventing data inconsistencies.
Original PR description
**Description of the issue/feature this PR addresses:** This PR fixes an "Invalid Operation" UserError during the Bill Matching process. The error occurs when Odoo attempts to call the line addition…
**Description of the issue/feature this PR addresses:** This PR fixes an "Invalid Operation" UserError during the Bill Matching process. The error occurs when Odoo attempts to call the line addition method on a Posted Vendor Bill, even when there are no new residual lines to add. This triggers a write attempt on read-only fields (such as invoice_line_ids) of a validated account move, which is prohibited by Odoo’s ORM. Furthermore, this addresses a functional inconsistency: Odoo allows users to select "Posted" bills in the matching view, but the underlying code is not prepared to handle a "zero residual" scenario on a validated move. If Odoo intends to prevent matching on posted bills, they should be filtered out from the view; since they are available to select, the system must be able to process them when no further modifications to the accounting entries are required. **Current behavior before PR:** When performing a match between a posted Vendor Bill and Purchase Order lines where the "residual" (lines left to add) is zero: The system executes _add_purchase_order_lines() regardless of whether the recordset of lines is empty. Odoo's ORM detects an update attempt on a posted record. A UserError is raised: "You cannot modify the following readonly fields on a posted move: invoice_line_ids". This blocks the user from completing the matching process even if the lines are already technically accounted for. **Desired behavior after PR is merged:** The system will check if residual_purchase_order_lines contains any records before attempting to update the bill. If there are no lines to add, the method call is skipped. The matching process completes successfully without attempting an illegal write on a posted move. **Steps to Reproduce** 1) Create a Purchase Order (PO): Add a product (e.g., "Acoustic Bloc Screens") and confirm the order. 2) Create a Vendor Bill manually: Do not use the "Create Bill" button from the PO. Instead, go to Accounting -> Vendors -> Bills and create a new bill for the same vendor and product. 3) Post the Bill: Set a bill date and click Confirm to move it to the "Posted" state. 4) Open Bill Matching: Go back to the Purchase Order and click the Bill Matching button (or navigate to the matching view). 5) Select Lines: Select the PO line and the corresponding Bill line (which are already equal in quantity/price). 6) Trigger the Match: Click on the Match button. Observe Error: An "Invalid Operation" popup appears, preventing the link because Odoo tries to "add" zero lines to a posted invoice. **Video:** https://drive.google.com/file/d/12aeZIx1JRRSKA9TaWfXy0TeSOgMUMQcg/view --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#241171
*:mrp_subcontracting{,_quality}, quality_control **Issue**: In subcontracting, if a quality check of type quantity failed, the associated mo quantity produced is reduced. This is an issue since it…
*:mrp_subcontracting{,_quality}, quality_control
**Issue**:
In subcontracting, if a quality check of type quantity failed, the associated mo quantity produced is reduced. This is an issue since it will, by extension, reduce the consumption of the component. Therefore, the stock of the component become incorrect.
**Steps to reproduce**:
- Create two tracked products (final and component)
- Create a BoM for the final product using the component (1:1 ratio), with subcontracting
- Create a quality check for that product:
- Control per quantity
- Operations type: receipts
- Create a PO for the final product:
- With a quantity of 10
- With the associated partner be the one mentioned in the subcontracting BOM
- Confirm it
- Open the associated receipt
- Perform the quality check and fail 4 products
- Validate the receipt by creating a backorder
- Confirm the backorder
- Check move history -> The move associated to the component will have a quantity of 6 instead of 10.
**Cause**:
While failing a quality check:
https://github.com/odoo/enterprise/blob/8cd7fffde3c9e73fa95080a82c5750d1a74370cb/quality_mrp/models/quality.py#L56 https://github.com/odoo/enterprise/blob/8cd7fffde3c9e73fa95080a82c5750d1a74370cb/quality_control/models/quality.py#L471
The `product_uom_qty` of the move of the po will be reduced. Therefore, the subcontracting mo quantity is reduced too: https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp_subcontracting/models/stock_move.py#L140-L143 https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp_subcontracting/models/stock_move.py#L116-L119
And ultimately reduces the raw move quantity:
https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp/wizard/change_production_qty.py#L65
**Additional note**:
This commit also reverts the fix of c4e10e9fa90562b16d515f62910e094f77497f66 since it ensured the correct production was reduced. However, this commit ensures that production is not reduced at all, making the previous fix obsolete.
opw-5427873
Forward-Port-Of: odoo/enterprise#114358This update fixes an issue where failing quality checks in subcontracting production orders incorrectly reduced quantities, preventing accurate recording of products. The change ensures that quantities are properly adjusted based on the inspected lot, resolving inconsistencies and allowing for complete product recording after a quality failure. This improves the reliability of subcontracting processes.
Original PR description
*:mrp_subcontracting{,_quality}, quality_control **Issue** In subcontracting, a failing quality check could lead to inconsistent quantities. **Steps to reproduce** - Create two tracked products…
*:mrp_subcontracting{,_quality}, quality_control
**Issue**
In subcontracting, a failing quality check could lead to inconsistent quantities.
**Steps to reproduce**
- Create two tracked products (final and component)
- Create a BoM for the final product using the component, with subcontracting
- Create a pass/fail Quality check with:
- Operation type: Receipts
- Control per Quantity
- Create a PO for the final product:
- With a quantity of 3
- With the associated partner be the one mentioned in the subcontracting BOM
- Confirm it
- Open the associated receipt
- Record 2/3 products
- Perform the quality check and fail 1 product
-> The quantity is removed from the 1 unrecorded product instead of the recorded ones
-> It is no longer possible to record additional products, although 1 should still be available
**Cause**
While recording products, the subcontracting production is split into multiple productions:
https://github.com/odoo/odoo/blob/a03fb90069c5a51340c81626cc90dbea22ca45bb/addons/mrp_subcontracting/models/mrp_production.py#L76
https://github.com/odoo/odoo/blob/a03fb90069c5a51340c81626cc90dbea22ca45bb/addons/mrp_subcontracting/models/mrp_production.py#L94
When a quality check fails, the quantity is reduced on the stock move:
https://github.com/odoo/enterprise/blob/2d3722242461a77ed954cc09835539e8010494f8/quality_control/models/quality.py#L471
This reduction is propagated to the subcontracting productions, removing the quantity from the first production,
then the next one if needed.
The production order is determined here:
https://github.com/odoo/odoo/blob/a03fb90069c5a51340c81626cc90dbea22ca45bb/addons/mrp_subcontracting/models/stock_move.py#L320
As a result, the reduction could be applied to a production unrelated to the inspected lot.
**Solution**
In case of a quality failure, ensure subcontracting productions are ordered so that:
- productions linked to the inspected finished lot (when lot tracking is enabled), and
- among them, productions that have already been recorded
are reduced first when applying the quality failure.
opw-5427873
Forward-Port-Of: odoo/enterprise#104424Resolved issues and error corrections
This update fixes an issue where a quality check failure incorrectly reduced the quantity of components used in a subcontracting production. Now, the system accurately reflects the reduced component consumption, preventing incorrect stock levels. This ensures accurate tracking of materials and avoids over-ordering components.
Original PR description
*:mrp_subcontracting{,_quality}, quality_control **Issue**: In subcontracting, if a quality check of type quantity failed, the associated mo quantity produced is reduced. This is an issue since it…
*:mrp_subcontracting{,_quality}, quality_control
**Issue**:
In subcontracting, if a quality check of type quantity failed, the associated mo quantity produced is reduced. This is an issue since it will, by extension, reduce the consumption of the component. Therefore, the stock of the component become incorrect.
**Steps to reproduce**:
- Create two tracked products (final and component)
- Create a BoM for the final product using the component (1:1 ratio), with subcontracting
- Create a quality check for that product:
- Control per quantity
- Operations type: receipts
- Create a PO for the final product:
- With a quantity of 10
- With the associated partner be the one mentioned in the subcontracting BOM
- Confirm it
- Open the associated receipt
- Perform the quality check and fail 4 products
- Validate the receipt by creating a backorder
- Confirm the backorder
- Check move history -> The move associated to the component will have a quantity of 6 instead of 10.
**Cause**:
While failing a quality check:
https://github.com/odoo/enterprise/blob/8cd7fffde3c9e73fa95080a82c5750d1a74370cb/quality_mrp/models/quality.py#L56 https://github.com/odoo/enterprise/blob/8cd7fffde3c9e73fa95080a82c5750d1a74370cb/quality_control/models/quality.py#L471
The `product_uom_qty` of the move of the po will be reduced. Therefore, the subcontracting mo quantity is reduced too: https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp_subcontracting/models/stock_move.py#L140-L143 https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp_subcontracting/models/stock_move.py#L116-L119
And ultimately reduces the raw move quantity:
https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp/wizard/change_production_qty.py#L65
**Additional note**:
This commit also reverts the fix of 05ebbc27e37eaeff13dd0af2a8cdd7fa28209595 since it ensured the correct production was reduced. However, this commit ensures that production is not reduced at all, making the previous fix obsolete.
opw-5427873This update fixes an issue where a quality check failure in subcontracting incorrectly reduced the quantity of components used. This prevented accurate stock levels from being maintained, leading to incorrect consumption. The change ensures the correct production quantity is reduced, maintaining accurate component stock.
Original PR description
*:mrp_subcontracting{,_quality}, quality_control **Issue**: In subcontracting, if a quality check of type quantity failed, the associated mo quantity produced is reduced. This is an issue since it…
*:mrp_subcontracting{,_quality}, quality_control
**Issue**:
In subcontracting, if a quality check of type quantity failed, the associated mo quantity produced is reduced. This is an issue since it will, by extension, reduce the consumption of the component. Therefore, the stock of the component become incorrect.
**Steps to reproduce**:
- Create two tracked products (final and component)
- Create a BoM for the final product using the component (1:1 ratio), with subcontracting
- Create a quality check for that product:
- Control per quantity
- Operations type: receipts
- Create a PO for the final product:
- With a quantity of 10
- With the associated partner be the one mentioned in the subcontracting BOM
- Confirm it
- Open the associated receipt
- Perform the quality check and fail 4 products
- Validate the receipt by creating a backorder
- Confirm the backorder
- Check move history -> The move associated to the component will have a quantity of 6 instead of 10.
**Cause**:
While failing a quality check:
https://github.com/odoo/enterprise/blob/8cd7fffde3c9e73fa95080a82c5750d1a74370cb/quality_mrp/models/quality.py#L56 https://github.com/odoo/enterprise/blob/8cd7fffde3c9e73fa95080a82c5750d1a74370cb/quality_control/models/quality.py#L471
The `product_uom_qty` of the move of the po will be reduced. Therefore, the subcontracting mo quantity is reduced too: https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp_subcontracting/models/stock_move.py#L140-L143 https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp_subcontracting/models/stock_move.py#L116-L119
And ultimately reduces the raw move quantity:
https://github.com/odoo/odoo/blob/ca01e606928a7704c6b2e4f430710f895be2653d/addons/mrp/wizard/change_production_qty.py#L65
**Additional note**:
This commit also reverts the fix of c4e10e9fa90562b16d515f62910e094f77497f66 since it ensured the correct production was reduced. However, this commit ensures that production is not reduced at all, making the previous fix obsolete.
opw-5427873**Steps to reproduce:** * Install Peru - Accounting Reports (l10n_pe_reports). * Create a vendor bill with Document Type 50 (Declaración Aduanera de Mercancías - DAM) and a document number in the…
**Steps to reproduce:** * Install Peru - Accounting Reports (l10n_pe_reports). * Create a vendor bill with Document Type 50 (Declaración Aduanera de Mercancías - DAM) and a document number in the standard pediment format (e.g. C235202610-38047). * Go to Accounting > Reporting > Purchase Electronic Record (RCE 8.4). * Export the TXT file and open it. **Observed behavior:** * Field 8 contains the full first numeric block of the document name including the year and sequence digits (e.g. 235202610) instead of only the 3-digit customs dependency code. * SUNAT/SIRE rejects the file immediately because 235202610 does not exist in Table 4 (RS 040-2022), which only defines 3-digit codes. **Cause:** * `_get_serie_folio()` splits the document name by taking everything before the last digit group as the serie. For a name like C235202610-38047 this produces serie = "C235202610", and the existing `serie[1:]` logic strips only the leading letter, leaving "235202610" in field 8 instead of the 3-digit customs dependency code "235". * The same incorrect value was also written to field 28 (aduana_code). * ref : https://www.sunat.gob.pe/legislacion/superin/2022/anexo-040-2022.pdf **Fix:** * For document types 50 and 52, extract the first numeric group from the document name using `re.search(r'\d+', move_name)` and slice the first 3 characters to obtain the customs dependency code as defined in SUNAT Table 4 (always a 3-digit value). * Apply the same logic to field 28 (aduana_code) for consistency. opw-6157662