Friday, May 29, 2026
3 changes · saas-18.2
Resolved issues and error corrections
This update fixes an issue where global invoices created after a POS order at the end of the month were incorrectly displaying the following month. The system now accurately converts POS order dates to the correct Mexican timezone, ensuring invoices reflect the actual order date and preventing month discrepancies.
Original PR description
**PROBLEM** When creating a global invoice, with the last order being at the end of the last day of the month, the month of the global invoice will not be correct. (e.g, order made at the end of May and global invoice created for June). date_order is stored in utc. To compute the day the order was made, we need to convert to a MX timezone. **STEP TO REPRODUCE** 1. Create an pos order at the end of the last day of a month (for example, at 10PM in local MX time). 2. Create a global invoice with this order. 3. Notice the global invoice month will be the month after the one of the order. opw-6221049 Forward-Port-Of: odoo/enterprise#118170
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
*: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#104424