refactor: update validation logic and enhance seed data script
This commit is contained in:
@@ -112,8 +112,8 @@ def validate_common(
|
||||
return # Stop here if pedimento not found
|
||||
|
||||
if not invoice.compliance_mx.is_regime_change:
|
||||
# Validar que el pedimento sea de importación (hardcoded restriction)
|
||||
if pedimento.operation_type != "imp":
|
||||
# Validar que el pedimento sea de importación
|
||||
if pedimento.operation_type != invoice.operation_type:
|
||||
errors.add_error(
|
||||
field="compliance_mx.pedimento_id",
|
||||
message="El Pedimento seleccionado no corresponde a una Importación.",
|
||||
@@ -489,9 +489,7 @@ def validate_common(
|
||||
incoterm_exists = (
|
||||
db.query(Incoterm)
|
||||
.filter(
|
||||
Incoterm.code == invoice.logistics.incoterm,
|
||||
Incoterm.tenant_id == tenant_id,
|
||||
Incoterm.company_id == company_id,
|
||||
Incoterm.code == invoice.logistics.incoterm
|
||||
)
|
||||
.first()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user