From d3f7e0dbc8032c2a229afd9be7c7875d2d80c325 Mon Sep 17 00:00:00 2001 From: TennyMKT Date: Mon, 11 Mar 2024 16:38:39 +0100 Subject: [PATCH] [FIX] l10n_it_financial_statement: tolta _get_xlsx_name e altre migliorie --- l10n_it_financial_statement_eu/README.rst | 4 +- .../__manifest__.py | 1 - l10n_it_financial_statement_eu/i18n/it.po | 22 +- .../i18n/l10n_it_financial_statement_eu.pot | 17 +- .../migrations/16.0.1.0.0/pre-migrate.py | 9 +- .../models/financial_statement_eu.py | 17 +- l10n_it_financial_statement_eu/pyproject.toml | 3 + .../report/financial_statement_eu_report.py | 8 +- .../static/description/index.html | 1311 +++++++++++------ .../static/src/js/client_action.esm.js | 17 +- .../static/src/js/report.esm.js | 73 - .../static/src/xml/report.xml | 4 +- .../tests/test_financial_statement_eu.py | 2 +- .../wizard/financial_statement_eu_wizard.py | 4 +- .../wizard/financial_statement_eu_wizard.xml | 5 +- 15 files changed, 888 insertions(+), 609 deletions(-) create mode 100644 l10n_it_financial_statement_eu/pyproject.toml delete mode 100644 l10n_it_financial_statement_eu/static/src/js/report.esm.js diff --git a/l10n_it_financial_statement_eu/README.rst b/l10n_it_financial_statement_eu/README.rst index 2897f64cfd4f..badd9c499f90 100644 --- a/l10n_it_financial_statement_eu/README.rst +++ b/l10n_it_financial_statement_eu/README.rst @@ -2,7 +2,7 @@ ITA - Bilancio UE con XBRL ========================== -.. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! @@ -177,7 +177,7 @@ promote its widespread use. Current `maintainer `__: -|maintainer-mktsrl| +|maintainer-mktsrl| This module is part of the `OCA/l10n-italy `_ project on GitHub. diff --git a/l10n_it_financial_statement_eu/__manifest__.py b/l10n_it_financial_statement_eu/__manifest__.py index 40c47181d8bc..fddc2ea846b0 100644 --- a/l10n_it_financial_statement_eu/__manifest__.py +++ b/l10n_it_financial_statement_eu/__manifest__.py @@ -23,7 +23,6 @@ "assets": { "web.assets_backend": [ "l10n_it_financial_statement_eu/static/src/js/client_action.esm.js", - "l10n_it_financial_statement_eu/static/src/js/report.esm.js", "l10n_it_financial_statement_eu/static/src/xml/report.xml", ], }, diff --git a/l10n_it_financial_statement_eu/i18n/it.po b/l10n_it_financial_statement_eu/i18n/it.po index f513c951173e..790233ad7a9a 100644 --- a/l10n_it_financial_statement_eu/i18n/it.po +++ b/l10n_it_financial_statement_eu/i18n/it.po @@ -235,12 +235,20 @@ msgid "Export Financial statement EU in XLSX format" msgstr "Esportazione del bilancio UE in formato XLSX" #. module: l10n_it_financial_statement_eu +#. odoo-javascript +#. odoo-python #: model_terms:ir.ui.view,arch_db:l10n_it_financial_statement_eu.financial_statement_eu_wizard_view +#: code:addons/l10n_it_financial_statement_eu/static/src/xml/report.xml:0 +#, python-format msgid "Export XBRL" msgstr "Esporta XBRL" #. module: l10n_it_financial_statement_eu +#. odoo-javascript +#. odoo-python #: model_terms:ir.ui.view,arch_db:l10n_it_financial_statement_eu.financial_statement_eu_wizard_view +#: code:addons/l10n_it_financial_statement_eu/static/src/xml/report.xml:0 +#, python-format msgid "Export XLSX" msgstr "Esporta XLSX" @@ -483,9 +491,12 @@ msgstr "NON QUADRATO" #. module: l10n_it_financial_statement_eu #: code:addons/l10n_it_financial_statement_eu/models/financial_statement_eu.py:0 #, python-format -msgid "" -"Unbalanced financial statements: {:s} (Assets) - {:s} (Liabilities) = {:s}" -msgstr "Bilancio NON quadrato: {:s} (Attivo) - {:s} (Passivo) = {:s}" +msgid "Unbalanced financial statements: " +"%(tot_assets)s (Assets) - %(tot_liabilities)s (Liabilities)" +" = %(diff)s" +msgstr "Bilancio NON quadrato: " +"%(tot_assets)s (Attivo) - %(tot_liabilities)s (Passivo)" +" = %(diff)s" #. module: l10n_it_financial_statement_eu #: model:ir.model.fields,field_description:l10n_it_financial_statement_eu.field_financial_statement_eu_wizard__financial_statement_log_ids @@ -536,11 +547,6 @@ msgstr "ATTENZIONE:" msgid "Wizard for Financial statement EU calculation" msgstr "Wizard per calcolo bilancio UE" -#. module: l10n_it_financial_statement_eu -#: model:ir.actions.report,name:l10n_it_financial_statement_eu.action_report_financial_statement_eu_xbrl -msgid "XBRL-financial-statements" -msgstr "XBRL-bilancio-esercizio" - #. module: l10n_it_financial_statement_eu #: code:addons/l10n_it_financial_statement_eu/report/financial_statement_eu_report.py:0 #, python-format diff --git a/l10n_it_financial_statement_eu/i18n/l10n_it_financial_statement_eu.pot b/l10n_it_financial_statement_eu/i18n/l10n_it_financial_statement_eu.pot index dc7e219d644a..fbdd7f715061 100644 --- a/l10n_it_financial_statement_eu/i18n/l10n_it_financial_statement_eu.pot +++ b/l10n_it_financial_statement_eu/i18n/l10n_it_financial_statement_eu.pot @@ -225,13 +225,20 @@ msgid "Export Financial statement EU in XLSX format" msgstr "" #. module: l10n_it_financial_statement_eu +#. odoo-javascript +#. odoo-python #: model_terms:ir.ui.view,arch_db:l10n_it_financial_statement_eu.financial_statement_eu_wizard_view +#: code:addons/l10n_it_financial_statement_eu/static/src/xml/report.xml:0 #, python-format msgid "Export XBRL" msgstr "" #. module: l10n_it_financial_statement_eu +#. odoo-javascript +#. odoo-python #: model_terms:ir.ui.view,arch_db:l10n_it_financial_statement_eu.financial_statement_eu_wizard_view +#: code:addons/l10n_it_financial_statement_eu/static/src/xml/report.xml:0 +#, python-format msgid "Export XLSX" msgstr "" @@ -474,8 +481,9 @@ msgstr "" #. module: l10n_it_financial_statement_eu #: code:addons/l10n_it_financial_statement_eu/models/financial_statement_eu.py:0 #, python-format -msgid "" -"Unbalanced financial statements: {:s} (Assets) - {:s} (Liabilities) = {:s}" +msgid "Unbalanced financial statements: " +"%(tot_assets)s (Assets) - %(tot_liabilities)s (Liabilities)" +" = %(diff)s" msgstr "" #. module: l10n_it_financial_statement_eu @@ -527,11 +535,6 @@ msgstr "" msgid "Wizard for Financial statement EU calculation" msgstr "" -#. module: l10n_it_financial_statement_eu -#: model:ir.actions.report,name:l10n_it_financial_statement_eu.action_report_financial_statement_eu_xbrl -msgid "XBRL-financial-statements" -msgstr "" - #. module: l10n_it_financial_statement_eu #: code:addons/l10n_it_financial_statement_eu/report/financial_statement_eu_report.py:0 #: code:addons/l10n_it_financial_statement_eu/report/financial_statement_eu_report.py:0 diff --git a/l10n_it_financial_statement_eu/migrations/16.0.1.0.0/pre-migrate.py b/l10n_it_financial_statement_eu/migrations/16.0.1.0.0/pre-migrate.py index bf91ed940bc7..b6a39410127e 100644 --- a/l10n_it_financial_statement_eu/migrations/16.0.1.0.0/pre-migrate.py +++ b/l10n_it_financial_statement_eu/migrations/16.0.1.0.0/pre-migrate.py @@ -117,8 +117,13 @@ def migrate(env, version): for old_xml_id, new_xml_id in RENAMED_XMLIDS ], ) - # without forcing rename_tables this error occurs: - # Keep unexpected index account_account_deprecated_index on table account_account + openupgrade.rename_tables( env.cr, [("account_balance_eu", "financial_statement_eu")] ) + openupgrade.rename_tables( + env.cr, [("account_balance_eu_log", "financial_statement_eu_log")] + ) + openupgrade.rename_tables( + env.cr, [("account_balance_eu_wizard", "financial_statement_eu_wizard")] + ) diff --git a/l10n_it_financial_statement_eu/models/financial_statement_eu.py b/l10n_it_financial_statement_eu/models/financial_statement_eu.py index 1fbc25abe65b..e9a328f2ed7e 100644 --- a/l10n_it_financial_statement_eu/models/financial_statement_eu.py +++ b/l10n_it_financial_statement_eu/models/financial_statement_eu.py @@ -82,7 +82,7 @@ def _compute_complete_name(self): p = line.parent_id.get_parent_path() else: p = "" - line.complete_name = "[%s] %s%s" % (line.code, p, line.name) + line.complete_name = f"[{line.code}] {p}{line.name}" def name_get(self): res = [] @@ -503,19 +503,22 @@ def cal_financial_statement_eu_data(self, form_data): financial_statement_state = "UNBALANCED" log_warnings = log_warnings + ( _( - "Unbalanced financial statements: {:s} (Assets) - {:s} (Liabilities) = {:s}" - ).format( - formatLang( + "Unbalanced financial statements: " + "%(tot_assets)s (Assets) - %(tot_liabilities)s (Liabilities)" + " = %(diff)s" + ) + % { + "tot_assets": formatLang( self.env, financial_statement_eu_lines["PA"]["rounded_amount"], currency_obj=currency_id, ), - formatLang( + "tot_liabilities": formatLang( self.env, financial_statement_eu_lines["PP"]["rounded_amount"], currency_obj=currency_id, ), - formatLang( + "diff": formatLang( self.env, tools.float_round( financial_statement_eu_lines["PA"]["rounded_amount"] @@ -524,7 +527,7 @@ def cal_financial_statement_eu_data(self, form_data): ), currency_obj=currency_id, ), - ) + } ) if len(unlinked_account) > 0: financial_statement_state = "UNLINKED_ACCOUNTS" diff --git a/l10n_it_financial_statement_eu/pyproject.toml b/l10n_it_financial_statement_eu/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/l10n_it_financial_statement_eu/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/l10n_it_financial_statement_eu/report/financial_statement_eu_report.py b/l10n_it_financial_statement_eu/report/financial_statement_eu_report.py index 1bb13b0f1668..92ab085c1702 100644 --- a/l10n_it_financial_statement_eu/report/financial_statement_eu_report.py +++ b/l10n_it_financial_statement_eu/report/financial_statement_eu_report.py @@ -125,14 +125,12 @@ class FinancialStatementEuXBRLReport(models.AbstractModel): def get_xbrl_data_tag(self, str_field, str_year, value, decimal_precision=-1): complete_field = "itcc-ci:" + str_field if decimal_precision >= 0: - altri_attr = ' unitRef="eur" decimals="{}"'.format(decimal_precision) + altri_attr = f' unitRef="eur" decimals="{decimal_precision}"' value = f"{value:.{decimal_precision}f}" else: altri_attr = "" - return """ - <{} contextRef="{}"{}>{}""".format( - complete_field, str_year, altri_attr, value, complete_field - ) + return f""" + <{complete_field} contextRef="{str_year}"{altri_attr}>{value}""" def get_financial_statement_line_tags( self, diff --git a/l10n_it_financial_statement_eu/static/description/index.html b/l10n_it_financial_statement_eu/static/description/index.html index ea42291ffdae..788d96ae6252 100644 --- a/l10n_it_financial_statement_eu/static/description/index.html +++ b/l10n_it_financial_statement_eu/static/description/index.html @@ -1,13 +1,11 @@ - - - - -ITA - Bilancio UE con XBRL - - - -
-

ITA - Bilancio UE con XBRL

- - -

Alpha License: AGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runboat

-

Italiano

-

In Odoo è presente il piano dei conti tradizionale e le varie registrazioni -contabili -con gli importi ma non è presente una struttura di voci -che descrivano il Bilancio UE a cui associare le voci del piano dei conti -tradizionale.

-

Questo modulo consente di generare un bilancio riclassificato secondo lo schema -del bilancio UE -con tutte le voci delle più recenti tassonomie mettendo a disposizione le -seguenti funzionalità:

-
    -
  • associare ai conti del piano dei conti le voci del Bilancio UE (con preassociazione automatica in fase di installazione del modulo)
  • -
  • elaborare le registrazioni contabili di un dato periodo (per esempio l’anno precedente) al fine di ottenere il bilancio contabile in formato UE, facendo gli opportuni controlli di congruenza, associazione di tutti i conti movimentati nel periodo e quadratura del bilancio. Nei report viene riportato anche il dettaglio dei conti associati ad una certa voce del bilancio UE
  • -
  • generare il report di anteprima del Bilancio UE
  • -
  • generare la stampa PDF del Bilancio UE
  • -
  • generare i file XLSX e XBRL del bilancio (utili per successive rielaborazioni e per trasferimento del bilancio UE al Commercialista)
  • -
-

English

-

In Odoo there is the traditional chart of accounts and the various registrations -accountants -with amounts but there is no line item structure -that describe the EU financial statements to which to associate the items of the traditional chart of accounts. -This module allows to generate a reclassified financial statements according to the EU format -with all the entries of the most recent taxonomies by making available the -following features:

-
    -
  • associate the items in the Chart of Accounts with the items in the EU Budget (with automatic pre-association during module installation)
  • -
  • process the accounting records of a given period (for example -last year) in order to obtain the accounting financial statements in EU format, carrying out the appropriate congruence checks, association of all the accounts moved in the period and balancing of the balance sheet. The reports also show the details of the accounts associated with a certain item of the EU financial statements
  • -
  • preview then EU financial statements
  • -
  • PDF printout of the EU financial statements
  • -
  • download files in XLSX or XBRL format (useful for subsequent re-elaborations and for the transfer of the EU financial statements to the accountant)
  • -
-
-

Important

-

This is an alpha version, the data model and design can change at any time without warning. -Only for development or testing purpose, do not use in production. -More details on development status

-
-

Table of contents

- -
-

Configuration

-

Italiano

-

Il modulo non necessita di nessuna particolare configurazione. -L’installazione del modulo crea le voci del bilancio UE secondo la più recente tassonomia. -Si consiglia di installare la contabilità con relativo piano dei conti prima di installare questo modulo, per consentire l’associazione automatica dei conti del piano dei conti italiano alle voci del bilancio UE. -Sarà poi possibile modificare le associazioni o integrare quelle mancanti tramite la maschera Configurazione / Piano dei conti / Imposta

-

English

-

The module does not require any particular configuration. -Module installation creates the items of the EU financial statements according to the most recent taxonomy. -It is advisable to install the accounting with the related Chart of Accounts before installing this module, to allow the automatic association of the accounts of the Italian Chart of Accounts to the items of the EU financial statements. -It will then be possible to modify the associations or integrate the missing ones via the Configuration / Chart of Accounts / SETUP

-
-
-

Usage

-

Italiano

-

La maschera “Contabilità / Configurazione / Piano dei conti” è stata arricchita con due -nuovi campi “Associa a Bilancio UE / Dare” e “…/ Avere” che consentono di -definire la riclassificazione dei conti, riclassificazione che viene impostata -a valori predefiniti durante l’installazione del modulo. -Dei due campi “Dare” e “Avere” uno solo dei due è obbligatorio ai fini del report e in caso -siano presenti entrambi vengono usati in base al segno del saldo del valore annuale del -conto contabile.

-

La nuova voce di menù “Contabilità / Rendicontazione / Bilancio UE” consente di selezionare il periodo e -scegliere la modalità di esportazione del Bilancio UE. -Nel wizard di “Bilancio UE” sono presenti le seguenti opzioni di generazione:

-
    -
  • Visualizza valori [2 decimali di Euro / unità di Euro]: consente di stampare i valori del bilancio in Euro (con due decimali) o in unità di Euro (senza decimali). In caso si selezioni “unità di Euro” gli eventuali delta da arrotondamenti vengono riportati in automatico su due apposite voci (una nel Passivo e una nel Conto Economico). I saldi dei conti contabili verranno stampati comunque con 2 decimali
  • -
  • Nascondere conti a 0: consente di non visualizzare i conti contabili con saldo a 0 e che quindi non influiscono nel calcolo delle voci del bilancio. Il bilancio UE verrà comunque visualizzato completo, con anche le voci con importo 0
  • -
  • Solo registrazioni confermate: per utilizzare solo le registrazioni contabili confermate (ignora bozze e annullate)
  • -
  • Ignora registrazioni di chiusura: consente di stampare un Bilancio UE corretto anche in caso sia già stata effettuata la chiusura d’esercizio e quindi tutti i conti contabili siano a saldo 0 al 31/12. Se per effettuare la chiusura d’esercizio è stato utilizzato il modulo “account_fiscal_year_closing”, questa opzione consente di ignorare le registrazioni contabili di chiusura
  • -
-

English

-

The “Accounting / Configuration / Chart of Accounts” mask has been enriched with two -new fields “Match to Financial statement EU / Debit” and “… / Credit” that allow you to -define the reclassification of accounts, a reclassification that is set -to default values during installation of the module. -Of the two fields “Debit” and “Credit” only one of the two is mandatory for the purposes of the report and in the case -are present both are used according to the sign of the financial statements of the annual value of -accounting account.

-

The new menu item “Accounting / Reporting / Financial statement EU” allows you to select the period and -choose how to export the EU financial statements. -The following generation options are present in the “Financial statement EU” wizard:

-
    -
  • Values show as [2 decimals Euro / Euro units] : allows to print the values in Euros (with two decimals) or in Euro units (without decimals). If “Euro units” is selected, any delta from rounding is automatically reported on two specific Items (one in the Liabilities and one in the Income Statement).
  • -
  • Hide account with amount 0: allows to not display the accounts with a balance at 0 and which therefore have no influence on the calculation of the financial statements items. The financial statements will be anyway displayed complete, even then items with amount 0
  • -
  • Use only posted registration: to use confirmed postings only (ignore drafts and cancelled)
  • -
  • Ignore closing registration: allows you to print a correct EU financial statements even if the year-end has already been closed and therefore all accounting accounts have a balance of 0 as at 31/12. If the “account_fiscal_year_closing” module was used to carry out the year-end closing, this option allows you to ignore the closing moves
  • -
-
-
-

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

-
    -
  • MKT Srl
  • -
-
-
-

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:

-

mktsrl

-

This module is part of the OCA/l10n-italy project on GitHub.

-

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

-
-
-
- +

+ Alpha + License: AGPL-3 + OCA/l10n-italy + Translate me on Weblate + Try me on Runboat +

+

Italiano

+

+ In Odoo è presente il piano dei conti tradizionale e le varie registrazioni + contabili con gli importi ma non è presente una struttura di voci che descrivano + il Bilancio UE a cui associare le voci del piano dei conti tradizionale. +

+

+ Questo modulo consente di generare un bilancio riclassificato secondo lo schema + del bilancio UE con tutte le voci delle più recenti tassonomie mettendo a + disposizione le seguenti funzionalità: +

+
    +
  • + associare ai conti del piano dei conti le voci del Bilancio UE (con + preassociazione automatica in fase di installazione del modulo) +
  • +
  • + elaborare le registrazioni contabili di un dato periodo (per esempio l’anno + precedente) al fine di ottenere il bilancio contabile in formato UE, facendo + gli opportuni controlli di congruenza, associazione di tutti i conti + movimentati nel periodo e quadratura del bilancio. Nei report viene riportato + anche il dettaglio dei conti associati ad una certa voce del bilancio UE +
  • +
  • generare il report di anteprima del Bilancio UE
  • +
  • generare la stampa PDF del Bilancio UE
  • +
  • + generare i file XLSX e XBRL del bilancio (utili per successive rielaborazioni + e per trasferimento del bilancio UE al Commercialista) +
  • +
+

English

+

+ In Odoo there is the traditional chart of accounts and the various registrations + accountants with amounts but there is no line item structure that describe the + EU financial statements to which to associate the items of the traditional chart + of accounts. This module allows to generate a reclassified financial statements + according to the EU format with all the entries of the most recent taxonomies by + making available the following features: +

+
    +
  • + associate the items in the Chart of Accounts with the items in the EU Budget + (with automatic pre-association during module installation) +
  • +
  • + process the accounting records of a given period (for example last year) in + order to obtain the accounting financial statements in EU format, carrying out + the appropriate congruence checks, association of all the accounts moved in + the period and balancing of the balance sheet. The reports also show the + details of the accounts associated with a certain item of the EU financial + statements +
  • +
  • preview then EU financial statements
  • +
  • PDF printout of the EU financial statements
  • +
  • + download files in XLSX or XBRL format (useful for subsequent re-elaborations + and for the transfer of the EU financial statements to the accountant) +
  • +
+
+

Important

+

+ This is an alpha version, the data model and design can change at any time + without warning. Only for development or testing purpose, do not use in + production. + More details on development status +

+
+

Table of contents

+
+ +
+
+

Configuration

+

Italiano

+

+ Il modulo non necessita di nessuna particolare configurazione. L’installazione + del modulo crea le voci del bilancio UE secondo la più recente tassonomia. Si + consiglia di installare la contabilità con relativo piano dei conti prima di + installare questo modulo, per consentire l’associazione automatica dei conti + del piano dei conti italiano alle voci del bilancio UE. Sarà poi possibile + modificare le associazioni o integrare quelle mancanti tramite la maschera + Configurazione / Piano dei conti / Imposta +

+

English

+

+ The module does not require any particular configuration. Module installation + creates the items of the EU financial statements according to the most recent + taxonomy. It is advisable to install the accounting with the related Chart of + Accounts before installing this module, to allow the automatic association of + the accounts of the Italian Chart of Accounts to the items of the EU financial + statements. It will then be possible to modify the associations or integrate + the missing ones via the Configuration / Chart of Accounts / SETUP +

+
+
+

Usage

+

Italiano

+

+ La maschera “Contabilità / Configurazione / Piano dei conti” è stata + arricchita con due nuovi campi “Associa a Bilancio UE / Dare” e “…/ Avere” che + consentono di definire la riclassificazione dei conti, riclassificazione che + viene impostata a valori predefiniti durante l’installazione del modulo. Dei + due campi “Dare” e “Avere” uno solo dei due è obbligatorio ai fini del report + e in caso siano presenti entrambi vengono usati in base al segno del saldo del + valore annuale del conto contabile. +

+

+ La nuova voce di menù “Contabilità / Rendicontazione / Bilancio UE” consente + di selezionare il periodo e scegliere la modalità di esportazione del Bilancio + UE. Nel wizard di “Bilancio UE” sono presenti le seguenti opzioni di + generazione: +

+
    +
  • + Visualizza valori [2 decimali di Euro / unità di Euro]: consente di stampare + i valori del bilancio in Euro (con due decimali) o in unità di Euro (senza + decimali). In caso si selezioni “unità di Euro” gli eventuali delta da + arrotondamenti vengono riportati in automatico su due apposite voci (una nel + Passivo e una nel Conto Economico). I saldi dei conti contabili verranno + stampati comunque con 2 decimali +
  • +
  • + Nascondere conti a 0: consente di non visualizzare i conti contabili con + saldo a 0 e che quindi non influiscono nel calcolo delle voci del bilancio. + Il bilancio UE verrà comunque visualizzato completo, con anche le voci con + importo 0 +
  • +
  • + Solo registrazioni confermate: per utilizzare solo le registrazioni + contabili confermate (ignora bozze e annullate) +
  • +
  • + Ignora registrazioni di chiusura: consente di stampare un Bilancio UE + corretto anche in caso sia già stata effettuata la chiusura d’esercizio e + quindi tutti i conti contabili siano a saldo 0 al 31/12. Se per effettuare + la chiusura d’esercizio è stato utilizzato il modulo + “account_fiscal_year_closing”, questa opzione consente di ignorare le + registrazioni contabili di chiusura +
  • +
+

English

+

+ The “Accounting / Configuration / Chart of Accounts” mask has been enriched + with two new fields “Match to Financial statement EU / Debit” and “… / Credit” + that allow you to define the reclassification of accounts, a reclassification + that is set to default values during installation of the module. Of the two + fields “Debit” and “Credit” only one of the two is mandatory for the purposes + of the report and in the case are present both are used according to the sign + of the financial statements of the annual value of accounting account. +

+

+ The new menu item “Accounting / Reporting / Financial statement EU” allows you + to select the period and choose how to export the EU financial statements. The + following generation options are present in the “Financial statement EU” + wizard: +

+
    +
  • + Values show as [2 decimals Euro / Euro units] : allows to print the values + in Euros (with two decimals) or in Euro units (without decimals). If “Euro + units” is selected, any delta from rounding is automatically reported on two + specific Items (one in the Liabilities and one in the Income Statement). +
  • +
  • + Hide account with amount 0: allows to not display the accounts with a + balance at 0 and which therefore have no influence on the calculation of the + financial statements items. The financial statements will be anyway + displayed complete, even then items with amount 0 +
  • +
  • + Use only posted registration: to use confirmed postings only (ignore drafts + and cancelled) +
  • +
  • + Ignore closing registration: allows you to print a correct EU financial + statements even if the year-end has already been closed and therefore all + accounting accounts have a balance of 0 as at 31/12. If the + “account_fiscal_year_closing” module was used to carry out the year-end + closing, this option allows you to ignore the closing moves +
  • +
+
+
+

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

+
    +
  • MKT Srl
  • +
+
+
+

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: +

+

+ mktsrl +

+

+ This module is part of the + OCA/l10n-italy + project on GitHub. +

+

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

+
+
+ + diff --git a/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js b/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js index 6e4fb66f7453..4409eb23e974 100644 --- a/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js +++ b/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js @@ -1,7 +1,6 @@ /** @odoo-module **/ import {ReportAction} from "@web/webclient/actions/reports/report_action"; import {patch} from "web.utils"; -import {useEnrichWithActionLinks} from "./report.esm"; const MODULE_NAME = "l10n_it_financial_statement_eu"; @@ -11,37 +10,29 @@ patch(ReportAction.prototype, "l10n_it_financial_statement_eu.ReportAction", { this.isFinancialStatementEU = this.props.report_name.startsWith( `${MODULE_NAME}.` ); - useEnrichWithActionLinks(this.iframe); }, - export_xlsx() { + export_fseu_xlsx() { this.action.doAction({ type: "ir.actions.report", report_type: "xlsx", report_name: "l10n_it_financial_statement_eu.fseu_xlsx_report", - report_file: this._get_xlsx_name(), + report_file: "Financial statement EU", data: this.props.data || {}, context: this.props.context || {}, display_name: this.title, }); }, - _get_xlsx_name() { - return "Financial statement EU"; - }, - export_xbrl() { + export_fseu_xbrl() { this.action.doAction({ type: "ir.actions.report", report_type: "qweb-xml", report_name: "l10n_it_financial_statement_eu.fseu_xbrl_report", - report_file: this._get_xbrl_name(this.props.data), + report_file: "XBRL-financial-statements", data: this.props.data || {}, context: this.props.context || {}, display_name: this.title, }); }, - - _get_xbrl_name(data) { - return String(data.year) + "-XBRL-financial-statements"; - }, }); diff --git a/l10n_it_financial_statement_eu/static/src/js/report.esm.js b/l10n_it_financial_statement_eu/static/src/js/report.esm.js deleted file mode 100644 index 535d43c08595..000000000000 --- a/l10n_it_financial_statement_eu/static/src/js/report.esm.js +++ /dev/null @@ -1,73 +0,0 @@ -/** @odoo-module */ - -import {useComponent, useEffect} from "@odoo/owl"; - -function toTitleCase(str) { - return str - .replaceAll(".", " ") - .replace( - /\w\S*/g, - (txt) => `${txt.charAt(0).toUpperCase()}${txt.substr(1).toLowerCase()}` - ); -} - -function enrich(component, targetElement, selector, isIFrame = false) { - let doc = window.document; - let contentDocument = targetElement; - - // If we are in an iframe, we need to take the right document - // both for the element and the doc - if (isIFrame) { - contentDocument = targetElement.contentDocument; - doc = contentDocument; - } - - // If there are selector, we may have multiple blocks of code to enrich - const targets = []; - if (selector) { - targets.push(...contentDocument.querySelectorAll(selector)); - } else { - targets.push(contentDocument); - } - - // Search the elements with the selector, update them and bind an action. - for (const currentTarget of targets) { - const elementsToWrap = currentTarget.querySelectorAll("[res-model][domain]"); - for (const element of elementsToWrap.values()) { - const wrapper = doc.createElement("a"); - wrapper.setAttribute("href", "#"); - wrapper.addEventListener("click", (ev) => { - ev.preventDefault(); - component.env.services.action.doAction({ - type: "ir.actions.act_window", - res_model: element.getAttribute("res-model"), - domain: element.getAttribute("domain"), - name: toTitleCase(element.getAttribute("res-model")), - views: [ - [false, "list"], - [false, "form"], - ], - }); - }); - element.parentNode.insertBefore(wrapper, element); - wrapper.appendChild(element); - } - } -} - -export function useEnrichWithActionLinks(ref, selector = null) { - const comp = useComponent(); - useEffect( - (element) => { - // If we get an iframe, we need to wait until everything is loaded - if (element.matches("iframe")) { - element.addEventListener("load", () => - enrich(comp, element, selector, true) - ); - } else { - enrich(comp, element, selector); - } - }, - () => [ref.el] - ); -} diff --git a/l10n_it_financial_statement_eu/static/src/xml/report.xml b/l10n_it_financial_statement_eu/static/src/xml/report.xml index 51f70b410260..88afbe9c00d1 100644 --- a/l10n_it_financial_statement_eu/static/src/xml/report.xml +++ b/l10n_it_financial_statement_eu/static/src/xml/report.xml @@ -10,14 +10,14 @@ diff --git a/l10n_it_financial_statement_eu/tests/test_financial_statement_eu.py b/l10n_it_financial_statement_eu/tests/test_financial_statement_eu.py index 5433b5846f47..533693c27c09 100644 --- a/l10n_it_financial_statement_eu/tests/test_financial_statement_eu.py +++ b/l10n_it_financial_statement_eu/tests/test_financial_statement_eu.py @@ -14,7 +14,7 @@ def _get_financial_statement_line_amount(fs_lines, line_code): class TestFinancialStatementEU(TransactionCase): def setUp(self): # add env on cls and many other things - super(TestFinancialStatementEU, self).setUp() + super().setUp() def _find_or_create_account_account(self, company_id, code, name, code_fs_eu): acc_id = self.env["account.account"].search( diff --git a/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.py b/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.py index 7f8eca1224c5..e795f7ef0338 100644 --- a/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.py +++ b/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.py @@ -53,7 +53,8 @@ def _default_date_to(self): hide_acc_amount_0 = fields.Boolean( string="Hide account with amount 0", default=True, - help="Financial statements lines will showed anyway, hide only accounts with balance 0", + help="Financial statements lines will showed anyway, " + "hide only accounts with balance 0", ) only_posted_move = fields.Boolean( string="Use only posted registration", default=True @@ -108,7 +109,6 @@ def _compute_period_data(self): if fs.date_to.month == fs.date_from.month: fs.name = fs.name + " " + str(fs.date_from.month) + "-" + str(fs.year) else: - fs.name = fs.name + " " + str(fs.year) def get_data(self): diff --git a/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.xml b/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.xml index afe18ba3469a..0d2408a325ba 100644 --- a/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.xml +++ b/l10n_it_financial_statement_eu/wizard/financial_statement_eu_wizard.xml @@ -43,10 +43,9 @@