Wednesday, January 14, 2026
2 changes · master
New functionality added to Odoo
This update adds a new service within Odoo that can decode EPC (Electronic Product Code) barcodes. It allows the system to translate these barcodes into their corresponding URIs or Element Strings, improving the ability to identify and track products. The decoder supports common EPC formats like SGTIN and SSCC, enhancing data capture and integration.
Original PR description
Add an EPC decoder as a front-end service. The decoder takes an EPC as a hexadecimal input and return the resulting URI or Element String. On incorrect input or unsupported decoding, the returned value is null. Currently support SGTIN-96, SGTIN-198, SSCC-96, SGLN-96, SGLN-195. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This pull request introduces support for GS1 EPC codes, a standard for identifying products using RFID tags. The changes include the necessary data structures and logic to encode and decode these codes, enabling better tracking and inventory management. The work is currently focused on testing and refining the encoding process, with future development planned for automation.
Original PR description
# Current State Overview <details><summary>$${\color{red}Deferred}$$ Backend/Python</summary> <p> Deferred: decoding doesn't make sense in the backend, and manufacturing isn't ready for EPC write…
# Current State Overview
<details><summary>$${\color{red}Deferred}$$ Backend/Python</summary>
<p>
Deferred: decoding doesn't make sense in the backend, and manufacturing isn't ready for EPC write automation, such that encoding isn't a priority.
Encode & Decode :
- sgtin-96
- sgtin-198
- sscc-96
- sgln-96
- sgln-195
TODO :
- Replace compute by explicit calls : more efficient and less complicated
- Implement logical segment bit count at scheme template level
Simple test :
```
# model: Electronic Product Code Scheme, gs1.epc.scheme
vals = [
#SGTIN
{'uri_tag': "urn:epc:tag:sgtin-96:3.0614141.812345.6789"},
{'raw_value': 0X3074257bf7194e4000001a85},
{'uri_tag': "urn:epc:tag:sgtin-198:3.0614141.812345.6789"},
{'raw_value': 0X3674257bf7194e5b3770e4000000000000000000000000000000},
{'uri_tag': "urn:epc:tag:sgtin-198:3.0614141.712345.32a%2Fb"},
{'raw_value': 0X3674257bf6b7a659b2c2bf100000000000000000000000000000},
#Others
{'uri_tag': "urn:epc:tag:sscc-96:3.0614141.1234567890"},
{'raw_value': 0X3174257bf4499602d2000000},
{'uri_tag': "urn:epc:tag:sgln-96:3.0614141.12345.5678"},
{'raw_value': 0X3274257bf46072000000162e},
{'uri_tag': "urn:epc:tag:sgln-195:3.0614141.12345.32a%2Fb"},
{'raw_value': 0X3974257bf46072cd9615f8800000000000000000000000000000},
]
schemes = model.create(vals)
message = []
for scheme in schemes:
message.append(f"Uri : {scheme.uri_tag}\nHex : {scheme.hex_value}\n") # Bit : {scheme.raw_value:b}\n
log('\n'.join(message))
```
Result :
```
Uri : urn:epc:tag:sgtin-96:3.0614141.812345.6789
Hex : 3074257bf7194e4000001a85
Uri : urn:epc:tag:sgtin-96:3.0614141.812345.6789
Hex : 3074257bf7194e4000001a85
Uri : urn:epc:tag:sgtin-198:3.0614141.812345.6789
Hex : 3674257bf7194e5b3770e4000000000000000000000000000000
Uri : urn:epc:tag:sgtin-198:3.0614141.812345.6789
Hex : 3674257bf7194e5b3770e4000000000000000000000000000000
Uri : urn:epc:tag:sgtin-198:3.0614141.712345.32a%2Fb
Hex : 3674257bf6b7a659b2c2bf100000000000000000000000000000
Uri : urn:epc:tag:sgtin-198:3.0614141.712345.32a%2Fb
Hex : 3674257bf6b7a659b2c2bf100000000000000000000000000000
Uri : urn:epc:tag:sscc-96:3.0614141.1234567890
Hex : 3174257bf4499602d2000000
Uri : urn:epc:tag:sscc-96:3.0614141.1234567890
Hex : 3174257bf4499602d2000000
Uri : urn:epc:tag:sgln-96:3.0614141.12345.5678
Hex : 3274257bf46072000000162e
Uri : urn:epc:tag:sgln-96:3.0614141.12345.5678
Hex : 3274257bf46072000000162e
Uri : urn:epc:tag:sgln-195:3.0614141.12345.32a%2Fb
Hex : 3974257bf46072cd9615f8800000000000000000000000000000
Uri : urn:epc:tag:sgln-195:3.0614141.12345.32a%2Fb
Hex : 3974257bf46072cd9615f8800000000000000000000000000000
```
</p>
</details>
<details><summary>$${\color{orange}In \space Progress}$$ Frontend/Javascript</summary>
<p>
Decode Only :
- sgtin-96
</p>
</details>
To compare and test :
- https://www.gs1.org/services/epc-encoderdecoder
- TDS 2.1, part E.3 (https://ref.gs1.org/standards/tds/2.1.0/, p.242)
[Task #4256189](https://www.odoo.com/odoo/project.task/4256189)