openepcis_connector: products and contacts as GS1 master data

The base addon. Products and company contacts are queued on save and published to the catalog behind the GS1 Digital Link resolver; a GTIN can be drawn from your own prefix; the field mapping is data an administrator edits; the form says what a registry still wants before you publish.

openepcis_connector is the addon the other six build on. It publishes Odoo's master data, meaning products and company contacts, to the OpenEPCIS catalog behind a GS1-conformant Digital Link resolver, and it brings the resulting Digital Link and QR code back onto the form. Because it depends on product alone, it also installs on an Odoo that has no warehouse at all.

Moduleopenepcis_connector
Depends onproduct
InstallsBy hand; this is the one you choose
Talks toThe resolver's HTTP API
Sourceopenepcis-odoo · LGPL-3

What publishing means here

Publishing is opt-in for each record. Nothing leaves the database until somebody ticks Publish to OpenEPCIS on a product or a contact, or runs the mass action on a selection. Saving such a record queues it and never waits for the network: a scheduled action publishes the queue every five minutes, and Publish now does it immediately and reports the outcome.

The connector writes to the catalog only. Forwarding to national GS1 registries happens on the platform, so the addon itself never talks to GS1.

Getting a product out

The barcode is the GTIN. Each variant is a trade item of its own and needs its own GTIN. For a product that has none yet, Draw GTIN takes the next free number from your company prefix.

Figure 1: Draw GTIN takes the next free number from the company prefix. The number is held until the record is saved, and only then registered

A drawn number is held until the product is saved. Registration with GS1 cannot be undone, so a number drawn for a form that somebody then abandons would otherwise be lost for good. The resolver keeps it as a candidate in the meantime, and until the save it can still be handed back.

The GPC brick lives on the category, so it is set once per category and every product in it inherits it. The picker searches GS1's classification by name, and nobody has to know the eight digits by heart.

The form says what a registry still wants. The readiness line names the terms a downstream registry insists on and updates the list as you type. The list comes from the destination itself: the resolver reports which terms each publishing channel requires, so the addon carries no hard-coded assumptions about them.

Figure 2: What GS1 Germany still wants, read from the channel's own requirements

The readiness line informs and never blocks. A passport is usually filled in over time and by several people, so an incomplete record can be published now and completed later.

Tick Publish to OpenEPCIS and save. Within five minutes the state changes to Published and the Digital Link appears, together with its QR code on the form and on a printable label.

Contacts as organizations

A passport names a manufacturer, and a manufacturer is a party with a GLN. Company contacts are therefore published the same way products are, anchored on application identifier 417, which identifies a party. Both 417 and 414, the physical location, carry a GLN, and the resolver routes the two separately.

Figure 3: A company contact published as a GS1 organization under AI 417

Only companies are published. An individual contact is a person, and publishing one would put a private name and address into a registry.

Organizations also travel in the other direction. When another system changes an organization in the catalog (a second CRM, the resolver's own editor, an import from GS1), a scheduled action brings the change into the Odoo contact with that GLN, or creates the contact if none exists.

The field mapping is data

Settings → Technical → OpenEPCIS → Field mapping. No two Odoo databases keep a brand in the same place, so each row of this table says which Odoo field feeds which term of the published document, and an administrator can edit it. Dotted paths work on both sides: categ_id.openepcis_gpc_code reads across a relation, brand.brandName writes into a nested object, and a [] segment builds a list.

Figure 4: Starting points, editable per row, and marked so that an upgrade keeps your edits

Two of the shipped rows are worth knowing about. Country of origin points at a field this addon adds, because Odoo's own field comes from the Intrastat module, which is part of Enterprise. Weight is sent as KGM; in a database configured in pounds, change the fixed unit on that row to LBR.

Loading an existing catalogue

Settings → Technical → OpenEPCIS → First load. Sending ten thousand products one HTTP call at a time would take an afternoon, so this wizard uploads them as a single CSV, in chunks.

Figure 5: Scope, chunking, and the warnings that go with a create-only endpoint

The wizard is meant for the first load only. The endpoint behind it creates records and never updates them, so anything the catalog already holds comes back as a duplicate and is left untouched, and the bulk format carries only the English name. Everything published later through the ordinary queue carries every language and every mapped field.

Authentication: an offline token

Odoo stores an OIDC offline token, a refresh token issued with the offline_access scope, and uses it to obtain a short-lived access token for every call. No password is kept, nothing long-lived goes over the wire, and you withdraw access in Keycloak by removing the offline session, without touching Odoo.

The addon only consumes the token. You issue it in the OpenEPCIS web interface under your profile and paste it into the Offline token field. The only URL you configure is the resolver's: the connector reads the resolver's OAuth 2.0 Protected Resource Metadata (RFC 9728) to find the Keycloak realm that issues its tokens, and discovers that realm's endpoints from there.

Test connection first probes the token and then checks each thing the resolver will later insist on: the tenant role, the defaultGroup claim and the gs1CompanyPrefix claim. It names whichever is missing, so nobody has to read resolver logs to find out. It also distinguishes a deployment that is older than a feature from a token that lacks a claim, two cases that look identical from the outside.

The client settings, the required claims and the measurements taken against Keycloak are documented in doc/keycloak.md in the repository.

Limits

One direction for products. Changes made in the OpenEPCIS web interface stay there for products; organizations come back to Odoo as described above.

PUT merges into the published document. Clearing a field in Odoo leaves the published value in place, because to the catalog an absent key means "leave this alone".

Some features need a recent resolver. Drawing identifiers, the GPC picker and the readiness list rely on endpoints that older deployments lack. Test connection reports this as "not available on this deployment", which tells you the cause lies with the deployment and your setup is fine.

There is no GS1 sandbox. A registered identifier stays registered for good, and GS1 will neither delete nor deactivate a key that has no product data behind it. Before testing against anything other than a development deployment, check with your platform operator that dry-run is on, and use the 952 prefix GS1 reserves for exactly this purpose.

Next

Two addons build on this one: lots and serial numbers take the same products down to the instance level, and visibility events report what happens to them.

Last updated: