| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Sales (sale_management) • Purchase (purchase) • Discuss (mail) |
| Community Apps Dependencies | Show |
| Lines of code | 11066 |
| Technical Name |
eh_log_l10n_sa_saber |
| License | LGPL-3 |
| Website | https://www.erpheritage.com.au/ |
| Versions | 16.0 17.0 18.0 19.0 |
KSA SABER Conformity Adapter
Model, submit, and track Saudi SABER product and shipment conformity certificates inside your Odoo logistics flow.
Why this module
KSA SABER Conformity Adapter
Two real conformity models, not field stubs
PCoC carries product identity, HS code, manufacturer, SASO regulation, scope, applicant, and validity. SCoC carries the customs declaration link, parties, and lines that each reference an issued PCoC with the actual shipment quantity and value. Both are guarded by an explicit state machine.
A concrete SABER adapter, not a placeholder
The adapter serialises both certificate types into the documented SABER JSON envelope, dispatches over HTTPS with bearer auth pulled from the credentials store, parses the regulator response, and surfaces the issued PCoC or SCoC number back onto the record. Implemented to documented contract patterns; live sandbox verification is deferred until customer credentials are configured.
Submissions that refuse to leave with a hole
SCoC submission runs a pre-flight check first. It blocks when the certificate has no lines, when any line points at a PCoC that is not in issued state, when a referenced PCoC is expired, or when no regulator profile is set. State changes are forced through action buttons; direct state writes are rejected.
Day in the life
From product certificate to cleared shipment.
An importer holds a Product Certificate of Conformity for a regulated speaker model. A new container lands, so the operator opens a Shipment Certificate of Conformity, links the customs declaration, adds a line that references the issued PCoC with the real quantity and invoice value, and clicks Submit to SABER. The pre-flight check confirms the PCoC is issued and unexpired, the adapter posts the documented envelope, and the returned SCoC number lands on the record and is appended to the customs declaration notes for the downstream FASAH payload. Every transition posts to the chatter and logs an append-only event.
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.
An SCoC line that references a PCoC whose valid_to has passed is caught by the pre-flight check, which names the line, the PCoC, and the expiry date, and blocks submission rather than sending an invalid reference.
If a line points at a PCoC still in draft or submitted state, submission is refused with the offending line sequence and the PCoC's current state, so a shipment can never cite a certificate the regulator has not granted.
When SABER returns a rejection for a PCoC or SCoC, the adapter parses the error code and message, the certificate moves to its rejected path where defined, and the failure is posted to the chatter for the operator.
Both models reject direct writes to the state field. Every transition must go through an action button, runs through an allowed-transitions table, and logs an append-only event with the from and to state.
A database constraint enforces that the regulator-issued PCoC and SCoC numbers are unique per company, so the same issued reference cannot be recorded twice.
The seeded SABER profile installs in mock mode against fixtures, so a fresh install exercises the full submit and parse round trip in tests and demos without live credentials or network calls.
What is inside
Built to do the job, end to end.
- Product Certificate of Conformity (PCoC). Model eh.log.l10n.sa.saber.product.cert holds product name and model, HS code linked to the customs HS code register, manufacturer and country, SASO regulation, scope, applicant, requested and issued validity, and the regulator reference. Sequence-numbered, chatter-tracked, multi-company scoped.
- Shipment Certificate of Conformity (SCoC). Model eh.log.l10n.sa.saber.shipment.cert links the customs declaration, commercial invoice reference, applicant and consignee, and one or more lines. Each line references an issued PCoC and carries the actual quantity, unit of measure, invoice value, and currency, with the PCoC status and expiry mirrored onto the line.
- SABER adapter. A concrete subclass of the suite base adapter, registered under provider code saber. It serialises pcoc_submit and scoc_submit into the documented JSON envelope, parses the regulator response for the issued number, validity, status, and structured errors, sets headers and endpoints, and pulls the API key from the credentials store.
- State machines and audit. Explicit allowed-transition tables for both certificate types, a write guard that blocks direct state edits, and an append-only event logged on every transition. Submit, mark issued, mark expired, revoke, cancel, and reset-to-draft are exposed as guarded action buttons.
- Pre-flight submission check. Before an SCoC is sent, the module verifies it has lines, every line references an issued and unexpired PCoC, and a regulator profile is set. Blockers are collected and raised together as a single, readable customs error.
- Default profile and tests. A mock-mode SABER adapter profile is seeded at install with timeout, retry, and circuit-breaker settings. Fixture-backed tests cover adapter registration, serialise, parse for golden and rejection responses, the mock round trip, PCoC lifecycle, and the SCoC pre-flight blockers.
Honest about the edges
What this does not do, so nothing surprises you.
- Adapter fidelity is implemented to documented SABER contract patterns and exercised in mock mode against fixtures. Live SABER sandbox verification is deferred until customer-supplied credentials are configured.
- There is no scheduled job in this module. The certificate_status message type exists in the adapter but is not driven by any cron or button; status reconciliation is operator-initiated.
- No certificate PDF, portal tracking page, or public link is shipped. The module provides backend list and form views only.
- No fee ledger, costing, or invoicing is included. SCoC lines carry an invoice value and currency for the SABER payload, not an accounting posting.
- There is no automatic hook from a freight job or sale order. Certificates are created and submitted from their own menus and reference a customs declaration explicitly.
- This is an add-on, not a standalone app. It depends on the logistics base, customs, and KSA localisation modules and auto-installs only when customs and the KSA localisation are both present.
Odoo 19 SABER, SASO conformity Odoo, Product Certificate of Conformity, Shipment Certificate of Conformity, PCoC SCoC Odoo, Saudi product conformity, KSA customs clearance Odoo, FASAH SABER reference, Saudi import regulated goods, HS code conformity, GCC freight forwarding Odoo, customs declaration add-on, Odoo 19 Community logistics, SABER adapter, SASO regulation Odoo
Languages
Available in 19 languages
The interface ships translated out of the box. Switch language in Odoo and the fields, menus, and messages follow.
Please log in to comment on this module