-
Notifications
You must be signed in to change notification settings - Fork 2
Transactional Testing Report
Date: February 23, 2026
Last Run: February 23, 2026
Scope: All modules – unit tests, transactional flows, conversions, validations
Transactional testing was performed across all logistics modules. Unit tests pass for all modules. Transactional flow tests (conversion flows) revealed several validation gaps, missing default propagation, and areas requiring additional controls.
| Category | Status |
|---|---|
| Unit tests (Air Freight) | ✅ Pass |
| Unit tests (Sea Freight) | ✅ Pass |
| Unit tests (Transport) | ✅ Pass |
| Unit tests (Warehousing) | ✅ Pass |
| Unit tests (Pricing Center) | ✅ Pass |
| Unit tests (Special Projects) | ✅ Pass |
| Unit tests (Job Management) | ✅ Pass |
| Transactional flows |
- DocTypes: Air Shipment, Air Booking, Air Consolidation, Air Shipment Charges, Air Shipment Packages, Air Shipment Routing Leg, Master Air Waybill, Dangerous Goods Declaration
-
Unit tests:
test_air_booking.py,test_air_shipment.py,test_air_consolidation.py,test_master_air_waybill.py,test_air_freight_rate.py,test_helpers.py,test_airline.py,test_air_freight_settings.py,test_dangerous_goods_declaration.py -
Flows tested: Air Booking → Air Shipment (
convert_to_shipment), Sales Quote → Air Shipment
- DocTypes: Sea Shipment, Sea Booking, Sea Consolidation, Sea Shipment Charges, Sea Shipment Packages, Sea Shipment Routing Leg
-
Unit tests:
test_sea_booking.py,test_sea_shipment.py -
Flows tested: Sea Booking → Sea Shipment (
convert_to_shipment)
- DocTypes: Transport Job, Transport Order, Transport Leg, Transport Consolidation, Run Sheet, Transport Vehicle, Transport Company, Transport Terminal
-
Unit tests:
test_transport_job.py,test_transport_order.py,test_transport_leg.py,test_transport_consolidation.py,test_run_sheet.py,test_transport_vehicle.py,test_transport_terminal.py, etc. -
Flows tested: Transport Order → Transport Job (
action_create_transport_job), Air/Sea Shipment → Transport Order
- DocTypes: Warehouse Job, Inbound Order, Release Order, Transfer Order, VAS Order, Stocktake Order, Warehouse Contract
-
Unit tests:
test_inbound_order.py,test_warehouse_contract.py,test_gate_pass.py -
Flows tested: Inbound Order → Warehouse Job (
make_warehouse_job), Air/Sea Shipment → Inbound Order, Transport Job → Inbound Order
- DocTypes: Declaration, Declaration Order, Declaration Commodity
- Flows: Declaration Order → Declaration, Sales Quote → Declaration
- Unit tests: None found in logistics app
- DocTypes: Sales Quote, One Off Quote, Sales Quote Air Freight, Sales Quote Sea Freight, Sales Quote Transport, Sales Quote Warehouse
-
Unit tests:
test_sales_quote.py,test_one_off_quote.py,test_tariff.py,test_sales_quote_weight_break.py,test_sales_quote_qty_break.py - Flows tested: Sales Quote → Air/Sea Shipment, Transport Order, Air/Sea Booking, Warehouse Contract, Declaration
- DocTypes: Special Project, Special Project Request, Special Project Resource, Special Project Activity, Special Project Job, Special Project Delivery, Special Project Billing
-
Unit tests:
test_special_project.py
- DocTypes: Job Costing Number, Recognition Engine
-
Unit tests:
test_recognition_engine.py,test_job_costing_number.py
Transactional flow tests were executed via logistics.tests.transactional_flows_test.run(). Results (latest run):
| Flow | Status | Error / Notes |
|---|---|---|
| Air Booking → Air Shipment | ❌ Error | Air Booking requires branch, cost_center, profit_center. Transactional test does not set these. |
| Sales Quote → Air Shipment | ❌ Error | Sales Quote requires branch, profit_center, cost_center, and Air Freight child requires item_code. |
| Air Shipment → Transport Order | ❌ Error | Blocked by Air Booking creation (branch, cost_center, profit_center). |
| Transport Order → Transport Job | ❌ Error | Transport Order requires branch, cost_center, profit_center. No defaults from company when missing. |
| Air Shipment → Inbound Order | ❌ Error | Blocked by Air Booking creation (branch, cost_center, profit_center). |
| Inbound Order → Warehouse Job | ❌ Error | Item TEST-INBOUND-ITEM must exist in Item master. Validation correctly rejects non-existent items. |
Note: All airport/seaport fields now use UNLOCO (USLAX, USJFK). Unit tests pass; transactional flow script needs enhanced setup (branch, cost_center, profit_center, Item).
Location: logistics.utils.module_integration.create_transport_order_from_air_shipment, create_transport_order_from_sea_shipment
Issue: When the source Air/Sea Shipment has no branch, cost_center, or profit_center, the created Transport Order leaves these fields empty. Transport Order validation requires them, causing insert to fail.
Recommendation: Propagate company defaults when source fields are empty:
defaults = frappe.defaults.get_defaults()
order.branch = getattr(shipment, "branch", None) or defaults.get("branch")
order.cost_center = getattr(shipment, "cost_center", None) or defaults.get("cost_center")
order.profit_center = getattr(shipment, "profit_center", None) or defaults.get("profit_center")Location: logistics.transport.doctype.transport_order.transport_order.action_create_transport_job
Issue: Transport Order must be submitted before creating Transport Job. Return format may vary (single job vs list). Callers should handle both transport_job and transport_jobs keys.
Recommendation: Document expected return structure and ensure consistent format.
Location: logistics.warehousing.doctype.inbound_order.inbound_order.make_warehouse_job
Issue: Uses get_mapped_doc; requires valid Item master records for all items. Contract validation (cancelled contract) is correctly enforced.
Recommendation: Add pre-check for Item existence before mapping, with clear error message.
-
Field:
origin_port,destination_port,origin_airport,destination_airport(Link to UNLOCO) - Behavior: All airport and seaport link fields use UNLOCO. IATA codes (LAX, JFK) are rejected; UNLOCO codes (USLAX, USJFK) are required.
- Updated: Dangerous Goods Declaration, Air Consolidation Shipments, Sea Consolidation Shipments now use Link to UNLOCO (previously Data).
- Behavior: Required fields; no automatic defaults when creating from Shipment.
-
Recommendation: Add company-level defaults in
create_transport_order_from_*when source has none.
- Behavior: Item in child table must exist in Item master.
-
Recommendation: Add
validatecheck with user-friendly message: "Item {item} does not exist. Please create it in Item master first."
- Behavior: ETD must not be after ETA. Correctly enforced.
- Status: ✅ Working as designed.
-
Behavior: Status set to "Converted" and
converted_to_docpopulated. Prevents multiple conversions. - Status: ✅ Working as designed.
-
Behavior: One Air/Sea Booking can have only one Shipment. Correctly enforced in
convert_to_shipment. - Status: ✅ Working as designed.
| DocType | Recommendation |
|---|---|
| Sales Quote → Air Shipment | Add validate_before_conversion-style check for required UNLOCO, shipper, consignee before conversion. |
| Transport Order → Transport Job | Ensure Transport Order is submitted before job creation; add explicit status check. |
| Inbound Order → Warehouse Job | Add check for cancelled contract before mapping. (Already present ✅) |
| Source → Target | Missing Propagation |
|---|---|
| Air Shipment → Transport Order |
branch, cost_center, profit_center when empty |
| Sea Shipment → Transport Order | Same as above |
| Transport Job → Inbound Order |
planned_date/due_date from scheduled_date (present in propagate_from_transport_job) |
| Area | Recommendation |
|---|---|
| Customs | Add unit tests for Declaration, Declaration Order, and create_declaration_from_* flows. |
| Sales Quote conversions | Add integration tests for Sales Quote → Air/Sea Shipment, Transport Order, Declaration. |
| Document management | Add tests for populate_documents_from_template, get_document_alerts. |
| Job closure / Recognition Engine | Expand tests for job status transitions (Closed, Completed, Cancelled). |
Meaningful tests have been added to:
-
TestTransportOrder– creation, required fields, leg facility validation -
TestSalesQuote– creation, required fields, validation methods -
TestSeaShipment– creation, required fields, packages -
TestDangerousGoodsDeclaration– creation with UNLOCO ports, required fields
Remaining: TestAirBooking (doctype-level) and some IntegrationTestCase classes remain minimal.
Quote → Shipment/Order:
Sales Quote ─┬→ Air Shipment (create_air_shipment_from_sales_quote)
├→ Sea Shipment (create_sea_shipment_from_sales_quote)
├→ Transport Order (create_transport_order_from_sales_quote)
├→ Air Booking (create_air_booking_from_sales_quote)
├→ Sea Booking (create_sea_booking_from_sales_quote)
├→ Warehouse Contract (create_warehouse_contract_from_sales_quote)
└→ Declaration (create_declaration_from_sales_quote)
Booking → Shipment:
Air Booking → Air Shipment (convert_to_shipment)
Sea Booking → Sea Shipment (convert_to_shipment)
Shipment → Order:
Air Shipment ─┬→ Transport Order (create_transport_order_from_air_shipment)
└→ Inbound Order (create_inbound_order_from_air_shipment)
Sea Shipment ─┬→ Transport Order (create_transport_order_from_sea_shipment)
└→ Inbound Order (create_inbound_order_from_sea_shipment)
Transport Job → Inbound Order (create_inbound_order_from_transport_job)
Order → Job:
Transport Order → Transport Job (action_create_transport_job)
Inbound Order → Warehouse Job (make_warehouse_job)
Release Order → Warehouse Job (make_warehouse_job)
Transfer Order → Warehouse Job (make_warehouse_job)
VAS Order → Warehouse Job (make_warehouse_job)
Stocktake Order → Warehouse Job (make_warehouse_job)
Declaration Order → Declaration (create_declaration_from_declaration_order)
Use --skip-before-tests to avoid ERPNext Fiscal Year preload issues when running logistics-only:
bench --site all run-tests --app logistics --module logistics.air_freight --skip-before-tests
bench --site all run-tests --app logistics --module logistics.sea_freight --skip-before-tests
bench --site all run-tests --app logistics --module logistics.transport --skip-before-tests
bench --site all run-tests --app logistics --module logistics.warehousing --skip-before-tests
bench --site all run-tests --app logistics --module logistics.pricing_center --skip-before-tests
bench --site all run-tests --app logistics --module logistics.special_projects --skip-before-tests
bench --site all run-tests --app logistics --module logistics.job_management --skip-before-testsbench --site all execute logistics.tests.transactional_flows_test.runNote: Transactional flow tests require full master data (Company, Customer, Shipper, Consignee, UNLOCO USLAX/USJFK, branch, cost_center, profit_center, Item). The script uses minimal setup; flows fail on missing branch/cost_center/profit_center and Item.
Transactional flow test script: logistics/tests/transactional_flows_test.py
Flows covered:
- Air Booking → Air Shipment
- Sales Quote → Air Shipment
- Air Shipment → Transport Order
- Transport Order → Transport Job
- Air Shipment → Inbound Order
- Inbound Order → Warehouse Job
Getting Started
- Getting Started
- Recent Platform Updates
- CargoNext v1 — Release Notes
- CargoNext v1 — Astraea Press Release
- Document Management
- Milestone Tracking
- Customer Portal
Setup and Settings
- Logistics Settings
- Credit Management
- Default Details and Relationships
- Sea Freight Settings
- Air Freight Settings
- Transport Settings
- Warehouse Settings
- Customs Settings
Sea Freight
- Sea Freight Module
- Sea Booking
- Sea Shipment
- Sea Consolidation
- Master Bill
- Shipper
- Consignee
- Container Type
- Container Management
Air Freight
Transport
- Transport Module
- Transport Order
- Transport Job
- Transport Consolidation
- Transport Leg
- Transport Plan
- Run Sheet
- Proof of Delivery
- Transport Template
- Load Type
- Transport Order — Inter-module Field Copy
Customs
Warehousing
- Warehousing Module
- Inbound Order
- Release Order
- Transfer Order
- VAS Order
- Stocktake Order
- Warehouse Job
- Warehouse Contract
- Gate Pass
- Periodic Billing
- Storage Location
- Handling Unit Type
Pricing Center
- Sales Quote
- Sales Quote — Separate Billings and Internal Job
- Change Request
- Sales Quote – Calculation Method
Job Management
- Job Management Module
- Revenue Recognition Policy — Accounts, Dates, and Charges
- Proforma GL Entries
- WIP and Accrual Reversal on Invoicing
Sustainability
Intercompany
Special Projects
Pages
Features
Reports
Glossary