| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Purchase (purchase) • Sales (sale_management) • Discuss (mail) |
| Community Apps Dependencies | Show |
| Lines of code | 9060 |
| Technical Name |
eh_log_dangerous_goods |
| License | LGPL-3 |
| Website | https://www.erpheritage.com.au/ |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Purchase (purchase) • Sales (sale_management) • Discuss (mail) |
| Community Apps Dependencies | Show |
| Lines of code | 9060 |
| Technical Name |
eh_log_dangerous_goods |
| License | LGPL-3 |
| Website | https://www.erpheritage.com.au/ |
Dangerous Goods Declarations
File mode-correct dangerous-goods declarations with a UN number master, a hazard class catalogue, and a segregation incompatibility detector that flags risky class pairs before you issue.
Why this module
Dangerous Goods Declarations
Segregation detector reads the class catalogue
Each hazard class carries a configurable list of classes it cannot share a transport unit with. The declaration scans its UN lines, maps each to a primary class, and reports every incompatible pair once, with a plain-language note. The status (compatible, incompatibilities detected, not assessed) is stored so it shows on the list, the form, and the printed declaration.
The freight job spawns the declaration
Flag a sale order as dangerous goods and the freight job created from it auto-builds a declaration in the matching mode (courier maps to air, anything unmapped to multimodal). State changes run through action buttons only; direct writes to the state field are rejected, and every transition logs an event to the shared logistics audit trail.
Mode drives the form and the air guard
Sea surfaces vessel and voyage, air surfaces flight, and the printed Shipper's Declaration renders the lane and signatory block to suit. On air declarations a constraint blocks any UN number marked forbidden on both passenger and cargo aircraft, so it cannot reach an issued air form.
Day in the life
From flagged order to issued declaration
A sale order comes in marked dangerous goods. The freight job created from it already carries a draft declaration in the right mode. The operator adds UN lines from the seeded master, and a generic n.o.s. entry prompts for the technical name that must print in parentheses. Adding a flammable liquid alongside a corrosive trips the segregation detector, which names the class 3 versus class 8 conflict. The operator splits the shipment, the warning clears, the marine-pollutant badge stays lit because of the gasoline line, and the pre-flight check confirms every line has packaging and a net quantity before the declaration moves to ready, then issued with the signing user and timestamp stamped on the PDF.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
Selecting a UN whose proper shipping name contains n.o.s. raises an onchange warning that a technical name is required; the technical name then prints in parentheses next to the shipping name on the declaration.
A constrains check on air-mode declarations rejects any UN number flagged forbidden on both passenger and cargo aircraft per IATA DGR, so it can never reach an issued air form.
When two classes each list the other as incompatible, the segregation summary de-duplicates and reports the pair exactly once rather than twice from both directions.
A stored compute sets a marine-pollutant flag on the declaration if any single UN line is a marine pollutant, driving the warning badge on the printed form.
Moving to ready is blocked with a consolidated blocker list if there are no UN lines, any line has zero net quantity or no packaging description, or the 24-hour emergency phone is missing.
States are draft, ready, issued, and cancelled with a fixed allowed-transitions map; issued and cancelled are terminal, and direct writes to the state field are rejected with a clear error code.
UN numbers are stripped and upper-cased on create and write, validated against the UN plus four-digit format, and held unique by a database constraint.
What is inside
Built to do the job, end to end.
- UN number master. The eh.log.dg.un.number model carries UN number (format validated, unique), proper shipping name, primary hazard class, subsidiary risks, packing group, marine-pollutant flag, flashpoint, EmS code, per-regime special provisions, and passenger/cargo aircraft forbidden flags. Ships seeded with sixteen high-frequency entries; production loads the full list via a customer-supplied data file.
- Hazard class catalogue. The eh.log.dg.class model holds the nine UN classes plus subdivisions as records (not a hard-coded selection) so customers can extend without forking. Each class carries placard text, stowage notes, and a many-to-many of incompatible classes that drives the segregation detector. Seeded with high-impact IMDG segregation pairs.
- Declaration and lines. The eh.log.dg.declaration model holds parties, emergency contact, lane fields, and UN lines. Each line references a UN number, pulls class, packing group and marine-pollutant as related fields, and computes total quantity from net quantity times package count. Linkage to the sale order and freight job is read-only and copy-protected.
- Shipper's Declaration PDF. A QWeb report renders against the shared logistics report shell with a parties table, lane block, UN line table (UN, shipping name, class, packing group, packaging, package count, net per package, total, EmS code), a segregation notice when conflicts exist, the marine-pollutant badge, and a signed declaration block stamped with the issuing user and timestamp.
- Tests and audit. Ships with unit tests across declaration lifecycle, segregation pair detection, and UN number validation. Mailthread tracking on key fields, append-only event logging on every state transition, and multi-company record-rule isolation throughout.
Honest about the edges
What this does not do, so nothing surprises you.
- This is a documentation and segregation-check tool, not a certified dangerous-goods classification authority. It records and prints what you enter; it does not certify regulatory compliance, and the issuing shipper remains responsible for the declaration.
- The segregation detector works at the primary-class level using the configurable incompatibility links you maintain. It does not implement the full IMDG segregation table with all stowage codes, distances, or substance-specific exceptions.
- The seed ships sixteen common UN numbers and a curated subset of high-impact incompatibility pairs. The full UN dangerous-goods list (around 3000 entries) and exhaustive segregation data are loaded separately from a customer-supplied data file.
- Mode is surfaced for sea, air, road, rail, and multimodal, but mode-specific form variants beyond the shared template (for example the IATA red-hatched border or per-mode signature panels) are not rendered; one signed declaration block is used.
- No customs, EDI, or single-window adapter is included in this module. It produces the shipper-side declaration document, not electronic filings.
- Limited-quantity, excepted-quantity, and per-mode required-attachment enforcement are not implemented; packaging is captured as free text per line.
- Requires eh_log_base, eh_log_quotation, and eh_log_freight; it is a companion to the freight suite, not a standalone application.
Odoo dangerous goods, Odoo 19 dangerous goods declaration, IMDG declaration Odoo, IATA DGR Odoo, ADR road dangerous goods, UN number master Odoo, hazard class segregation, shipper's declaration PDF, marine pollutant flag, packing group, lithium battery air freight, hazmat freight forwarding, dangerous goods segregation detector, Odoo Community logistics, freight forwarding dangerous goods
Please log in to comment on this module