Repository navigation
Fork Sync Branch 18.0 - #17
Merged
Merged
Conversation
Cancel remaining on a subcontracted line raised "Nothing to check the availability for." and left the order unusable, with nothing or part of it received. Lowering product_qty makes core create a negative move that nets against the pending receipt and empties it. mrp_subcontracting then calls action_assign() on that receipt in _action_confirm(), and the receipt has no open move left. For subcontracted lines, cancel the open receipt moves before lowering the quantity, so no negative move is created. Cancelling the receipt cancels the subcontracting MO and, through its procurement group, the resupply transfer. Ordering the quantity again creates a new MO with the current BoM. propagate_cancel is turned off first, as core does when it nets the negative move, so a customer delivery fed by the receipt is not cancelled. If the subcontractor already recorded production on the MO, stop with a message instead of cancelling it and losing what was recorded: the user receives what was produced or cancels the MO first. With a refunded return the line keeps the previous flow: there the negative move does not empty the receipt, and cancelling first would make core create a new receipt and MO for the returned quantity. Other lines keep the current flow. The filter of open moves to cancel moves to _get_remaining_moves_to_cancel(), used in both places. Change note: Al usar "Cancelar remanente" en una línea de compra de un producto subcontratado, con nada o parte recibido, Odoo mostraba el error "No hay nada para lo que comprobar disponibilidad" y la compra quedaba sin poder modificarse. Ahora se cancelan la recepción pendiente, la orden de subcontratación y el reabastecimiento al subcontratista. Si después se vuelve a cargar la cantidad, se genera todo de nuevo con la lista de materiales vigente. La entrega a un cliente que dependa de esa compra no se cancela. Si el subcontratista ya registró producción, se avisa para recibir lo producido o cancelar esa orden de producción antes de cancelar el remanente. closes #377 Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
sireko
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.