Cobra · Dev
Customer order status: invoiced, paid, delivered — three badges instead of one
Context
On a customer order, nothing clearly separated the invoice is out, the customer has paid and the goods are delivered — three different realities that sales reps sometimes conflated (an invoiced order can very well be unpaid). The starting point: bring to the sales side a principle already established on the purchasing side (supplier payment confirmation), with a spec prepared ahead of time by Hugo.
What was built
- Three independent badges — Invoicing / Payment / Delivery — instead of a merged status, with color coding: red = to handle on the rep's side, orange = to chase on the customer's side, green = settled.
- The Payment badge directly shows the deposit rate received ("Deposit 30%").
- The label "Remaining to collect" automatically switches to "Remaining to deliver" once the order is paid in full.
- Already-delivered lines are greyed out and pushed to the bottom of the order.
- The same columns added to the global "Customer orders" list view, plus an extension to in-store pickup ("awaiting pickup" / "pickup done" statuses).
What was hard
Cleanly separating three notions that overlap in Odoo's data (invoiced, paid, delivered) without merging them artificially — and keeping the logic consistent with the symmetric module already in place on the supplier side. Along the way, two calculation bugs fixed: the badge was based on the catalog price instead of the actually-invoiced price, and a partial deposit wasn't recognized as "paid".
Stack
Odoo (sale.order form + list views), XML, Python (status calculations).
What this illustrates
A pattern that keeps repeating at Cobra: once a UX principle works on one side of the business (supplier payment), it transposes to the other (customer payment) — and each transposition surfaces latent calculation bugs that had been lingering unseen for a long time.