diff --git a/mis_report_account_coverage_check/README.rst b/mis_report_account_coverage_check/README.rst new file mode 100644 index 000000000..8c91b7992 --- /dev/null +++ b/mis_report_account_coverage_check/README.rst @@ -0,0 +1,149 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================= +MIS Report Account Coverage Check +================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d15b6b79010e83433bb3d45bca81fecc88cd9c794b0dc69f54db09a7b5b3784e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmis--builder-lightgray.png?logo=github + :target: https://github.com/OCA/mis-builder/tree/15.0/mis_report_account_coverage_check + :alt: OCA/mis-builder +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mis-builder-15-0/mis-builder-15-0-mis_report_account_coverage_check + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mis-builder&target_branch=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +A MIS Builder report (e.g. a balance sheet) only shows what its KPI +expressions explicitly reference. If an account within the report's range +receives postings during the period but no KPI expression covers it, the +report silently omits it -- typically the symptom is a balance sheet that +does not balance, with no obvious way to find out why. + +This module adds a wizard that, given a MIS report instance and an account +code range, finds accounts in that range which have journal entries posted +during the report's period(s) but are not referenced by any KPI expression +of the report (including subreport KPIs). Each uncovered account is shown +with its period debit/credit/balance, with a direct drill-down to the +underlying journal items. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +No configuration is needed. The wizard is available to users in the +``Accounting / Account User`` group. + +Usage +===== + +#. Open a MIS Report Instance (*Accounting > Reporting > MIS Reporting > + MIS Reports*) and click the *Check Account Coverage* button, or go to + *Accounting > Reporting > MIS Reporting > Account Coverage Check* and + pick the report instance manually. +#. Enter the account code range to check, e.g. ``100000`` to ``599999``. +#. Optionally restrict the periods to check; leave empty to check every + period column defined on the report instance. +#. Click *Check*. Any account in the range that has postings in a period + but is not referenced by any KPI expression of the report is listed with + its debit, credit and balance for that period. +#. Click *View Journal Items* on a line to open the underlying journal + entries causing that account to appear. + +.. note:: + The account range is compared as text (``account.account.code``), so it + is only reliable when the codes being compared have the same number of + digits (as is normally the case, e.g. 6-digit Spanish PGC codes). A range + like ``7`` to ``12`` would not behave as expected since ``"7" <= "12"`` + is false as a string comparison. + +.. note:: + Coverage means "referenced by *any* KPI expression of the report", + including aggregate/rollup KPIs (e.g. a "Result for the year" line that + nets a whole P&L range like ``6%,7%`` into a single equity figure). That + is intentional: if an account is correctly summed into such a KPI it does + not put the report out of balance, so it should not be reported as + uncovered even though it has no individual detail line of its own. + +.. note:: + Without a chart's usual closing/opening entries, a balance-sheet + account's balance keeps accumulating from postings dated before the + period being checked. To match how mis_builder itself computes a + balance-sheet KPI ("ending balance" mode), an uncovered account's + debit/credit/balance are summed since the beginning of time for + balance-sheet accounts (asset/liability/equity), and since the start of + the fiscal year only for P&L accounts (income/expense), which do reset + every year. So a posting from a previous period can still make an + account show up as uncovered today. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_ + + * Carlos Dauden + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-carlosdauden| image:: https://github.com/carlosdauden.png?size=40px + :target: https://github.com/carlosdauden + :alt: carlosdauden + +Current `maintainer `__: + +|maintainer-carlosdauden| + +This module is part of the `OCA/mis-builder `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mis_report_account_coverage_check/__init__.py b/mis_report_account_coverage_check/__init__.py new file mode 100644 index 000000000..40272379f --- /dev/null +++ b/mis_report_account_coverage_check/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/mis_report_account_coverage_check/__manifest__.py b/mis_report_account_coverage_check/__manifest__.py new file mode 100644 index 000000000..9588128b1 --- /dev/null +++ b/mis_report_account_coverage_check/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2026 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "MIS Report Account Coverage Check", + "version": "15.0.1.0.0", + "category": "Accounting", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/mis-builder", + "license": "AGPL-3", + "depends": ["account", "mis_builder"], + "data": [ + "security/ir.model.access.csv", + "wizard/mis_report_account_coverage_check_views.xml", + "views/mis_report_instance_views.xml", + ], + "installable": True, + "maintainers": ["carlosdauden"], +} diff --git a/mis_report_account_coverage_check/i18n/es.po b/mis_report_account_coverage_check/i18n/es.po new file mode 100644 index 000000000..d258e2144 --- /dev/null +++ b/mis_report_account_coverage_check/i18n/es.po @@ -0,0 +1,209 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_report_account_coverage_check +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-07-24 15:06+0000\n" +"PO-Revision-Date: 2026-07-24 15:06+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__account_id +msgid "Account" +msgstr "Cuenta" + +#. module: mis_report_account_coverage_check +#: model:ir.ui.menu,name:mis_report_account_coverage_check.mis_report_account_coverage_check_menu +msgid "Account Coverage Check" +msgstr "Comprobación de cobertura de cuentas" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__account_name +msgid "Account Name" +msgstr "Nombre de la cuenta" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__account_code_from +msgid "Account code from" +msgstr "Código de cuenta desde" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__account_code_to +msgid "Account code to" +msgstr "Código de cuenta hasta" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__balance +msgid "Balance" +msgstr "Saldo" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__check_id +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Check" +msgstr "Comprobar" + +#. module: mis_report_account_coverage_check +#: model:ir.actions.act_window,name:mis_report_account_coverage_check.action_mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_instance_view_form +msgid "Check Account Coverage" +msgstr "Comprobar cobertura de cuentas" + +#. module: mis_report_account_coverage_check +#: model:ir.model,name:mis_report_account_coverage_check.model_mis_report_account_coverage_check +msgid "Check accounts used in postings but not covered by a MIS report" +msgstr "" +"Comprueba las cuentas usadas en apuntes pero no cubiertas por un informe MIS" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Close" +msgstr "Cerrar" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__account_code +msgid "Code" +msgstr "Código" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields.selection,name:mis_report_account_coverage_check.selection__mis_report_account_coverage_check__state__init +msgid "Configuration" +msgstr "Configuración" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__create_uid +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__create_date +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__credit +msgid "Credit" +msgstr "Haber" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__currency_id +msgid "Currency" +msgstr "Moneda" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__debit +msgid "Debit" +msgstr "Debe" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__display_name +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__id +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__id +msgid "ID" +msgstr "ID" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__move_line_count +msgid "Journal Items" +msgstr "Apuntes contables" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check____last_update +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line____last_update +msgid "Last Modified on" +msgstr "Última modificación en" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__write_uid +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__write_date +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,help:mis_report_account_coverage_check.field_mis_report_account_coverage_check__period_ids +msgid "Leave empty to check all periods of the instance." +msgstr "Déjelo vacío para comprobar todos los periodos de la instancia." + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__report_instance_id +msgid "MIS Report Instance" +msgstr "Instancia de informe MIS" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Modify criteria" +msgstr "Modificar criterios" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__period_id +msgid "Period" +msgstr "Periodo" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__period_ids +msgid "Periods to check" +msgstr "Periodos a comprobar" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields.selection,name:mis_report_account_coverage_check.selection__mis_report_account_coverage_check__state__done +msgid "Results" +msgstr "Resultados" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__state +msgid "Status" +msgstr "Estado" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Total Balance" +msgstr "Saldo total" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Total Credit" +msgstr "Total haber" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Total Debit" +msgstr "Total debe" + +#. module: mis_report_account_coverage_check +#: model:ir.model,name:mis_report_account_coverage_check.model_mis_report_account_coverage_check_line +msgid "Uncovered account found during a MIS report coverage check" +msgstr "" +"Cuenta no cubierta encontrada durante una comprobación de cobertura de un " +"informe MIS" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__line_ids +msgid "Uncovered accounts" +msgstr "Cuentas no cubiertas" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "View Journal Items" +msgstr "Ver apuntes contables" diff --git a/mis_report_account_coverage_check/i18n/mis_report_account_coverage_check.pot b/mis_report_account_coverage_check/i18n/mis_report_account_coverage_check.pot new file mode 100644 index 000000000..3b2ef1c15 --- /dev/null +++ b/mis_report_account_coverage_check/i18n/mis_report_account_coverage_check.pot @@ -0,0 +1,205 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_report_account_coverage_check +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-07-24 15:06+0000\n" +"PO-Revision-Date: 2026-07-24 15:06+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__account_id +msgid "Account" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.ui.menu,name:mis_report_account_coverage_check.mis_report_account_coverage_check_menu +msgid "Account Coverage Check" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__account_name +msgid "Account Name" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__account_code_from +msgid "Account code from" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__account_code_to +msgid "Account code to" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__balance +msgid "Balance" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__check_id +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Check" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.actions.act_window,name:mis_report_account_coverage_check.action_mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_instance_view_form +msgid "Check Account Coverage" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model,name:mis_report_account_coverage_check.model_mis_report_account_coverage_check +msgid "Check accounts used in postings but not covered by a MIS report" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Close" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__account_code +msgid "Code" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields.selection,name:mis_report_account_coverage_check.selection__mis_report_account_coverage_check__state__init +msgid "Configuration" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__create_uid +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__create_uid +msgid "Created by" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__create_date +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__create_date +msgid "Created on" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__credit +msgid "Credit" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__currency_id +msgid "Currency" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__debit +msgid "Debit" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__display_name +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__display_name +msgid "Display Name" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__id +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__id +msgid "ID" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__move_line_count +msgid "Journal Items" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check____last_update +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line____last_update +msgid "Last Modified on" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__write_uid +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__write_date +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__write_date +msgid "Last Updated on" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,help:mis_report_account_coverage_check.field_mis_report_account_coverage_check__period_ids +msgid "Leave empty to check all periods of the instance." +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__report_instance_id +msgid "MIS Report Instance" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Modify criteria" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check_line__period_id +msgid "Period" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__period_ids +msgid "Periods to check" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields.selection,name:mis_report_account_coverage_check.selection__mis_report_account_coverage_check__state__done +msgid "Results" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__state +msgid "Status" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Total Balance" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Total Credit" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "Total Debit" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model,name:mis_report_account_coverage_check.model_mis_report_account_coverage_check_line +msgid "Uncovered account found during a MIS report coverage check" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model:ir.model.fields,field_description:mis_report_account_coverage_check.field_mis_report_account_coverage_check__line_ids +msgid "Uncovered accounts" +msgstr "" + +#. module: mis_report_account_coverage_check +#: model_terms:ir.ui.view,arch_db:mis_report_account_coverage_check.mis_report_account_coverage_check_view_form +msgid "View Journal Items" +msgstr "" diff --git a/mis_report_account_coverage_check/readme/CONFIGURE.rst b/mis_report_account_coverage_check/readme/CONFIGURE.rst new file mode 100644 index 000000000..5ba31707b --- /dev/null +++ b/mis_report_account_coverage_check/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +No configuration is needed. The wizard is available to users in the +``Accounting / Account User`` group. diff --git a/mis_report_account_coverage_check/readme/CONTRIBUTORS.rst b/mis_report_account_coverage_check/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..e0af8f6f7 --- /dev/null +++ b/mis_report_account_coverage_check/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Tecnativa `_ + + * Carlos Dauden diff --git a/mis_report_account_coverage_check/readme/DESCRIPTION.rst b/mis_report_account_coverage_check/readme/DESCRIPTION.rst new file mode 100644 index 000000000..f0fa06a53 --- /dev/null +++ b/mis_report_account_coverage_check/readme/DESCRIPTION.rst @@ -0,0 +1,12 @@ +A MIS Builder report (e.g. a balance sheet) only shows what its KPI +expressions explicitly reference. If an account within the report's range +receives postings during the period but no KPI expression covers it, the +report silently omits it -- typically the symptom is a balance sheet that +does not balance, with no obvious way to find out why. + +This module adds a wizard that, given a MIS report instance and an account +code range, finds accounts in that range which have journal entries posted +during the report's period(s) but are not referenced by any KPI expression +of the report (including subreport KPIs). Each uncovered account is shown +with its period debit/credit/balance, with a direct drill-down to the +underlying journal items. diff --git a/mis_report_account_coverage_check/readme/USAGE.rst b/mis_report_account_coverage_check/readme/USAGE.rst new file mode 100644 index 000000000..4a9539b3f --- /dev/null +++ b/mis_report_account_coverage_check/readme/USAGE.rst @@ -0,0 +1,38 @@ +#. Open a MIS Report Instance (*Accounting > Reporting > MIS Reporting > + MIS Reports*) and click the *Check Account Coverage* button, or go to + *Accounting > Reporting > MIS Reporting > Account Coverage Check* and + pick the report instance manually. +#. Enter the account code range to check, e.g. ``100000`` to ``599999``. +#. Optionally restrict the periods to check; leave empty to check every + period column defined on the report instance. +#. Click *Check*. Any account in the range that has postings in a period + but is not referenced by any KPI expression of the report is listed with + its debit, credit and balance for that period. +#. Click *View Journal Items* on a line to open the underlying journal + entries causing that account to appear. + +.. note:: + The account range is compared as text (``account.account.code``), so it + is only reliable when the codes being compared have the same number of + digits (as is normally the case, e.g. 6-digit Spanish PGC codes). A range + like ``7`` to ``12`` would not behave as expected since ``"7" <= "12"`` + is false as a string comparison. + +.. note:: + Coverage means "referenced by *any* KPI expression of the report", + including aggregate/rollup KPIs (e.g. a "Result for the year" line that + nets a whole P&L range like ``6%,7%`` into a single equity figure). That + is intentional: if an account is correctly summed into such a KPI it does + not put the report out of balance, so it should not be reported as + uncovered even though it has no individual detail line of its own. + +.. note:: + Without a chart's usual closing/opening entries, a balance-sheet + account's balance keeps accumulating from postings dated before the + period being checked. To match how mis_builder itself computes a + balance-sheet KPI ("ending balance" mode), an uncovered account's + debit/credit/balance are summed since the beginning of time for + balance-sheet accounts (asset/liability/equity), and since the start of + the fiscal year only for P&L accounts (income/expense), which do reset + every year. So a posting from a previous period can still make an + account show up as uncovered today. diff --git a/mis_report_account_coverage_check/security/ir.model.access.csv b/mis_report_account_coverage_check/security/ir.model.access.csv new file mode 100644 index 000000000..c1db0a155 --- /dev/null +++ b/mis_report_account_coverage_check/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_mis_report_account_coverage_check,mis.report.account.coverage.check,model_mis_report_account_coverage_check,account.group_account_user,1,1,1,1 +access_mis_report_account_coverage_check_line,mis.report.account.coverage.check.line,model_mis_report_account_coverage_check_line,account.group_account_user,1,1,1,1 diff --git a/mis_report_account_coverage_check/static/description/icon.png b/mis_report_account_coverage_check/static/description/icon.png new file mode 100644 index 000000000..1dcc49c24 Binary files /dev/null and b/mis_report_account_coverage_check/static/description/icon.png differ diff --git a/mis_report_account_coverage_check/static/description/index.html b/mis_report_account_coverage_check/static/description/index.html new file mode 100644 index 000000000..0ec0bf3ca --- /dev/null +++ b/mis_report_account_coverage_check/static/description/index.html @@ -0,0 +1,492 @@ + + + + + +MIS Report Account Coverage Check + + + +
+ + +Odoo Community Association +
+

MIS Report Account Coverage Check

+ +

Beta License: AGPL-3 OCA/mis-builder Translate me on Weblate Try me on Runboat

+

A MIS Builder report (e.g. a balance sheet) only shows what its KPI +expressions explicitly reference. If an account within the report’s range +receives postings during the period but no KPI expression covers it, the +report silently omits it – typically the symptom is a balance sheet that +does not balance, with no obvious way to find out why.

+

This module adds a wizard that, given a MIS report instance and an account +code range, finds accounts in that range which have journal entries posted +during the report’s period(s) but are not referenced by any KPI expression +of the report (including subreport KPIs). Each uncovered account is shown +with its period debit/credit/balance, with a direct drill-down to the +underlying journal items.

+

Table of contents

+ +
+

Configuration

+

No configuration is needed. The wizard is available to users in the +Accounting / Account User group.

+
+
+

Usage

+
    +
  1. Open a MIS Report Instance (Accounting > Reporting > MIS Reporting > +MIS Reports) and click the Check Account Coverage button, or go to +Accounting > Reporting > MIS Reporting > Account Coverage Check and +pick the report instance manually.
  2. +
  3. Enter the account code range to check, e.g. 100000 to 599999.
  4. +
  5. Optionally restrict the periods to check; leave empty to check every +period column defined on the report instance.
  6. +
  7. Click Check. Any account in the range that has postings in a period +but is not referenced by any KPI expression of the report is listed with +its debit, credit and balance for that period.
  8. +
  9. Click View Journal Items on a line to open the underlying journal +entries causing that account to appear.
  10. +
+
+

Note

+

The account range is compared as text (account.account.code), so it +is only reliable when the codes being compared have the same number of +digits (as is normally the case, e.g. 6-digit Spanish PGC codes). A range +like 7 to 12 would not behave as expected since "7" <= "12" +is false as a string comparison.

+
+
+

Note

+

Coverage means “referenced by any KPI expression of the report”, +including aggregate/rollup KPIs (e.g. a “Result for the year” line that +nets a whole P&L range like 6%,7% into a single equity figure). That +is intentional: if an account is correctly summed into such a KPI it does +not put the report out of balance, so it should not be reported as +uncovered even though it has no individual detail line of its own.

+
+
+

Note

+

Without a chart’s usual closing/opening entries, a balance-sheet +account’s balance keeps accumulating from postings dated before the +period being checked. To match how mis_builder itself computes a +balance-sheet KPI (“ending balance” mode), an uncovered account’s +debit/credit/balance are summed since the beginning of time for +balance-sheet accounts (asset/liability/equity), and since the start of +the fiscal year only for P&L accounts (income/expense), which do reset +every year. So a posting from a previous period can still make an +account show up as uncovered today.

+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

carlosdauden

+

This module is part of the OCA/mis-builder project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/mis_report_account_coverage_check/tests/__init__.py b/mis_report_account_coverage_check/tests/__init__.py new file mode 100644 index 000000000..b321026d7 --- /dev/null +++ b/mis_report_account_coverage_check/tests/__init__.py @@ -0,0 +1 @@ +from . import test_mis_report_account_coverage_check diff --git a/mis_report_account_coverage_check/tests/test_mis_report_account_coverage_check.py b/mis_report_account_coverage_check/tests/test_mis_report_account_coverage_check.py new file mode 100644 index 000000000..678a69313 --- /dev/null +++ b/mis_report_account_coverage_check/tests/test_mis_report_account_coverage_check.py @@ -0,0 +1,215 @@ +# Copyright 2026 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +import datetime + +from odoo import fields +from odoo.tests import common + + +class TestMisReportAccountCoverageCheck(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + # use a dedicated company so the test is not affected by any chart + # of accounts / demo postings that other installed modules may have + # set up on the default company + cls.company = cls.env["res.company"].create({"name": "Coverage Check Co"}) + type_ar = cls.env.ref("account.data_account_type_receivable") + type_in = cls.env.ref("account.data_account_type_revenue") + type_asset = cls.env.ref("account.data_account_type_current_assets") + cls.account_ar = cls.env["account.account"].create( + { + "company_id": cls.company.id, + "code": "400AR", + "name": "Receivable", + "user_type_id": type_ar.id, + "reconcile": True, + } + ) + cls.account_uncovered = cls.env["account.account"].create( + { + "company_id": cls.company.id, + "code": "500UN", + "name": "Uncovered account", + "user_type_id": type_in.id, + } + ) + cls.account_in = cls.env["account.account"].create( + { + "company_id": cls.company.id, + "code": "700IN", + "name": "Income", + "user_type_id": type_in.id, + } + ) + cls.account_out_of_range = cls.env["account.account"].create( + { + "company_id": cls.company.id, + "code": "900OU", + "name": "Out of range account", + "user_type_id": type_in.id, + } + ) + # balance-sheet account (no posting yet): used to check that, with + # no closing/opening entries, its balance keeps accumulating from + # before the period being checked + cls.account_bs_old = cls.env["account.account"].create( + { + "company_id": cls.company.id, + "code": "450OL", + "name": "Old balance-sheet account", + "user_type_id": type_asset.id, + } + ) + # P&L account (no posting yet): used to check that, unlike balance + # -sheet accounts, its balance resets every fiscal year + cls.account_pl_old = cls.env["account.account"].create( + { + "company_id": cls.company.id, + "code": "480PL", + "name": "Old P&L account", + "user_type_id": type_in.id, + } + ) + cls.journal = cls.env["account.journal"].create( + { + "company_id": cls.company.id, + "name": "Sale journal", + "code": "VEN", + "type": "sale", + } + ) + cls.date_from = datetime.date.today().replace(day=1) + next_month = cls.date_from.replace(day=28) + datetime.timedelta(days=4) + cls.date_to = next_month - datetime.timedelta(days=next_month.day) + # covered postings: only account_ar/account_in appear in the KPI expr + cls._create_move(cls.account_ar, cls.account_in, 100) + # uncovered-but-used posting, in range: must be detected + cls._create_move(cls.account_ar, cls.account_uncovered, 50) + # posting on an out-of-range account: must never be detected + cls._create_move(cls.account_ar, cls.account_out_of_range, 20) + + cls.report = cls.env["mis.report"].create({"name": "Test report"}) + cls.env["mis.report.kpi"].create( + { + "report_id": cls.report.id, + "name": "balance", + "description": "Balance", + "expression_ids": [(0, 0, {"name": "balp[400AR,700IN]"})], + } + ) + cls.instance = cls.env["mis.report.instance"].create( + { + "name": "Test instance", + "report_id": cls.report.id, + "company_id": cls.company.id, + "date_from": fields.Date.to_string(cls.date_from), + "date_to": fields.Date.to_string(cls.date_to), + "period_ids": [(0, 0, {"name": "Default"})], + } + ) + + @classmethod + def _create_move(cls, debit_account, credit_account, amount, date=None): + move = cls.env["account.move"].create( + { + "journal_id": cls.journal.id, + "date": fields.Date.to_string(date or cls.date_from), + "line_ids": [ + ( + 0, + 0, + {"name": "/", "debit": amount, "account_id": debit_account.id}, + ), + ( + 0, + 0, + { + "name": "/", + "credit": amount, + "account_id": credit_account.id, + }, + ), + ], + } + ) + move._post() + return move + + def _create_wizard(self): + return self.env["mis.report.account.coverage.check"].create( + { + "report_instance_id": self.instance.id, + "account_code_from": "400AR", + "account_code_to": "700IN", + } + ) + + def test_uncovered_account_detected(self): + wizard = self._create_wizard() + wizard.action_check() + self.assertEqual(wizard.state, "done") + self.assertEqual(len(wizard.line_ids), 1) + line = wizard.line_ids + self.assertEqual(line.account_id, self.account_uncovered) + self.assertEqual(line.debit, 0) + self.assertEqual(line.credit, 50) + self.assertEqual(line.balance, -50) + + def test_old_posting_on_balance_sheet_account_detected(self): + # without closing/opening entries, a balance-sheet account's balance + # keeps accumulating: a posting from a year before the period being + # checked must still surface the account as uncovered + old_date = self.date_from.replace(year=self.date_from.year - 1) + self._create_move(self.account_bs_old, self.account_ar, 40, date=old_date) + wizard = self._create_wizard() + wizard.action_check() + result_accounts = wizard.line_ids.mapped("account_id") + self.assertIn(self.account_bs_old, result_accounts) + line = wizard.line_ids.filtered( + lambda line_: line_.account_id == self.account_bs_old + ) + self.assertEqual(line.debit, 40) + self.assertEqual(line.balance, 40) + + def test_old_posting_on_pl_account_not_detected(self): + # unlike balance-sheet accounts, P&L accounts reset every fiscal + # year: a posting from the previous fiscal year must NOT make the + # account show up when checking the current period + old_date = self.date_from.replace(year=self.date_from.year - 1) + self._create_move(self.account_ar, self.account_pl_old, 40, date=old_date) + wizard = self._create_wizard() + wizard.action_check() + self.assertNotIn(self.account_pl_old, wizard.line_ids.mapped("account_id")) + + def test_covered_accounts_not_listed(self): + wizard = self._create_wizard() + wizard.action_check() + result_accounts = wizard.line_ids.mapped("account_id") + self.assertNotIn(self.account_ar, result_accounts) + self.assertNotIn(self.account_in, result_accounts) + + def test_out_of_range_account_not_listed(self): + wizard = self._create_wizard() + wizard.action_check() + self.assertNotIn( + self.account_out_of_range, wizard.line_ids.mapped("account_id") + ) + + def test_view_move_lines_action_domain(self): + wizard = self._create_wizard() + wizard.action_check() + line = wizard.line_ids + action = line.action_view_move_lines() + move_lines = self.env[action["res_model"]].search(action["domain"]) + self.assertTrue(move_lines) + self.assertEqual( + set(move_lines.mapped("account_id.id")), {self.account_uncovered.id} + ) + + def test_action_back_resets_state(self): + wizard = self._create_wizard() + wizard.action_check() + wizard.action_back() + self.assertEqual(wizard.state, "init") + self.assertFalse(wizard.line_ids) diff --git a/mis_report_account_coverage_check/views/mis_report_instance_views.xml b/mis_report_account_coverage_check/views/mis_report_instance_views.xml new file mode 100644 index 000000000..4ad3af495 --- /dev/null +++ b/mis_report_account_coverage_check/views/mis_report_instance_views.xml @@ -0,0 +1,19 @@ + + + + mis.report.instance.form.coverage.check + mis.report.instance + + +
+
+
+
+
diff --git a/mis_report_account_coverage_check/wizard/__init__.py b/mis_report_account_coverage_check/wizard/__init__.py new file mode 100644 index 000000000..da4c51df8 --- /dev/null +++ b/mis_report_account_coverage_check/wizard/__init__.py @@ -0,0 +1,2 @@ +from . import mis_report_account_coverage_check +from . import mis_report_account_coverage_check_line diff --git a/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check.py b/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check.py new file mode 100644 index 000000000..d2e4ae273 --- /dev/null +++ b/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check.py @@ -0,0 +1,151 @@ +# Copyright 2026 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class MisReportAccountCoverageCheck(models.TransientModel): + _name = "mis.report.account.coverage.check" + _description = "Check accounts used in postings but not covered by a MIS report" + + state = fields.Selection( + selection=[("init", "Configuration"), ("done", "Results")], + string="Status", + readonly=True, + default="init", + ) + report_instance_id = fields.Many2one( + comodel_name="mis.report.instance", + string="MIS Report Instance", + required=True, + ondelete="cascade", + ) + period_ids = fields.Many2many( + comodel_name="mis.report.instance.period", + relation="mis_report_account_coverage_check_period_rel", + string="Periods to check", + domain="[('report_instance_id', '=', report_instance_id)]", + help="Leave empty to check all periods of the instance.", + ) + account_code_from = fields.Char(string="Account code from", required=True) + account_code_to = fields.Char(string="Account code to", required=True) + line_ids = fields.One2many( + comodel_name="mis.report.account.coverage.check.line", + inverse_name="check_id", + string="Uncovered accounts", + ) + + @api.onchange("report_instance_id") + def _onchange_report_instance_id(self): + self.period_ids = self.report_instance_id.period_ids + + def _get_account_range_domain(self): + self.ensure_one() + return [ + ("code", ">=", self.account_code_from), + ("code", "<=", self.account_code_to), + ] + + def _get_covered_account_ids(self, aep): + """Account ids referenced by at least one KPI expression of the + report template, including subreport KPIs (``all_kpi_ids``, unlike + the core ``get_kpis_by_account_id`` which only looks at ``kpi_ids``). + + Every KPI counts, including aggregate/rollup ones (e.g. a "Result + for the year" line that nets the whole P&L with a ``6%,7%`` wildcard + into a single equity figure): if an account is correctly summed into + such a KPI, it does not put the report out of balance, so it must + not be reported as uncovered even though it has no individual detail + line of its own. + """ + self.ensure_one() + report = self.report_instance_id.report_id + covered_ids = set() + for kpi in report.all_kpi_ids: + for expression in kpi.expression_ids: + if expression.name: + covered_ids.update(aep.get_account_ids_for_expr(expression.name)) + return covered_ids + + def _reopen(self): + self.ensure_one() + return { + "type": "ir.actions.act_window", + "res_model": self._name, + "res_id": self.id, + "view_mode": "form", + "target": "new", + } + + def action_check(self): + self.ensure_one() + self.line_ids.unlink() + instance = self.report_instance_id + report = instance.report_id + account_model = self.env[report.account_model or "account.account"] + aml_model = self.env[report.sudo().move_lines_source.model] + aep = report._prepare_aep(instance.query_company_ids, instance.currency_id) + + range_accounts = account_model.search( + self._get_account_range_domain() + + [("company_id", "in", instance.query_company_ids.ids)] + ) + covered_ids = self._get_covered_account_ids(aep) + uncovered_accounts = range_accounts.filtered( + lambda account: account.id not in covered_ids + ) + + line_vals = [] + if uncovered_accounts: + periods = self.period_ids or instance.period_ids + for period in periods: + if not (period.date_from and period.date_to): + continue + # MODE_END ("ending balance", what every balance-sheet KPI + # expression uses): balance-sheet accounts (asset/liability + # /equity, "include_initial_balance") are summed since the + # beginning of time, since without formal closing/opening + # entries their balance keeps accumulating across fiscal + # years; P&L accounts are summed since the start of the + # fiscal year only, since those reset every year. A plain + # ("date", ">=", period.date_from) window would miss + # balance-sheet accounts whose contributing postings are + # older than the period being checked. + domain = [ + ("account_id", "in", uncovered_accounts.ids), + ("company_id", "in", instance.query_company_ids.ids), + ] + domain += aep.get_aml_domain_for_dates( + period.date_from, period.date_to, aep.MODE_END + ) + domain += period._get_additional_move_line_filter() + groups = aml_model.read_group( + domain, + ["account_id", "debit", "credit", "balance"], + ["account_id"], + ) + for group in groups: + if not group["account_id"]: + continue + line_vals.append( + ( + 0, + 0, + { + "period_id": period.id, + "account_id": group["account_id"][0], + "debit": group["debit"], + "credit": group["credit"], + "balance": group["balance"], + "move_line_count": group["account_id_count"], + }, + ) + ) + self.line_ids = line_vals + self.state = "done" + return self._reopen() + + def action_back(self): + self.ensure_one() + self.line_ids.unlink() + self.state = "init" + return self._reopen() diff --git a/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check_line.py b/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check_line.py new file mode 100644 index 000000000..fda6fd90b --- /dev/null +++ b/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check_line.py @@ -0,0 +1,58 @@ +# Copyright 2026 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + +from odoo.addons.mis_builder.models.aep import AccountingExpressionProcessor as AEP + + +class MisReportAccountCoverageCheckLine(models.TransientModel): + _name = "mis.report.account.coverage.check.line" + _description = "Uncovered account found during a MIS report coverage check" + + check_id = fields.Many2one( + comodel_name="mis.report.account.coverage.check", + required=True, + ondelete="cascade", + ) + period_id = fields.Many2one( + comodel_name="mis.report.instance.period", string="Period", required=True + ) + account_id = fields.Many2one( + comodel_name="account.account", string="Account", required=True + ) + account_code = fields.Char(related="account_id.code") + account_name = fields.Char(related="account_id.name") + currency_id = fields.Many2one(related="account_id.company_id.currency_id") + debit = fields.Monetary(currency_field="currency_id") + credit = fields.Monetary(currency_field="currency_id") + balance = fields.Monetary(currency_field="currency_id") + move_line_count = fields.Integer(string="Journal Items") + + def action_view_move_lines(self): + self.ensure_one() + instance = self.check_id.report_instance_id + report = instance.report_id + aml_model_name = report.sudo().move_lines_source.model + # bare AEP just to reuse get_aml_domain_for_dates (no KPI expression + # parsing needed here), same pattern as mis.report.instance.drilldown() + aep = AEP( + instance.query_company_ids, instance.currency_id, report.account_model + ) + domain = [ + ("account_id", "=", self.account_id.id), + ("company_id", "in", instance.query_company_ids.ids), + ] + domain += aep.get_aml_domain_for_dates( + self.period_id.date_from, self.period_id.date_to, aep.MODE_END + ) + domain += self.period_id._get_additional_move_line_filter() + return { + "name": self.account_id.display_name, + "type": "ir.actions.act_window", + "res_model": aml_model_name, + "domain": domain, + "views": [[False, "list"], [False, "form"]], + "view_mode": "list", + "target": "current", + "context": {"active_test": False}, + } diff --git a/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check_views.xml b/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check_views.xml new file mode 100644 index 000000000..8c2e06eee --- /dev/null +++ b/mis_report_account_coverage_check/wizard/mis_report_account_coverage_check_views.xml @@ -0,0 +1,79 @@ + + + + mis.report.account.coverage.check.form + mis.report.account.coverage.check + +
+
+ +
+ + + + + + + + + + + + + + + + +