From 4b4bb9e8a73ca378ca462598a4141fcc0b8833b6 Mon Sep 17 00:00:00 2001 From: hreyes Date: Wed, 18 Mar 2026 15:33:40 -0600 Subject: [PATCH] feature/csv-pruebas --- backend/api/v1/modules/a76/layouts_csv/exportacion/tasks.py | 6 +++--- backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/api/v1/modules/a76/layouts_csv/exportacion/tasks.py b/backend/api/v1/modules/a76/layouts_csv/exportacion/tasks.py index a2b61da2..2895bf40 100644 --- a/backend/api/v1/modules/a76/layouts_csv/exportacion/tasks.py +++ b/backend/api/v1/modules/a76/layouts_csv/exportacion/tasks.py @@ -44,15 +44,15 @@ def scan_file(self, job_id: str, model_target: str, config: str = None): if model_target == "invoice_header": from api.v1.modules.a76.layouts_csv.facturas.tasks import _do_scan_file - return _do_scan_file(job_id, "invoice_header", config, job_type_override="exp") + return _do_scan_file(self, job_id, "invoice_header", config, job_type_override="exp") if model_target == "invoice_details": from api.v1.modules.a76.layouts_csv.facturas.tasks import _do_scan_file - return _do_scan_file(job_id, "invoice_details", config, job_type_override="exp") + return _do_scan_file(self, job_id, "invoice_details", config, job_type_override="exp") if model_target == "invoice_series": from api.v1.modules.a76.layouts_csv.facturas.tasks import _do_scan_file - return _do_scan_file(job_id, "invoice_series", config, job_type_override="exp") + return _do_scan_file(self, job_id, "invoice_series", config, job_type_override="exp") # Fallback (e.g. unknown model_target) file_path = _ensure_file(job_id) diff --git a/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py b/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py index 54095fdf..6f43ab11 100644 --- a/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py +++ b/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py @@ -185,10 +185,10 @@ def _validate_customs_broker_ref( @celery_app.task(bind=True) def scan_file(self, job_id: str, model_target: str, config: str = None, job_type_override: Optional[str] = None): """Pass 1: Read CSV, Validate types, Write Errors to JSONL. Delegates to _do_scan_file.""" - return _do_scan_file(job_id, model_target, config, job_type_override) + return _do_scan_file(self, job_id, model_target, config, job_type_override) -def _do_scan_file(job_id: str, model_target: str, config: Optional[str] = None, job_type_override: Optional[str] = None) -> Dict[str, Any]: +def _do_scan_file(self, job_id: str, model_target: str, config: Optional[str] = None, job_type_override: Optional[str] = None) -> Dict[str, Any]: """Pass 1 body: load file/meta from storage, run validations, store error lines. Uses effective_job_type for storage.""" effective_job_type = job_type_override if job_type_override is not None else JOB_TYPE log_prefix = "Exportación import" if effective_job_type else "Invoices import"