fix(missing-skus): reconcile stale false positives against Oracle
SKUs mapped externally (via SSH script or direct SQL) never triggered resolve_missing_sku(), leaving them stuck as unresolved=0 indefinitely. New reconcile_unresolved_missing_skus() revalidates ALL unresolved SKUs against Oracle at sync, rescan, and CSV import time. Fail-soft on Oracle down. Clears the 7 prod false positives on next sync or manual rescan. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -468,6 +468,11 @@ async def run_sync(id_pol: int = None, id_sectie: int = None, run_id: str = None
|
||||
if resolved_count:
|
||||
_log_line(run_id, f"Auto-resolved {resolved_count} previously missing SKUs")
|
||||
|
||||
# Reconcile stale unresolved SKUs that got mappings outside the current JSON batch
|
||||
rec = await validation_service.reconcile_unresolved_missing_skus(conn=conn)
|
||||
if rec["resolved"]:
|
||||
_log_line(run_id, f"Reconciliere: {rec['resolved']} SKU rezolvate suplimentar")
|
||||
|
||||
# Step 2d: Pre-validate prices for importable articles
|
||||
if id_pol and (truly_importable or already_in_roa):
|
||||
_update_progress("validation", "Validating prices...", 0, len(truly_importable))
|
||||
|
||||
Reference in New Issue
Block a user