[FIX] TestConfirmEskaera_Integration: limpieza de decoradores @patch y corrección de bugs
- 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.
This commit is contained in:
parent
e9809b90e9
commit
ce393b6034
13 changed files with 857 additions and 192 deletions
|
|
@ -0,0 +1,23 @@
|
|||
# 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue