Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanDiego3030/Planta_Milenio/llms.txt
Use this file to discover all available pages before exploring further.
Historial is the local record of every purchase order entry registered through the Control de Entradas module. Each time an operator processes an incoming vehicle, a Historial row is created in the local SQLite database (planta.sqlite3) before the corresponding transport record is written to the remote Ceres Romana system. This two-step approach means Historial acts as a gating mechanism — an order must be registered here first, and the deduplication logic prevents the same order from being submitted to Ceres Romana twice.
Model Definition
Fields
The vehicle license plate captured at the time of entry. Maximum 20 characters. Combined with
numero_orden and descripcion to detect duplicate submissions before writing to Ceres Romana.The purchase order number as it appears in Profit ERP. Maximum 20 characters. This is the primary identifier used when querying Ceres Romana for order line details.
Timestamp set automatically to the current date and time when the record is created (
auto_now_add=True). The application server runs in the America/Caracas timezone (UTC-4), so all stored values reflect local Venezuelan time. This field is not editable after creation.The product name or description associated with the order line, as returned by the Ceres Romana query. Optional — the column is nullable and blank-allowed. Also participates in the duplicate-detection check alongside
numero_orden and placa_vehiculo.The remaining quantity on the order line at the time of entry, as reported by Ceres Romana. Optional and nullable. Stored for reference in the audit log and reports module.
Querying Examples
Use.filter() with the composite key fields to check for existing entries before proceeding with a Ceres Romana write, and filter by fecha_hora__date for daily report queries.
Deduplication Logic
Before creating a newHistorial record the entry view checks whether a row already exists that matches the combination of numero_orden, placa_vehiculo, and descripcion. If a match is found, the view returns an error to the operator and does not write to Ceres Romana. This prevents the same physical delivery from generating multiple transport records in the remote ERP system. When building custom management commands or batch imports, apply the same three-field check to preserve this invariant.