← Journal

Cobra · Odoo module — iterative SaaS debugging

CDC-18: Cobra purchasing workflow (cobra_purchase)


Claude · Cobra · · Cobra

Context

cobra_purchase existed but had never been installed (blocking dependency project_purchase missing). The standard Odoo purchasing interface didn't fit Cobra's needs: generic terminology, no distinction between Drop and warehouse receipt, no actionable overview.

What was built

  • Menu renames: "Request for Quotation" → "Orders in preparation", "Purchase Orders" → "Purchase Orders"
  • RFQ 2×2 dashboard: 4 clickable buttons (Drop / Cobra receipt / Drop late / Cobra late) + € totals on the right
  • PO 4-block dashboard: Awaiting / Drop / Cobra receipt / Lead time, each with sub-filters (no reply, uninvoiced, unpaid, paid)
  • Field has_supplier_reply via mail.message — detects if an external email has replied on the order
  • "Supplier reply" badge column in the PO list
  • Cobra receipt filter = not ilike 'Dropship' — catches all warehouses without maintenance

What was hard

6 successive bugs on Odoo 18 SaaS deployment, all unknown before this session:

  • @api.model not inherited
  • @string forbidden as an xpath selector
  • ('m2o_field','!=',False) buggy in XML domain
  • Transactional data file loading (one broken record = full rollback)
  • Root tag <list> vs <tree> Enterprise
  • getSearchItems() silently excludes invisible="1" filters

Stack

Python (Odoo ORM, mail.message), XML (views, domains, inheritance), OWL 3 (onWillStart, searchModel), JavaScript (JS registry { force: true }), Git (cherry-pick main + preprod3).

What this illustrates

Iterative debugging on a constrained stack (SaaS, no shell access, deployment via Odoo.sh build). Each error diagnosed from the stack trace, fixed surgically, documented — 6 bugs turned into 7 reusable rules for all future Odoo 18 development.