diff --git a/README.md b/README.md index 83e6306c9ae6..0fa9f5daba7e 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ addon | version | maintainers | summary [account_financial_report](account_financial_report/) | 17.0.1.4.0 | | OCA Financial Reports [account_tax_balance](account_tax_balance/) | 17.0.1.0.0 | | Compute tax balances based on date range [mis_builder_cash_flow](mis_builder_cash_flow/) | 17.0.1.0.0 | [![jjscarafia](https://github.com/jjscarafia.png?size=30px)](https://github.com/jjscarafia) | MIS Builder Cash Flow +[mis_template_financial_report](mis_template_financial_report/) | 17.0.1.0.0 | [![hbrunn](https://github.com/hbrunn.png?size=30px)](https://github.com/hbrunn) | Profit & Loss / Balance sheet MIS templates [partner_statement](partner_statement/) | 17.0.1.0.0 | [![MiquelRForgeFlow](https://github.com/MiquelRForgeFlow.png?size=30px)](https://github.com/MiquelRForgeFlow) | OCA Financial Reports [//]: # (end addons) diff --git a/mis_template_financial_report/README.rst b/mis_template_financial_report/README.rst new file mode 100644 index 000000000000..1034b6675909 --- /dev/null +++ b/mis_template_financial_report/README.rst @@ -0,0 +1,111 @@ +=========================================== +Profit & Loss / Balance sheet MIS templates +=========================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:43a58797d5d60f19a2ce7f6e20a38f052a0d5d7c3ebe2ef50fa88e9899b2069e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/licence-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%2Faccount--financial--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-reporting/tree/17.0/mis_template_financial_report + :alt: OCA/account-financial-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-reporting-17-0/account-financial-reporting-17-0-mis_template_financial_report + :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/account-financial-reporting&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This addon provides MIS builder templates to generate generic Profit & +Loss and Balance Sheet reports. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To render the reports from this module horizontally in two columns on +the same page, check the Horizontal checkbox on the Layout tab of the +report. This checkbox is only available for reports that support the +horizontal mode. + +Usage +===== + +Select one of the Profit & Loss or Balance Sheet templates in a new MIS +report. + +For details, refer to the `MIS Builder +documentation `__ + +Known issues / Roadmap +====================== + +- support horizontal mode for xslx export +- split off all code to mis_builder_horizontal and only keep the KPI + definitions here + +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 +------- + +* Hunki Enterprises BV + +Contributors +------------ + +- Holger Brunn + (https://hunki-enterprises.nl) +- Stefan Rijnhart (https://opener.amsterdam) + +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-hbrunn| image:: https://github.com/hbrunn.png?size=40px + :target: https://github.com/hbrunn + :alt: hbrunn + +Current `maintainer `__: + +|maintainer-hbrunn| + +This module is part of the `OCA/account-financial-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mis_template_financial_report/__init__.py b/mis_template_financial_report/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/mis_template_financial_report/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mis_template_financial_report/__manifest__.py b/mis_template_financial_report/__manifest__.py new file mode 100644 index 000000000000..ad37bb3cccf0 --- /dev/null +++ b/mis_template_financial_report/__manifest__.py @@ -0,0 +1,31 @@ +# Copyright 2020 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Profit & Loss / Balance sheet MIS templates", + "version": "17.0.1.0.0", + "license": "AGPL-3", + "author": "Hunki Enterprises BV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-financial-reporting", + "category": "Localization", + "depends": ["mis_builder"], + "data": [ + "data/mis_report_style.xml", + "data/mis_report.xml", + "data/mis_report_kpi.xml", + "data/mis_report_subreport.xml", + "views/mis_report_instance_views.xml", + "views/mis_report_kpi_views.xml", + "views/templates.xml", + ], + "assets": { + "web.assets_backend": [ + "mis_template_financial_report/static/src/components/mis_report_widget.xml", + "mis_template_financial_report/static/src/components/mis_report_widget.css", + ], + "web.report_assets_common": [ + "mis_template_financial_report/static/src/css/report.css" + ], + }, + "maintainers": ["hbrunn"], +} diff --git a/mis_template_financial_report/data/mis_report.xml b/mis_template_financial_report/data/mis_report.xml new file mode 100644 index 000000000000..f1ee88b2954e --- /dev/null +++ b/mis_template_financial_report/data/mis_report.xml @@ -0,0 +1,10 @@ + + + Profit & Loss + + + + Balance Sheet + + + diff --git a/mis_template_financial_report/data/mis_report_kpi.xml b/mis_template_financial_report/data/mis_report_kpi.xml new file mode 100644 index 000000000000..1ec8050ad5cc --- /dev/null +++ b/mis_template_financial_report/data/mis_report_kpi.xml @@ -0,0 +1,101 @@ + + + loss + Loss + balp[('account_type', 'like', 'expense%')][] + true + + + num + diff + sum + 100 + + + + profit + Profit + -balp['|', ('account_type', 'like', 'income%'), ('account_type', 'like', 'equity_unaffected')][] + true + + + num + diff + sum + 0 + + + + + 3 + pl_to_report + Profit or loss to report + profit - loss + false + + num + diff + none + 101 + + + + 8 + liability_header + Liability + liability + subreport_pl.pl_to_report + false + + num + none + none + 100 + + + + 7 + pl + Profit / Loss + subreport_pl.pl_to_report + false + + num + pct + sum + 102 + + + + 5 + liability + Liabilities + -bale['|', ('account_type', 'like', 'liability%'), ('account_type', '=', 'equity')][] + true + + + num + diff + sum + 101 + + + + 4 + assets + Assets + bale[('account_type', 'like', 'asset%')][] + true + + + num + diff + sum + 0 + + + + diff --git a/mis_template_financial_report/data/mis_report_style.xml b/mis_template_financial_report/data/mis_report_style.xml new file mode 100644 index 000000000000..3ba409f04f06 --- /dev/null +++ b/mis_template_financial_report/data/mis_report_style.xml @@ -0,0 +1,31 @@ + + + PL/BS default + false + 2 + false + true + + + PL/BS header + false + bold + + + PL/BS double indented details + false + 2 + + + PL/BS indented header + false + bold + false + 1 + + + PL/BS details + false + 1 + + diff --git a/mis_template_financial_report/data/mis_report_subreport.xml b/mis_template_financial_report/data/mis_report_subreport.xml new file mode 100644 index 000000000000..dc84876856d8 --- /dev/null +++ b/mis_template_financial_report/data/mis_report_subreport.xml @@ -0,0 +1,7 @@ + + + + + subreport_pl + + diff --git a/mis_template_financial_report/i18n/es.po b/mis_template_financial_report/i18n/es.po new file mode 100644 index 000000000000..9e1d60c287f2 --- /dev/null +++ b/mis_template_financial_report/i18n/es.po @@ -0,0 +1,108 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_template_financial_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-05-04 12:05+0000\n" +"Last-Translator: Víctor Martínez \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__allow_horizontal +msgid "Allow Horizontal" +msgstr "Permitir horizontal" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_assets +msgid "Assets" +msgstr "Activos" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_bs +msgid "Balance Sheet" +msgstr "Balance de situación" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__horizontal +msgid "Horizontal" +msgstr "Horizontal" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability +msgid "Liabilities" +msgstr "Pasivos" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_total +msgid "Liability" +msgstr "Pasivo" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_loss +msgid "Loss" +msgstr "Pérdidas" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_instance +msgid "MIS Report Instance" +msgstr "Instancia de informe MIS" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_kpi +msgid "MIS Report KPI" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_profit +msgid "Profit" +msgstr "Beneficio" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_pl +msgid "Profit & Loss" +msgstr "Ganancias y Pérdidas" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_pl_subreport +msgid "Profit / Loss" +msgstr "Ganancias / Pérdidas" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_pl_to_report +msgid "Profit or loss to report" +msgstr "Ganancias o pérdidas a reportar" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "Split After" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,help:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "" +"Split the table after this KPI. This allows displaying KPIs next to each " +"other in non-comparison mode" +msgstr "" + +#. module: mis_template_financial_report +#: model_terms:ir.ui.view,arch_db:mis_template_financial_report.mis_report_view_kpi_form +msgid "Splitting" +msgstr "" + +#~ msgid "Display Name" +#~ msgstr "Nombre mostrado" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificación en" diff --git a/mis_template_financial_report/i18n/fi.po b/mis_template_financial_report/i18n/fi.po new file mode 100644 index 000000000000..5e7c860460b7 --- /dev/null +++ b/mis_template_financial_report/i18n/fi.po @@ -0,0 +1,97 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_template_financial_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__allow_horizontal +msgid "Allow Horizontal" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_assets +msgid "Assets" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_bs +msgid "Balance Sheet" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__horizontal +msgid "Horizontal" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability +msgid "Liabilities" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_total +msgid "Liability" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_loss +msgid "Loss" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_instance +msgid "MIS Report Instance" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_kpi +msgid "MIS Report KPI" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_profit +msgid "Profit" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_pl +msgid "Profit & Loss" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_pl_subreport +msgid "Profit / Loss" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_pl_to_report +msgid "Profit or loss to report" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "Split After" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,help:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "" +"Split the table after this KPI. This allows displaying KPIs next to each " +"other in non-comparison mode" +msgstr "" + +#. module: mis_template_financial_report +#: model_terms:ir.ui.view,arch_db:mis_template_financial_report.mis_report_view_kpi_form +msgid "Splitting" +msgstr "" diff --git a/mis_template_financial_report/i18n/fr.po b/mis_template_financial_report/i18n/fr.po new file mode 100644 index 000000000000..d8bbf02d56fe --- /dev/null +++ b/mis_template_financial_report/i18n/fr.po @@ -0,0 +1,108 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_template_financial_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-02-11 15:16+0000\n" +"Last-Translator: Abdourahmane Wone \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__allow_horizontal +msgid "Allow Horizontal" +msgstr "Autoriser l'horizontale" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_assets +msgid "Assets" +msgstr "Actifs" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_bs +msgid "Balance Sheet" +msgstr "Bilan" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__horizontal +msgid "Horizontal" +msgstr "Horizontal" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability +msgid "Liabilities" +msgstr "Passifs" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_total +msgid "Liability" +msgstr "Passif" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_loss +msgid "Loss" +msgstr "Perte" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_instance +msgid "MIS Report Instance" +msgstr "Instance de rapport SIG" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_kpi +msgid "MIS Report KPI" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_profit +msgid "Profit" +msgstr "Profit" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_pl +msgid "Profit & Loss" +msgstr "Perte & profit" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_pl_subreport +msgid "Profit / Loss" +msgstr "Profit / Perte" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_pl_to_report +msgid "Profit or loss to report" +msgstr "Bénéfice ou perte à déclarer" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "Split After" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,help:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "" +"Split the table after this KPI. This allows displaying KPIs next to each " +"other in non-comparison mode" +msgstr "" + +#. module: mis_template_financial_report +#: model_terms:ir.ui.view,arch_db:mis_template_financial_report.mis_report_view_kpi_form +msgid "Splitting" +msgstr "" + +#~ msgid "Display Name" +#~ msgstr "Afficher un nom" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification le" diff --git a/mis_template_financial_report/i18n/it.po b/mis_template_financial_report/i18n/it.po new file mode 100644 index 000000000000..32234dbbfbb5 --- /dev/null +++ b/mis_template_financial_report/i18n/it.po @@ -0,0 +1,101 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_template_financial_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-06-15 22:41+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__allow_horizontal +msgid "Allow Horizontal" +msgstr "Consenti orizzontale" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_assets +msgid "Assets" +msgstr "Cespiti" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_bs +msgid "Balance Sheet" +msgstr "Stato patrimoniale" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__horizontal +msgid "Horizontal" +msgstr "Orizzontale" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability +msgid "Liabilities" +msgstr "Passività" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_total +msgid "Liability" +msgstr "Passivo" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_loss +msgid "Loss" +msgstr "Minusvalenza" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_instance +msgid "MIS Report Instance" +msgstr "Istanza MIS Report" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_kpi +msgid "MIS Report KPI" +msgstr "KPI MIS Report" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_profit +msgid "Profit" +msgstr "Ricavo" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_pl +msgid "Profit & Loss" +msgstr "Conto economico" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_pl_subreport +msgid "Profit / Loss" +msgstr "Ricavo / perdita" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_pl_to_report +msgid "Profit or loss to report" +msgstr "Ricavo o perdita da rendicontare" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "Split After" +msgstr "Dividi dopo" + +#. module: mis_template_financial_report +#: model:ir.model.fields,help:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "" +"Split the table after this KPI. This allows displaying KPIs next to each " +"other in non-comparison mode" +msgstr "" +"Dividere la tabella dopo questo KPI. Questo consente la visualizzazione dei " +"KPI uno vicino all'altro in modo non comparativo" + +#. module: mis_template_financial_report +#: model_terms:ir.ui.view,arch_db:mis_template_financial_report.mis_report_view_kpi_form +msgid "Splitting" +msgstr "Divisione" diff --git a/mis_template_financial_report/i18n/mis_template_financial_report.pot b/mis_template_financial_report/i18n/mis_template_financial_report.pot new file mode 100644 index 000000000000..d62ba043e71d --- /dev/null +++ b/mis_template_financial_report/i18n/mis_template_financial_report.pot @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_template_financial_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \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_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__allow_horizontal +msgid "Allow Horizontal" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_assets +msgid "Assets" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_bs +msgid "Balance Sheet" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__horizontal +msgid "Horizontal" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability +msgid "Liabilities" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_total +msgid "Liability" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_loss +msgid "Loss" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_instance +msgid "MIS Report Instance" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_kpi +msgid "MIS Report KPI" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_profit +msgid "Profit" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_pl +msgid "Profit & Loss" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_pl_subreport +msgid "Profit / Loss" +msgstr "" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_pl_to_report +msgid "Profit or loss to report" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "Split After" +msgstr "" + +#. module: mis_template_financial_report +#: model:ir.model.fields,help:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "" +"Split the table after this KPI. This allows displaying KPIs next to each " +"other in non-comparison mode" +msgstr "" + +#. module: mis_template_financial_report +#: model_terms:ir.ui.view,arch_db:mis_template_financial_report.mis_report_view_kpi_form +msgid "Splitting" +msgstr "" diff --git a/mis_template_financial_report/i18n/pt.po b/mis_template_financial_report/i18n/pt.po new file mode 100644 index 000000000000..efa766c88d2d --- /dev/null +++ b/mis_template_financial_report/i18n/pt.po @@ -0,0 +1,101 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mis_template_financial_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-08-01 22:41+0000\n" +"Last-Translator: Peter Romão \n" +"Language-Team: none\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__allow_horizontal +msgid "Allow Horizontal" +msgstr "Permitir Horizontal" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_assets +msgid "Assets" +msgstr "Ativos" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_bs +msgid "Balance Sheet" +msgstr "Balanço" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_instance__horizontal +msgid "Horizontal" +msgstr "Horizontal" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability +msgid "Liabilities" +msgstr "Passivos" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_total +msgid "Liability" +msgstr "Passivo" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_loss +msgid "Loss" +msgstr "Perdas" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_instance +msgid "MIS Report Instance" +msgstr "Instância de Relatório MIS" + +#. module: mis_template_financial_report +#: model:ir.model,name:mis_template_financial_report.model_mis_report_kpi +msgid "MIS Report KPI" +msgstr "KPI do relatório MIS" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_profit +msgid "Profit" +msgstr "Lucros" + +#. module: mis_template_financial_report +#: model:mis.report,name:mis_template_financial_report.report_pl +msgid "Profit & Loss" +msgstr "Demonstração de Resultados" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_liability_pl_subreport +msgid "Profit / Loss" +msgstr "Lucros / Perdas" + +#. module: mis_template_financial_report +#: model:mis.report.kpi,description:mis_template_financial_report.kpi_pl_to_report +msgid "Profit or loss to report" +msgstr "Lucro ou prejuízo a relatar" + +#. module: mis_template_financial_report +#: model:ir.model.fields,field_description:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "Split After" +msgstr "Dividir Depois" + +#. module: mis_template_financial_report +#: model:ir.model.fields,help:mis_template_financial_report.field_mis_report_kpi__split_after +msgid "" +"Split the table after this KPI. This allows displaying KPIs next to each " +"other in non-comparison mode" +msgstr "" +"Dividir a tabela depois deste KPI. Isto permite exibir KPIs lado a lado no " +"modo não comparativo" + +#. module: mis_template_financial_report +#: model_terms:ir.ui.view,arch_db:mis_template_financial_report.mis_report_view_kpi_form +msgid "Splitting" +msgstr "Dividindo" diff --git a/mis_template_financial_report/models/__init__.py b/mis_template_financial_report/models/__init__.py new file mode 100644 index 000000000000..6aa7620dc02b --- /dev/null +++ b/mis_template_financial_report/models/__init__.py @@ -0,0 +1,2 @@ +from . import mis_report_instance +from . import mis_report_kpi diff --git a/mis_template_financial_report/models/mis_report_instance.py b/mis_template_financial_report/models/mis_report_instance.py new file mode 100644 index 000000000000..a688b3794d45 --- /dev/null +++ b/mis_template_financial_report/models/mis_report_instance.py @@ -0,0 +1,53 @@ +# Copyright 2020 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +import copy +from collections import OrderedDict + +from odoo import api, fields, models + + +class MisReportInstance(models.Model): + _inherit = "mis.report.instance" + + allow_horizontal = fields.Boolean(compute="_compute_allow_horizontal") + horizontal = fields.Boolean() + + @api.depends("report_id") + def _compute_allow_horizontal(self): + """Indicate that the instance supports horizontal rendering.""" + for instance in self: + instance.allow_horizontal = any( + instance.mapped("report_id.kpi_ids.split_after") + ) + + def compute(self): + if not self.horizontal: + return super().compute() + + full_matrix = self._compute_matrix() + + matrices = self._split_matrix(full_matrix) + + result = full_matrix.as_dict() + result["split_matrices"] = [extra_matrix.as_dict() for extra_matrix in matrices] + + return result + + def _split_matrix(self, original_matrix): + """Split a matrix according to the split_after flag in the kpis used""" + result = [] + + def clone_matrix(): + clone = copy.copy(original_matrix) + clone._kpi_rows = OrderedDict() + result.append(clone) + return clone + + current = clone_matrix() + + for kpi in original_matrix._kpi_rows: + current._kpi_rows[kpi] = original_matrix._kpi_rows[kpi] + if kpi.split_after: + current = clone_matrix() + + return result diff --git a/mis_template_financial_report/models/mis_report_kpi.py b/mis_template_financial_report/models/mis_report_kpi.py new file mode 100644 index 000000000000..fcc466390c8a --- /dev/null +++ b/mis_template_financial_report/models/mis_report_kpi.py @@ -0,0 +1,12 @@ +# Copyright 2023 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class MisReportKpi(models.Model): + _inherit = "mis.report.kpi" + + split_after = fields.Boolean( + help="Split the table after this KPI. This allows displaying KPIs next to each " + "other in non-comparison mode", + ) diff --git a/mis_template_financial_report/pyproject.toml b/mis_template_financial_report/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/mis_template_financial_report/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mis_template_financial_report/readme/CONFIGURE.md b/mis_template_financial_report/readme/CONFIGURE.md new file mode 100644 index 000000000000..6b9463fa9372 --- /dev/null +++ b/mis_template_financial_report/readme/CONFIGURE.md @@ -0,0 +1,4 @@ +To render the reports from this module horizontally in two columns on +the same page, check the Horizontal checkbox on the Layout tab of the +report. This checkbox is only available for reports that support the +horizontal mode. diff --git a/mis_template_financial_report/readme/CONTRIBUTORS.md b/mis_template_financial_report/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..02b9343c39cd --- /dev/null +++ b/mis_template_financial_report/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Holger Brunn \<\> + () +- Stefan Rijnhart \<\> + () diff --git a/mis_template_financial_report/readme/DESCRIPTION.md b/mis_template_financial_report/readme/DESCRIPTION.md new file mode 100644 index 000000000000..fdb5d9b84986 --- /dev/null +++ b/mis_template_financial_report/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This addon provides MIS builder templates to generate generic Profit & +Loss and Balance Sheet reports. diff --git a/mis_template_financial_report/readme/ROADMAP.md b/mis_template_financial_report/readme/ROADMAP.md new file mode 100644 index 000000000000..9529f2aab9b8 --- /dev/null +++ b/mis_template_financial_report/readme/ROADMAP.md @@ -0,0 +1,3 @@ +- support horizontal mode for xslx export +- split off all code to mis_builder_horizontal and only keep the KPI + definitions here diff --git a/mis_template_financial_report/readme/USAGE.md b/mis_template_financial_report/readme/USAGE.md new file mode 100644 index 000000000000..262a1cd10d1a --- /dev/null +++ b/mis_template_financial_report/readme/USAGE.md @@ -0,0 +1,5 @@ +Select one of the Profit & Loss or Balance Sheet templates in a new MIS +report. + +For details, refer to the [MIS Builder +documentation](https://github.com/OCA/mis-builder/tree/14.0/mis_builder#usage) diff --git a/mis_template_financial_report/readme/newsfragments/.gitkeep b/mis_template_financial_report/readme/newsfragments/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/mis_template_financial_report/static/description/icon.png b/mis_template_financial_report/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/mis_template_financial_report/static/description/icon.png differ diff --git a/mis_template_financial_report/static/description/index.html b/mis_template_financial_report/static/description/index.html new file mode 100644 index 000000000000..02bf1fcb6292 --- /dev/null +++ b/mis_template_financial_report/static/description/index.html @@ -0,0 +1,453 @@ + + + + + +Profit & Loss / Balance sheet MIS templates + + + +
+

Profit & Loss / Balance sheet MIS templates

+ + +

Beta License: AGPL-3 OCA/account-financial-reporting Translate me on Weblate Try me on Runboat

+

This addon provides MIS builder templates to generate generic Profit & +Loss and Balance Sheet reports.

+

Table of contents

+ +
+

Configuration

+

To render the reports from this module horizontally in two columns on +the same page, check the Horizontal checkbox on the Layout tab of the +report. This checkbox is only available for reports that support the +horizontal mode.

+
+
+

Usage

+

Select one of the Profit & Loss or Balance Sheet templates in a new MIS +report.

+

For details, refer to the MIS Builder +documentation

+
+
+

Known issues / Roadmap

+
    +
  • support horizontal mode for xslx export
  • +
  • split off all code to mis_builder_horizontal and only keep the KPI +definitions here
  • +
+
+
+

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

+
    +
  • Hunki Enterprises BV
  • +
+
+ +
+

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:

+

hbrunn

+

This module is part of the OCA/account-financial-reporting project on GitHub.

+

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

+
+
+
+ + diff --git a/mis_template_financial_report/static/src/components/mis_report_widget.css b/mis_template_financial_report/static/src/components/mis_report_widget.css new file mode 100644 index 000000000000..39b34a555060 --- /dev/null +++ b/mis_template_financial_report/static/src/components/mis_report_widget.css @@ -0,0 +1,11 @@ +.oe_mis_builder_content.horizontal { + display: flex; + flex-wrap: wrap; + gap: 5px; +} +.oe_mis_builder_content.horizontal .oe_mis_builder_cp { + width: 100%; +} +.oe_mis_builder_content.horizontal .o_list_renderer { + flex-grow: 1; +} diff --git a/mis_template_financial_report/static/src/components/mis_report_widget.xml b/mis_template_financial_report/static/src/components/mis_report_widget.xml new file mode 100644 index 000000000000..7a0f9ed237d5 --- /dev/null +++ b/mis_template_financial_report/static/src/components/mis_report_widget.xml @@ -0,0 +1,31 @@ + + + + + + {{state.mis_report_data.split_matrices and 'horizontal'}} + + + state.mis_report_data.split_matrices or [state.mis_report_data] + matrix + matrix_index + + + + matrix.header + + + matrix.body + + + diff --git a/mis_template_financial_report/static/src/css/report.css b/mis_template_financial_report/static/src/css/report.css new file mode 100644 index 000000000000..ee8f94b9225e --- /dev/null +++ b/mis_template_financial_report/static/src/css/report.css @@ -0,0 +1,11 @@ +div.mis_builder_horizontal_container { + display: table; + width: 100%; + border-spacing: 5px; +} +div.mis_builder_horizontal_row { + display: table-row; +} +div.mis_builder_horizontal_cell { + display: table-cell; +} diff --git a/mis_template_financial_report/tests/__init__.py b/mis_template_financial_report/tests/__init__.py new file mode 100644 index 000000000000..b7acc9700324 --- /dev/null +++ b/mis_template_financial_report/tests/__init__.py @@ -0,0 +1 @@ +from . import test_mis_template_financial_report diff --git a/mis_template_financial_report/tests/test_mis_template_financial_report.py b/mis_template_financial_report/tests/test_mis_template_financial_report.py new file mode 100644 index 000000000000..5b9f731e9f50 --- /dev/null +++ b/mis_template_financial_report/tests/test_mis_template_financial_report.py @@ -0,0 +1,18 @@ +# Copyright 2020 Hunki Enterprises BV +# Copyright 2021 Opener B.V. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase + + +class TestMisTemplateFinancialReport(TransactionCase): + def test_mis_template_financial_report(self): + instance = self.env["mis.report.instance"].create( + { + "name": "Balance Sheet", + "report_id": self.env.ref("mis_template_financial_report.report_bs").id, + } + ) + self.assertTrue(instance.allow_horizontal) + instance.horizontal = True + result_dict = instance.compute() + self.assertEqual(len(result_dict.get("split_matrices", [])), 2) diff --git a/mis_template_financial_report/views/mis_report_instance_views.xml b/mis_template_financial_report/views/mis_report_instance_views.xml new file mode 100644 index 000000000000..61cec9467337 --- /dev/null +++ b/mis_template_financial_report/views/mis_report_instance_views.xml @@ -0,0 +1,14 @@ + + + + Add horizontal option to MIS report instance form + mis.report.instance + + + + + + + + + diff --git a/mis_template_financial_report/views/mis_report_kpi_views.xml b/mis_template_financial_report/views/mis_report_kpi_views.xml new file mode 100644 index 000000000000..6b85ae064509 --- /dev/null +++ b/mis_template_financial_report/views/mis_report_kpi_views.xml @@ -0,0 +1,14 @@ + + + + mis.report.kpi + + + + + + + + + + diff --git a/mis_template_financial_report/views/templates.xml b/mis_template_financial_report/views/templates.xml new file mode 100644 index 000000000000..0e83276ac22b --- /dev/null +++ b/mis_template_financial_report/views/templates.xml @@ -0,0 +1,26 @@ + + + diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index ec5f50169103..2f4ce254af47 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,10 +1,11 @@ [project] name = "odoo-addons-oca-account-financial-reporting" -version = "17.0.20240930.0" +version = "17.0.20241115.0" dependencies = [ "odoo-addon-account_financial_report>=17.0dev,<17.1dev", "odoo-addon-account_tax_balance>=17.0dev,<17.1dev", "odoo-addon-mis_builder_cash_flow>=17.0dev,<17.1dev", + "odoo-addon-mis_template_financial_report>=17.0dev,<17.1dev", "odoo-addon-partner_statement>=17.0dev,<17.1dev", ] classifiers=[