Skill

Automate Odoo EDI Document Exchange

Maps EDI transactions (X12/EDIFACT) to Odoo business objects and automates inbound/outbound B2B document flows.

Works with odoo

76
Spark score
out of 100
Updated last month
Version 13.1.1

Add to Favorites

Why it matters

Streamline business-to-business document exchange by automating the mapping and processing of Electronic Data Interchange (EDI) transactions directly within Odoo.

Outcomes

What it gets done

01

Map EDI transactions (ANSI X12/EDIFACT) to Odoo business objects.

02

Configure trading partner settings for automated document flows.

03

Automate inbound purchase orders (850) and outbound invoices (810) and ASNs (856).

04

Generate functional acknowledgments (997) for received transactions.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-odoo-edi-connector | bash

Overview

Odoo EDI Connector

A skill mapping EDI X12/EDIFACT transactions (purchase orders, ASNs, invoices) to Odoo business objects, with working Python parsing/creation code and acknowledgment handling. Use when a trading partner requires EDI document exchange with Odoo, or when mapping a new EDI transaction set to Odoo objects.

What it does

This skill guides mapping EDI (Electronic Data Interchange) transactions - the standard for automated B2B document exchange like purchase orders, invoices, and Advance Shipping Notices - in ANSI X12 or EDIFACT format to Odoo business objects, setting up trading partner configurations, and automating inbound/outbound document flows. It works by activation (mention @odoo-edi-connector and specify the EDI transaction set and trading partner), mapping (a complete field mapping table between EDI segments and Odoo fields), and automation (Python code to parse incoming EDI files and create Odoo records).

When to use - and when NOT to

Use this skill when a retail partner requires EDI 850 (Purchase Orders) to do business, when you need to send EDI 856 (ASN) as goods ship, when automating EDI 810 (Invoice) generation from confirmed Odoo deliveries, or when mapping EDI fields to Odoo fields for a new trading partner. The EDI-to-Odoo object mapping: 850 Purchase Order maps to sale.order (inbound customer PO), 855 PO Acknowledgment maps to a confirmation email or SO confirmation, 856 ASN maps to stock.picking (delivery order), 810 Invoice maps to account.move (customer invoice), 846 Inventory Inquiry maps to product.product stock levels, and 997 Functional Acknowledgment maps to an automated receipt confirmation.

Inputs and outputs

A worked Python example parses an X12 850 file with pyx12, extracts the PO number and date from the BEG segment, checks Odoo for an existing sale order with that client_order_ref before proceeding (idempotency), looks up the buyer partner from the N1 segment, extracts line items from PO1 segments matched against product.product by SKU, and creates the sale order via Odoo's XML-RPC API:

### IDEMPOTENCY CHECK: Verify PO doesn't already exist in Odoo
existing = models.execute_kw(db, uid, pwd, 'sale.order', 'search', [
    [['client_order_ref', '=', po_number]]
])
if existing:
    print(f"Skipping: PO {po_number} already exists.")
    continue

A second example generates a 997 Functional Acknowledgment, building the ISA/GS/ST/AK1/AK9/SE/GE/IEA envelope segments with the current date and the original transaction's control numbers.

Integrations

Integrates with Odoo via its XML-RPC API (sale.order, res.partner, product.product, account.move, stock.picking) and with EDI parsing via pyx12 (pip install pyx12) for X12 transaction sets. Documented best practices: store every raw EDI transaction in an audit log table before processing; always send a 997 Functional Acknowledgment within 24 hours of receiving a transaction; negotiate a test cycle with trading partners before going live, using the test ISA qualifier T; never process EDI files synchronously inside web requests, queue them for async processing instead; and never hardcode trading-partner qualifiers, storing them in a per-partner configuration table instead.

Who it's for

ERP/integration developers connecting Odoo to retail or B2B trading partners over EDI who need concrete field mappings between EDI transaction sets and Odoo objects, working parsing/creation code, and the acknowledgment and testing practices trading partners expect before going live.

Source README

Electronic Data Interchange (EDI) is the standard for automated B2B document exchange - purchase orders, invoices, ASNs (Advance Shipping Notices). This skill guides you through mapping EDI transactions (ANSI X12 or EDIFACT) to Odoo business objects, setting up trading partner configurations, and automating inbound/outbound document flows.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.