diff --git a/l10n_ar_account_reports/__manifest__.py b/l10n_ar_account_reports/__manifest__.py index 7738d4185..f17561ad7 100644 --- a/l10n_ar_account_reports/__manifest__.py +++ b/l10n_ar_account_reports/__manifest__.py @@ -19,7 +19,7 @@ ############################################################################## { "name": "Accounting Reports Customized for Argentina", - "version": "18.0.1.4.0", + "version": "18.0.1.5.0", "category": "Accounting", "sequence": 14, "summary": "", diff --git a/l10n_ar_account_reports/data/balance_sheet.xml b/l10n_ar_account_reports/data/balance_sheet.xml index ad006b3a7..ed63f4fec 100644 --- a/l10n_ar_account_reports/data/balance_sheet.xml +++ b/l10n_ar_account_reports/data/balance_sheet.xml @@ -589,12 +589,6 @@ equity 0 - - patrimonio - domain - - -sum - ingresos_no_asignados aggregation @@ -604,8 +598,101 @@ balance aggregation - equity.patrimonio + equity.ingresos_no_asignados - + equity_capital.balance + equity_reserves.balance + equity_results.balance + + + + + + Capital + equity_capital + 3 + account_id + True + + + balance + domain + + -sum + + + + + + Reservas + equity_reserves + 3 + account_id + True + + + balance + domain + + -sum + + + + + + Resultados + equity_results + 2 + + + balance + aggregation + ar_curr_year_earnings.balance + equity_results_detail.balance + + + + + + Resultado del Ejercicio + ar_curr_year_earnings + 3 + + + + pnl + aggregation + net_inc.balance + from_fiscalyear + cross_report + + + alloc + domain + + from_fiscalyear + -sum + + + balance + aggregation + ar_curr_year_earnings.pnl + ar_curr_year_earnings.alloc + + + + + + Resultados Acumulados + equity_results_detail + 3 + account_id + True + + + balance + domain + + to_beginning_of_fiscalyear + -sum + + + + diff --git a/l10n_ar_account_reports/data/estado_resultados.xml b/l10n_ar_account_reports/data/estado_resultados.xml index 354aff077..a739495c5 100644 --- a/l10n_ar_account_reports/data/estado_resultados.xml +++ b/l10n_ar_account_reports/data/estado_resultados.xml @@ -194,4 +194,11 @@ + + + + Estado de Resultados + account_report + + diff --git a/l10n_ar_account_reports/data/tags_data.xml b/l10n_ar_account_reports/data/tags_data.xml index a3b5213a2..fedf5b50b 100644 --- a/l10n_ar_account_reports/data/tags_data.xml +++ b/l10n_ar_account_reports/data/tags_data.xml @@ -139,8 +139,16 @@ AR ESP: Part. Terceros en Soc. accounts - - AR ESP: Patrimonio Neto + + AR ESP: Capital + accounts + + + AR ESP: Reservas + accounts + + + AR ESP: Resultados accounts diff --git a/l10n_ar_account_reports/migrations/18.0.1.3.0/post-migration.py b/l10n_ar_account_reports/migrations/18.0.1.5.0/post-migration.py similarity index 68% rename from l10n_ar_account_reports/migrations/18.0.1.3.0/post-migration.py rename to l10n_ar_account_reports/migrations/18.0.1.5.0/post-migration.py index f39e7742c..4da9173b0 100644 --- a/l10n_ar_account_reports/migrations/18.0.1.3.0/post-migration.py +++ b/l10n_ar_account_reports/migrations/18.0.1.5.0/post-migration.py @@ -2,12 +2,10 @@ def migrate(cr, version): - """Apply report tags to AR companies.""" + """Apply report tags to AR companies after removing old patrimonio_neto tag.""" env = api.Environment(cr, SUPERUSER_ID, {}) - # Get all companies with responsibility type code '1' companies = env["res.company"].search([("account_fiscal_country_id.code", "=", "AR")]) - # Execute chart template function for these companies if companies: chart_template = env["account.chart.template"] chart_template._l10n_ar_account_reports_setup_account_tags(companies) diff --git a/l10n_ar_account_reports/migrations/18.0.1.5.0/pre-migration.py b/l10n_ar_account_reports/migrations/18.0.1.5.0/pre-migration.py new file mode 100644 index 000000000..8d4304c24 --- /dev/null +++ b/l10n_ar_account_reports/migrations/18.0.1.5.0/pre-migration.py @@ -0,0 +1,45 @@ +from openupgradelib import openupgrade + + +def migrate(cr, version): + """Migrate accounts from old 'ar_esp_patrimonio_neto' tag to new specific tags. + + The old tag 'ar_esp_patrimonio_neto' is being removed and split into three + more specific tags: 'ar_esp_capital', 'ar_esp_reservas', and 'ar_esp_resultados'. + + This migration removes the old tag assignment from all accounts that have it. + The new tags will be assigned automatically by the post-migration hook based + on the account type. + """ + # Remove all account assignments for the old patrimonio_neto tag + openupgrade.logged_query( + cr, + """ + DELETE FROM account_account_account_tag + WHERE account_account_tag_id IN ( + SELECT res_id + FROM ir_model_data + WHERE module = 'l10n_ar_account_reports' + AND model = 'account.account.tag' + AND name = 'ar_esp_patrimonio_neto' + ) + """, + ) + + # Delete old equity line structure to avoid conflicts with new structure + # The new structure uses children_ids instead of direct domain expressions + openupgrade.logged_query( + cr, + """ + DELETE FROM account_report_line + WHERE id IN ( + SELECT res_id + FROM ir_model_data + WHERE module = 'l10n_ar_account_reports' + AND name IN ( + 'account_financial_report_l10n_ar_estado_patrimonial_line_equity', + 'account_financial_report_l10n_ar_estado_patrimonial_line_total_liabilities_equity' + ) + ) + """, + ) diff --git a/l10n_ar_account_reports/models/account_chart_template.py b/l10n_ar_account_reports/models/account_chart_template.py index c847aad53..78e665ca4 100644 --- a/l10n_ar_account_reports/models/account_chart_template.py +++ b/l10n_ar_account_reports/models/account_chart_template.py @@ -73,7 +73,9 @@ def _get_ar_account_tags(self): "previsiones": self.env.ref("l10n_ar_account_reports.ar_esp_previsiones"), "deudas_nc": self.env.ref("l10n_ar_account_reports.ar_esp_deudas_no_corrientes"), "previsiones_nc": self.env.ref("l10n_ar_account_reports.ar_esp_previsiones_no_corrientes"), - "patrimonio_neto": self.env.ref("l10n_ar_account_reports.ar_esp_patrimonio_neto"), + "capital": self.env.ref("l10n_ar_account_reports.ar_esp_capital"), + "reservas": self.env.ref("l10n_ar_account_reports.ar_esp_reservas"), + "resultados": self.env.ref("l10n_ar_account_reports.ar_esp_resultados"), } return tags @@ -199,8 +201,12 @@ def _get_tag_for_liability_equity_account(self, account, tags, company): if any(keyword in name for keyword in ["loan", "prestamo"]): return tags["prestamos"].id - if code and code.startswith("3."): - return tags["patrimonio_neto"].id + if code and code.startswith("3.1"): + return tags["capital"].id + elif code and code.startswith("3.2"): + return tags["reservas"].id + elif code and code.startswith("3.3"): + return tags["resultados"].id # Pasivos no circulantes if account.account_type in ["liability_current", "liability_payable"]: if code and code.startswith("1.1.1"): diff --git a/l10n_ar_account_tax_settlement/__manifest__.py b/l10n_ar_account_tax_settlement/__manifest__.py index 7d23af95e..f117eb38a 100644 --- a/l10n_ar_account_tax_settlement/__manifest__.py +++ b/l10n_ar_account_tax_settlement/__manifest__.py @@ -19,7 +19,7 @@ ############################################################################## { "name": "Tax Settlements For Argentina", - "version": "18.0.1.10.0", + "version": "18.0.1.11.0", "category": "Accounting", "author": "ADHOC SA", "website": "www.adhoc.com.ar", @@ -37,6 +37,7 @@ "data": [ "data/inflation_adjustment_index.xml", "data/ir_actions_server.xml", + "data/account_report_data.xml", "views/inflation_adjustmen_index_view.xml", "views/account_tax_view.xml", "wizards/inflation_adjustment_view.xml", diff --git a/l10n_ar_account_tax_settlement/data/account_report_data.xml b/l10n_ar_account_tax_settlement/data/account_report_data.xml new file mode 100644 index 000000000..a248864fd --- /dev/null +++ b/l10n_ar_account_tax_settlement/data/account_report_data.xml @@ -0,0 +1,11 @@ + + + + Asiento de refundición + + + + + Generar asiento de cierre + +