fix(nexa_coa_setup): clean GL codes — 119100/119900->115200/115900, 511105->511100

Three odd code positions that were chosen to dodge l10n_ca collisions are
now cleaned up:
- Due From Shareholder       119100 -> 115200 (115xxx is where receivables belong)
- Due From Associated Corps  119900 -> 115900
- Cloud Infrastructure       511105 -> 511100 (legacy 'Inside Purchases'
                                       renamed to 511100.OLD)

Applied to prod via scripts/fix_gl_codes.py (now committed).

Module XML updated: <field name='code'> values match new codes; XMLIDs
(acct_119100, acct_119900, acct_511105) preserved so existing
ir.model.data rows on prod still map to the right records.

pre_init_hook augmented with _L10N_CA_FORCE_CLEAR_CODES set so a fresh
install on a new DB also force-clears 511100 (which would otherwise be
blocked by the postings-exist guard).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-12 20:02:54 -04:00
parent 092423d7de
commit 749c0335fa
3 changed files with 72 additions and 16 deletions

View File

@@ -8,16 +8,20 @@
<!-- NOTE: 115100 is l10n_ca "Customers Account" (240 postings — AR control) — kept as l10n_ca.
115110 is l10n_ca "Customers Account (PoS)" — kept.
Nexa intercompany receivables live in the 119xxx range to avoid all collisions. -->
Nexa intercompany receivables sit at 115200 / 115900 (freed when their
unused l10n_ca defaults — Mortgage Loans — were deleted during install).
XMLIDs (acct_119100, acct_119900) preserved from initial install where
these accounts were at codes 119100/119900 — codes updated in-place via
scripts/fix_gl_codes.py without rewriting ir.model.data. -->
<record id="acct_119100" model="account.account">
<field name="code">119100</field>
<field name="code">115200</field>
<field name="name">Due From Shareholder — Gurpreet</field>
<field name="account_type">asset_current</field>
<field name="reconcile" eval="True"/>
</record>
<record id="acct_119900" model="account.account">
<field name="code">119900</field>
<field name="code">115900</field>
<field name="name">Due From Associated Corporations</field>
<field name="account_type">asset_current</field>
<field name="reconcile" eval="True"/>
@@ -348,10 +352,12 @@
<!-- 5xxxxx — DIRECT COSTS (COGS) -->
<!-- ============================================================ -->
<!-- NOTE: 511100 was "Inside Purchases" in l10n_ca (1 posting from legacy bookkeeping) — kept as l10n_ca.
Cloud Infrastructure sits at 511105 to avoid collision. -->
<!-- NOTE: legacy l10n_ca "Inside Purchases" at 511100 (had 1 historical
posting) was renamed to 511100.OLD via scripts/fix_gl_codes.py —
Cloud Infrastructure now claims the clean 511100 code. XMLID
acct_511105 preserved from initial install. -->
<record id="acct_511105" model="account.account">
<field name="code">511105</field>
<field name="code">511100</field>
<field name="name">Cloud Infrastructure (AWS, Hetzner, OVH, DigitalOcean, Linode)</field>
<field name="account_type">expense_direct_cost</field>
</record>