From Spreadsheets to an Integrated ERP
A Saudi trading and manpower-contracting group ran its books on spreadsheets. I moved it onto Odoo 19 with validated migration scripts, rule-based profitability reporting and ZATCA e-invoicing controls built in.
Client screenshots are confidential. The visuals on this page are illustrative representations of the implemented workflows, built with fictional data.
- My role
- ERP Engineer
- Industry
- Material trading & manpower contracting, Saudi Arabia
- Project type
- ERP migration & compliance
- Timeline
- May 2026 – Present
- Core stack
- Odoo 19, Python, XML-RPC
The starting point
The group ran its accounts, customer and vendor lists and employee records across disconnected Excel workbooks, with a separate tool producing invoice QR codes. Material trading and manpower contracting shared one set of books, so leadership could not see which business line was actually earning the margin.
Years of free-form entry had left the same supplier recorded under several spellings, and VAT numbers missing or malformed. That mattered more than usual: under ZATCA Phase 2, every B2B invoice must be cleared by the Saudi tax authority before the customer receives it, and clearance depends on clean buyer data.
My contribution
I was the engineer on the implementation, working alongside the chartered accountant who owned the accounting policy. I built the migration and cleanup scripts, configured the analytic, VAT and automation rules inside Odoo, took ZATCA e-invoicing from a readiness assessment to production, and wrote the guides the client's staff use day to day.
Engineering approach
Four decisions shaped the build. Each traded a little speed for a ledger the client could trust.
Data migration & validation
Every import script reads the master-data template and runs a validation pass first: Iqama numbers, IBANs, phone formats, duplicate tax IDs. If one row fails, nothing is written. Scripts default to a dry run and only write with an explicit flag; bulk edits to posted entries save a snapshot first and ship with a rollback.
Why: On a live ledger, a half-finished import is worse than none.
Analytic accounting & reporting
Four analytic plans run on every transaction: segment, client or contract, unit, and project. Automation rules fill the segment and unit from the employee contract, the product or the overhead vendor, so nobody picks tags by hand. Overhead sits in its own admin cost pool instead of being allocated, which keeps each segment's margin clean.
Why: Manual tagging is where analytic reporting breaks first. Rules make segment P&L a by-product of normal data entry.
Segment P&L, straight from the ledger.Illustration · fictional data Four plans: segment, client or contract, unit, project.Illustration · fictional data Compliance & data quality
ZATCA Phase 2 clearance runs on the operating company's sales journal, rehearsed end to end on a test replica before production. Upstream, VAT checks run at the point of entry: a customer can't be saved without a valid 15-digit Saudi VAT number, and a vendor without one creates a follow-up task.
Why: Once ZATCA accepts an invoice, only a credit note can reverse it. Stopping bad data at creation is far cheaper than correcting it after clearance.
Invoices clear ZATCA before they reach the customer.Illustration · fictional data Invalid VAT numbers are stopped at creation.Illustration · fictional data Data cleanup & operational tooling
A double-click toolkit lets accounting staff find likely duplicate vendors, customers and products. They mark each group Keep, Archive or Not a duplicate in a review workbook. The apply step snapshots every linked bill, payment and journal line, merges through Odoo's native wizard, then checks that the surviving record's totals equal both sides combined.
Why: Master data decays after go-live. Cleanup had to be something the team could repeat safely without me.
Staff decide; the script only carries out reviewed actions.Illustration · fictional data
Architecture & workflows
Excel was the source for the initial load; after that, everything lives in Odoo. Python sits between the two as a gate rather than a pipe: data reaches Odoo only after it validates.
Excel source data
- Master-data templates
- Customers, vendors, products, employees
- Legacy ledgers & bank statements
Python migration layer
- Validation before any write
- Dry run by default
- Snapshots & rollback
- Odoo API over XML-RPC
Odoo 19, multi-company
- Group companies, shared contacts
- Test replica for rehearsals
- Automation & VAT rules
Reporting & compliance
- Analytic plans → segment P&L
- VAT checks at entry
- ZATCA Phase 2 clearance
Cleanup loop: The toolkit reads Odoo, staff review duplicates in Excel, and verified merges are written back.
Results
The numbers come from the first master-data cleanup. The rest are controls that now run on every transaction.
- Vendor records
- 181 → 164
- 14 duplicate groups merged
- Customer records
- 55 → 47
- Empty duplicates archived, 3 merged
- Duplicate products
- 11 archived
- Unused templates only
- Merge verification
- All passed
- Totals matched before and after every merge
- Segment P&L for trading and manpower comes straight from Odoo, not a spreadsheet consolidation.
- Customer invoices clear ZATCA Phase 2 from the operating company's sales journal.
- Invalid customer VAT numbers are blocked at creation in every company.
- Staff run duplicate cleanup themselves, with a backup taken before every merge.
Technology stack
- Odoo 19
- Python
- XML-RPC
- ZATCA e-invoicing
- Analytic Accounting
- Excel