Skip to content

[19.0][MIG] l10n_us_mis_financial_report: Migration to 19.0#180

Draft
dnplkndll wants to merge 19 commits into
OCA:19.0from
ledoent:19.0-mig-l10n_us_mis_financial_report
Draft

[19.0][MIG] l10n_us_mis_financial_report: Migration to 19.0#180
dnplkndll wants to merge 19 commits into
OCA:19.0from
ledoent:19.0-mig-l10n_us_mis_financial_report

Conversation

@dnplkndll
Copy link
Copy Markdown

Migration of l10n_us_mis_financial_report to Odoo 19.0.

@OCA-git-bot OCA-git-bot added series:19.0 mod:l10n_us_mis_financial_report Module l10n_us_mis_financial_report labels May 24, 2026
@dnplkndll dnplkndll force-pushed the 19.0-mig-l10n_us_mis_financial_report branch 2 times, most recently from 6b39941 to 34a5275 Compare May 24, 2026 16:52
@dnplkndll dnplkndll force-pushed the 19.0-mig-l10n_us_mis_financial_report branch from 34a5275 to 2a17b84 Compare May 24, 2026 16:57
dnplkndll added 2 commits May 25, 2026 18:22
- demo/demo.xml: 11 USDMO-prefixed accounts + 3 posted journal entries
  covering all US GAAP differentiators (expense_direct_cost/COGS,
  income_other/interest, expense_depreciation, asset_fixed, liability_non_current).
  Entries are self-contained and CoA-agnostic (use USDMO codes).

- tests/test_mis_report_us.py: TransactionCase with setUpClass fixtures
  identical to the demo scenario. Covers:
  - structure: 9 P&L KPIs present, 24 BS KPIs present
  - gross_profit = op_inc − cost_of_reven = 4 000
  - net_profit = 1 500
  - other_inc = 500, depreciation = 1 000 (distinct expense lines)
  - BS fixed_assets = 19 000, non_current_liabilities = 15 000
mis_builder.compute() returns body rows with keys label / description /
style / cells — there is no row_id. KpiMatrixRow.label returns
kpi.description (display string), and two of this report's P&L KPIs
have the same description ('Expenses' for kpi_expenses and
kpi_expenses_total). Auto_expand_accounts also adds detail rows under
each parent, so sequence-based indexing into body is unreliable.

New helper _kpi_value(report_xmlid, kpi_name) walks body in matrix order
and selects the Nth row whose label equals the target KPI's description,
where N counts earlier KPIs (by sequence) that share the same
description. This gives unambiguous lookups by technical kpi name.

Fixes CI:
  KeyError: 'row_id'
on TestMisReportUs.test_gross_profit / test_net_profit / test_other_income
/ test_depreciation / test_bs_fixed_assets_and_noncurrent_liabilities.
@dnplkndll dnplkndll force-pushed the 19.0-mig-l10n_us_mis_financial_report branch 3 times, most recently from 2007db5 to 53c78ab Compare May 29, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:l10n_us_mis_financial_report Module l10n_us_mis_financial_report series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants