fusion.billing.import.wizard backfills NexaCloud into Odoo: read-only psycopg2 reader (_read_nexacloud_rows, DSN from ir.config_parameter) split from pure-Odoo writes (_import_rows/_do_import) so the logic is unit-tested headless. Maps users→partners+links (reusing _resolve_or_create_partner, stashing stripe_customer_id), plans→a cpu_seconds charge catalog (included_quota=cpu_seconds_quota, unit_batch=3600, $0.0075/core-hour, plan_id NULL), and deployments→one DRAFT shadow sale.order per deployment with the flat price set explicitly. Shadow-safe by construction: draft + no payment token + charge plan_id NULL (rating cron is a no-op). Idempotent re-runs; per-row savepoints isolate bad rows; dry-run rolls back. 11 tests, 50/50 green on odoo-trial.
57 lines
2.3 KiB
Python
57 lines
2.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Copyright 2026 Nexa Systems Inc.
|
|
# License OPL-1 (Odoo Proprietary License v1.0)
|
|
{
|
|
"name": "Fusion Centralized Billing",
|
|
"version": "19.0.1.0.0",
|
|
"category": "Accounting/Subscriptions",
|
|
"summary": "Centralized billing engine for all NexaSystems services — metered usage, "
|
|
"per-app billing API, and outbound webhooks on top of Odoo Enterprise subscriptions.",
|
|
"description": """
|
|
Fusion Centralized Billing
|
|
==========================
|
|
|
|
Makes this Odoo Enterprise instance the single billing brain for every NexaSystems
|
|
service (NexaCloud hosting, NexaDesk chat, NexaMaps API, custom apps, memberships).
|
|
|
|
It adds ONLY the metering + integration layer; all financial behaviour (invoicing,
|
|
HST tax, proration, dunning, portal, credit notes, Stripe) is native Odoo Enterprise.
|
|
|
|
Capabilities
|
|
------------
|
|
* Service registry — one record per source app (NexaCloud / NexaDesk / NexaMaps) with
|
|
bearer API key + webhook config.
|
|
* Identity links — fold each app's external account into one ``res.partner``.
|
|
* Metric + Charge catalog — billable metrics with quota + overage pricing, keyed by a
|
|
shared ``plan_code`` (apps own feature entitlements; Odoo owns money).
|
|
* Usage engine — aggregate-push: apps send periodic counters; a pre-invoice cron feeds
|
|
billable quantities onto the subscription ``sale.order``.
|
|
* Inbound API — Lago-shaped REST (``/api/billing/v1/*``), bearer auth.
|
|
* Outbound webhooks — HMAC-signed lifecycle events (payment failed/succeeded,
|
|
subscription terminated) so apps suspend / restore / deprovision.
|
|
|
|
Design spec: docs/superpowers/specs/2026-05-27-nexa-billing-centralized-design.md
|
|
|
|
Status: SCAFFOLD. Model fields are in place; engine/API/webhook bodies are stubs to be
|
|
implemented via the writing-plans output. Per repo CLAUDE.md, read live Odoo 19
|
|
reference files from the container before implementing subscription/account internals.
|
|
""",
|
|
"author": "Nexa Systems Inc.",
|
|
"website": "https://nexasystems.ca",
|
|
"license": "OPL-1",
|
|
"depends": [
|
|
"account_accountant",
|
|
"sale_subscription",
|
|
"sale_management",
|
|
"payment_stripe",
|
|
],
|
|
"data": [
|
|
"security/ir.model.access.csv",
|
|
"data/ir_cron.xml",
|
|
"views/import_wizard_views.xml",
|
|
],
|
|
"installable": True,
|
|
"application": False,
|
|
"auto_install": False,
|
|
}
|