diff --git a/sale_stock_ux/models/sale_order_line.py b/sale_stock_ux/models/sale_order_line.py index b9c9302e8..d7f2ee9d3 100644 --- a/sale_stock_ux/models/sale_order_line.py +++ b/sale_stock_ux/models/sale_order_line.py @@ -110,6 +110,25 @@ def button_cancel_remaining(self): if pack_enable and rec.product_id.pack_ok and rec.pack_type == "detailed" and rec.pack_child_line_ids: rec.pack_child_line_ids.with_context(cancel_from_order=True).button_cancel_remaining() old_product_uom_qty = rec.product_uom_qty +<<<<<<< 36e33d055a998bbc46bd428f34c0057b67d08d17 +||||||| 380feda1877dd26dd22757964c9d2b68c08fb2a0 + + # Resetear printed=False en pickings asociados para evitar contra-entregas + printed_pickings = rec.move_ids.mapped("picking_id").filtered("printed") + if printed_pickings: + printed_pickings.write({"printed": False}) + +======= + + # Resetear printed=False en pickings asociados para evitar contra-entregas + # cuando Odoo intente mezclar moves en pickings ya impresos + pickings_to_reset = rec.order_id.picking_ids.filtered( + lambda p: p.state not in ("done", "cancel") and p.printed + ) + if pickings_to_reset: + pickings_to_reset.write({"printed": False}) + +>>>>>>> 1aff492ff6ce87efed352b0e01f8024216acaff9 # Al final permitimos cancelar igual porque es necesario, por ej, # si no se va a entregar y ya está facturado y se quiere hacer # la nota de crédito. además se puede volver a subir la cantidad