If you’re running a business in Malaysia with Odoo’s Point of Sale and you use fiscal year-range invoice numbering — the kind that produces sequences like INV/2025-2026/00001 instead of a simple calendar year — your e-invoice submissions to the government’s MyInvois platform were quietly failing. Not with a warning. Not with a degraded experience. With a hard crash.
The error surfaced as a ValueError: not enough values to unpack (expected 4, got 2), which is the kind of message that means nothing to a cashier watching a POS terminal freeze and everything to a developer staring at a traceback. The root cause was a mismatch between what one method returned and what another method expected, buried in the sequence date-range logic that generates invoice numbers.
What Went Wrong
Malaysia’s LHDN (Lembaga Hasil Dalam Negeri) requires businesses above certain revenue thresholds to submit electronic invoices through the MyInvois platform. Odoo’s integration handles this automatically — when a POS transaction completes, the system generates a structured invoice document and transmits it to the government portal for validation and stamping.
The problem lived in how Odoo generates sequence numbers for these documents. Most businesses use simple date-based sequences: INV/2026/00001. But businesses with fiscal years that span calendar boundaries use year-range formats: INV/2025-2026/00001. This is standard accounting practice in many industries.
The MyInvois document model overrides a method called _get_sequence_date_range()from Odoo’s sequence mixin. The override calls a utility function that returns the fiscal year’s start and end dates — two values. But the parent implementation that actually processes these dates expects four values: the date range plus two additional parameters. When the system tried to unpack two values into four variables, it crashed.
The timing made this particularly insidious. Fiscal year-range sequences only trigger when the system detects that the current date falls within a multi-year fiscal period. Businesses using standard calendar-year sequences never encountered the bug. It only manifested for companies whose accounting periods straddle year boundaries — exactly the kind of setup where getting invoicing right is most critical for compliance.
The Impact on Malaysian Businesses
When a MyInvois submission fails, the invoice doesn’t just disappear. It sits in a pending state, unvalidated by the government. For POS transactions, this creates a cascading problem: the sale is recorded locally, but the official tax document never reaches LHDN. If the business doesn’t catch and manually resolve these failures, they accumulate into a compliance gap that surfaces during audits.
Consolidated invoices — where multiple POS transactions are batched into a single submission — were also affected. A single failed consolidation could block an entire batch of transactions from reaching the government portal.
How the Fix Works
The correction is surgically precise. The overridden method now explicitly unpacks the two values returned by the fiscal year utility function and appends two Nonevalues to match the four-value return format the parent class expects. It’s the kind of fix that takes one line to implement and weeks of confused POS operators to discover.
A dedicated test case now validates that consolidated invoice submissions work correctly with year-range formatted sequences, ensuring this specific interaction between fiscal year boundaries and MyInvois document generation won’t regress.
What This Means for Affected Businesses
Malaysian businesses using fiscal year-range sequences should update their Odoo instances and then audit their MyInvois submission logs for any invoices that failed during the affected period. The MyInvois portal provides a submission status dashboard where businesses can identify documents that were never successfully transmitted.
For businesses that haven’t adopted year-range sequences yet but plan to align their Odoo invoice numbering with their fiscal calendar, this fix removes the blocker. The feature now works as intended across all sequence formats.
The Broader Pattern
Government e-invoicing integrations are some of the most consequential code in any ERP system. They sit at the intersection of financial data, government API contracts, and real-time transaction processing. A bug in your CRM is an inconvenience. A bug in your tax submission pipeline is a compliance risk.
Malaysia’s MyInvois rollout has been aggressive — expanding from large enterprises to progressively smaller businesses throughout 2025 and 2026. As more companies come online with the mandate, edge cases like fiscal year-range sequences move from rare to routine. This fix lands at exactly the right time.