Skip to content

Commit

Permalink
[FIX] l10n_it_financial_statement: tolta _get_xlsx_name e altre migli…
Browse files Browse the repository at this point in the history
…orie
  • Loading branch information
TennyMkt authored and eLBati committed Jul 5, 2024
1 parent bd88c75 commit d3f7e0d
Show file tree
Hide file tree
Showing 15 changed files with 888 additions and 609 deletions.
4 changes: 2 additions & 2 deletions l10n_it_financial_statement_eu/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ITA - Bilancio UE con XBRL
==========================

..
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
Expand Down Expand Up @@ -177,7 +177,7 @@ promote its widespread use.

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-mktsrl|
|maintainer-mktsrl|

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0-mig-l10n_it_financial_statement_eu/l10n_it_financial_statement_eu>`_ project on GitHub.

Expand Down
1 change: 0 additions & 1 deletion l10n_it_financial_statement_eu/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
},
Expand Down
22 changes: 14 additions & 8 deletions l10n_it_financial_statement_eu/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
)
17 changes: 10 additions & 7 deletions l10n_it_financial_statement_eu/models/financial_statement_eu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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"]
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions l10n_it_financial_statement_eu/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
Expand Up @@ -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}</{complete_field}>"""

def get_financial_statement_line_tags(
self,
Expand Down
Loading

0 comments on commit d3f7e0d

Please sign in to comment.