Skip to content

Fork Sync Branch 18.0 - #17

Merged
btl-bot merged 1 commit into
BTLzdravtech:18.0from
ingadhoc:18.0
Oct 22, 2026
Merged

btl-bot merged 1 commit into
BTLzdravtech:18.0from
ingadhoc:18.0

Conversation

@btl-bot

@btl-bot btl-bot commented Oct 22, 2026

Copy link
Copy Markdown

No description provided.

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 sireko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved

@btl-bot
btl-bot merged commit 668a09d into BTLzdravtech:18.0 Oct 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants