Files
Odoo-Modules/nexa_coa_setup
gsinghpal 092423d7de feat(nexa_coa_setup): hard-delete unused accounts
Adds _delete_unused_accounts hook that hard-deletes (not archives) every
account that's safe to remove — not owned by nexa_coa_setup AND not
referenced by:
- account.move.line postings
- account.tax.repartition.line
- account.journal default/suspense/profit/loss accounts
- account.fiscal.position.account substitution maps
- product.category and product.template JSONB property_account_* fields
- res.partner JSONB property_account_payable_id/receivable_id
- res.company exchange/transfer/POS receivable accounts

Tries bulk unlink first; falls back to per-record if a batch fails so
the rest still get cleaned.

Result on staging: 554 -> 172 total accounts (deleted 382). The 31 still
archived are blocked by references (historical postings, tax repartition
links, bank journal defaults, etc.) — left as archived so they're hidden
from dropdowns but preserve audit history.

Verified all 4 test invoices still post correctly (ON 113, US 100, QC
114.98, Westin intercompany 169.50).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 19:49:00 -04:00
..

Nexa Systems — Chart of Accounts Setup

Custom Odoo 19 module that configures the chart of accounts, taxes, fiscal positions, analytic plans, and partner records for Nexa Systems Inc.

Install

docker exec odoo-nexa-app odoo -c /etc/odoo/odoo.conf -d nexamain \
  -i nexa_coa_setup --no-http --stop-after-init

Update

docker exec odoo-nexa-app odoo -c /etc/odoo/odoo.conf -d nexamain \
  -u nexa_coa_setup --no-http --stop-after-init

Design reference

See docs/superpowers/specs/2026-05-12-nexa-coa-design.md.

Safety

Always take a pg_dump BEFORE running -i or -u. See docs/superpowers/plans/2026-05-12-nexa-coa-setup.md Phase 0.