- Convertir 4 tests de decorador @patch a context manager 'with patch(...)' para evitar RuntimeError en LocalProxy de Werkzeug - Corregir patrón env(user=..., context=dict(...)) en Odoo 18 (sin .with_context()) - Agregar website real al mock para integración con helpers de pricing (_get_pricing_info) - Añadir pickup_date en fixture de existing_order para que _find_recent_draft_order localice correctamente - BUGFIX: Agregar (5,) a order_line para limpiar líneas previas al actualizar pedido existente Resultado: 0 failed, 0 errors de 4 tests en Docker para TestConfirmEskaera_Integration BREAKING: _create_or_update_sale_order ahora limpia las líneas anteriores con (5,) antes de asignar las nuevas cuando se actualiza un pedido existente. Comportamiento previo (duplicación de líneas) era un bug.
23 lines
718 B
Python
23 lines
718 B
Python
# Copyright 2026 Criptomart
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import models
|
|
|
|
|
|
class StockBackorderConfirmation(models.TransientModel):
|
|
_inherit = "stock.backorder.confirmation"
|
|
|
|
def _check_batch_summary_lines(self):
|
|
pickings = self.env["stock.picking"].browse(
|
|
self.env.context.get("button_validate_picking_ids", [])
|
|
)
|
|
for batch in pickings.batch_id:
|
|
batch._check_all_products_collected()
|
|
|
|
def process(self):
|
|
self._check_batch_summary_lines()
|
|
return super().process()
|
|
|
|
def process_cancel_backorder(self):
|
|
self._check_batch_summary_lines()
|
|
return super().process_cancel_backorder()
|