diff --git a/account_financial_report/README.rst b/account_financial_report/README.rst index 23df5207546a..b646fd8d1279 100644 --- a/account_financial_report/README.rst +++ b/account_financial_report/README.rst @@ -7,7 +7,7 @@ Account Financial Reports !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:faa622980ad4879fec62c35294122d90b25186ad8c482227bd6cb48cb22b38be + !! source digest: sha256:812fa812f37c1789dab91bea9f3e25e0dba581bdb9bd2b1fedbf739dc2bb7bc1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -45,11 +45,44 @@ currency used in account move lines is properly shown. In case that in an account has not been configured a second currency foreign currency balances are not available. +Invoicing / Settings / Invoicing / OCA Aged Report Configuration you will be able to set +dynamic intervals that will appear on the Aged Partner Balance + **Table of contents** .. contents:: :local: +Configuration +============= + +To configure dynamic intervals for Aged Partner Balance you need to: + +Gallinao on 'Settings' -> 'Invoicing' -> 'OCA Aged Report Configuration'. + +Click on option 'Configurations' and create new record. + +Create new interval. +The name established on line will be the column to display in Aged Partner Balance. +Superior limit established on line is the interval + +Example of configuration superior limit: + +-> 15 +-> 30 +-> 60 + +It means the first interval is from 0 to 15, the second from 16 to 30, and the third is 61+. + +Go on 'Invoicing' -> 'Reports' -> 'OCA accounting reports' -> 'Aged Partner Balance' + +When wizard is open, you need to select your interval configuration and print report. + +If you want to get default interval configuration any time you wish to print Aged Partner Report, +you can set default interval configuration per company in: + +'Settings' -> 'Invoicing' -> 'OCA Aged Report Configuration'. + Known issues / Roadmap ====================== @@ -134,6 +167,7 @@ Contributors * João Marques * Alexandre D. Díaz * Víctor Martínez + * Carolina Fernandez * `Sygel `__: diff --git a/account_financial_report/__manifest__.py b/account_financial_report/__manifest__.py index 857110a9e384..49bfcd086213 100644 --- a/account_financial_report/__manifest__.py +++ b/account_financial_report/__manifest__.py @@ -25,6 +25,7 @@ "wizard/open_items_wizard_view.xml", "wizard/trial_balance_wizard_view.xml", "wizard/vat_report_wizard_view.xml", + "view/account_age_report_configuration_views.xml", "menuitems.xml", "reports.xml", "report/templates/layouts.xml", @@ -35,13 +36,13 @@ "report/templates/trial_balance.xml", "report/templates/vat_report.xml", "view/account_view.xml", - "view/account_age_report_configuration_views.xml", "view/report_general_ledger.xml", "view/report_journal_ledger.xml", "view/report_trial_balance.xml", "view/report_open_items.xml", "view/report_aged_partner_balance.xml", "view/report_vat_report.xml", + "view/res_config_settings_views.xml", ], "assets": { "web.assets_backend": [ diff --git a/account_financial_report/i18n/account_financial_report.pot b/account_financial_report/i18n/account_financial_report.pot index fe2c1efa5cde..2c5c61c519d0 100644 --- a/account_financial_report/i18n/account_financial_report.pot +++ b/account_financial_report/i18n/account_financial_report.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-11-22 16:10+0000\n" +"PO-Revision-Date: 2023-11-22 16:10+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -49,6 +51,11 @@ msgstr "" msgid "Taxes summary" msgstr "" +#. module: account_financial_report +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "Intervals configuration" +msgstr "" + #. module: account_financial_report #: model_terms:ir.ui.view,arch_db:account_financial_report.aged_partner_balance_wizard #: model_terms:ir.ui.view,arch_db:account_financial_report.general_ledger_wizard @@ -88,6 +95,11 @@ msgstr "" msgid "Account" msgstr "" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__account_age_report_config_id +msgid "Account Age Report Config" +msgstr "" + #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__account_code_from #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__account_code_from @@ -146,11 +158,16 @@ msgstr "" msgid "Additional Filtering" msgstr "" +#. module: account_financial_report +#: model:ir.actions.act_window,name:account_financial_report.action_aged_partner_report_configuration +msgid "Age Partner Report Configuration" +msgstr "" + #. module: account_financial_report #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines msgid "" "Age ≤ 120\n" -" d." +" d." msgstr "" #. module: account_financial_report @@ -164,7 +181,7 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines msgid "" "Age ≤ 30\n" -" d." +" d." msgstr "" #. module: account_financial_report @@ -178,7 +195,7 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines msgid "" "Age ≤ 60\n" -" d." +" d." msgstr "" #. module: account_financial_report @@ -192,7 +209,7 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines msgid "" "Age ≤ 90\n" -" d." +" d." msgstr "" #. module: account_financial_report @@ -384,14 +401,28 @@ msgstr "" #. module: account_financial_report #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0 #: code:addons/account_financial_report/report/vat_report_xlsx.py:0 +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__code #: model_terms:ir.ui.view,arch_db:account_financial_report.report_trial_balance_lines_header #: model_terms:ir.ui.view,arch_db:account_financial_report.report_vat_report_base #, python-format msgid "Code" msgstr "" +#. module: account_financial_report +#: code:addons/account_financial_report/models/account_age_report_configuration.py:0 +#: model:ir.model.constraint,message:account_financial_report.constraint_account_age_report_configuration_line_unique_name_code_config_combination +#, python-format +msgid "Code and Name must be unique per report configuration" +msgstr "" + +#. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_res_company +msgid "Companies" +msgstr "" + #. module: account_financial_report #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0 +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__company_id #: model:ir.model.fields,field_description:account_financial_report.field_account_financial_report_abstract_wizard__company_id #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__company_id #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__company_id @@ -409,6 +440,18 @@ msgid "Compute accounts" msgstr "" #. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: account_financial_report +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "Configurations" +msgstr "" + +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__create_uid +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__create_uid #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__create_uid #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__create_uid #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__create_uid @@ -419,6 +462,8 @@ msgid "Created by" msgstr "" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__create_date +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__create_date #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__create_date #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__create_date #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__create_date @@ -595,6 +640,8 @@ msgid "Detail Taxes" msgstr "" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__display_name +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__display_name #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__display_name #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__display_name #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__display_name @@ -873,6 +920,14 @@ msgstr "" msgid "Grouped By" msgstr "" +#. module: account_financial_report +#: model:ir.model.fields,help:account_financial_report.field_res_company__age_partner_config_id +#: model:ir.model.fields,help:account_financial_report.field_res_config_settings__default_age_partner_config_id +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "" +"Here you can set the intervals that will appear on the Aged Partner Balance." +msgstr "" + #. module: account_financial_report #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0 #: code:addons/account_financial_report/report/open_items_xlsx.py:0 @@ -901,6 +956,8 @@ msgid "Hierarchy Levels to display" msgstr "" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__id +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__id #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__id #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__id #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__id @@ -942,6 +999,13 @@ msgstr "" msgid "Initial balance" msgstr "" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id +#: model:ir.model.fields,field_description:account_financial_report.field_res_company__age_partner_config_id +#: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id +msgid "Intervals configuration" +msgstr "" + #. module: account_financial_report #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0 @@ -1008,6 +1072,8 @@ msgid "Journals" msgstr "" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration____last_update +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line____last_update #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard____last_update #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard____last_update #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard____last_update @@ -1018,6 +1084,8 @@ msgid "Last Modified on" msgstr "" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__write_uid +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__write_uid #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__write_uid #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__write_uid #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__write_uid @@ -1028,6 +1096,8 @@ msgid "Last Updated by" msgstr "" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__write_date +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__write_date #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__write_date #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__write_date #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__write_date @@ -1057,6 +1127,27 @@ msgstr "" msgid "Limit hierarchy levels" msgstr "" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__line_ids +msgid "Line" +msgstr "" + +#. module: account_financial_report +#: code:addons/account_financial_report/models/account_age_report_configuration.py:0 +#, python-format +msgid "Superior Limit must be greather than zero" +msgstr "" + +#. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_account_age_report_configuration_line +msgid "Model to set interval lines for Age partner balance report" +msgstr "" + +#. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_account_age_report_configuration +msgid "Model to set intervals for Age partner balance report" +msgstr "" + #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__move_target msgid "Move Target" @@ -1067,9 +1158,17 @@ msgstr "" msgid "Moves" msgstr "" +#. module: account_financial_report +#: code:addons/account_financial_report/models/account_age_report_configuration.py:0 +#, python-format +msgid "Must complete Configuration Lines" +msgstr "" + #. module: account_financial_report #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0 #: code:addons/account_financial_report/report/vat_report_xlsx.py:0 +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__name +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__name #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_all_taxes #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_ledger_journal_taxes #: model_terms:ir.ui.view,arch_db:account_financial_report.report_vat_report_base @@ -1130,6 +1229,11 @@ msgstr "" msgid "Not due" msgstr "" +#. module: account_financial_report +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "OCA Aged Report Configuration" +msgstr "" + #. module: account_financial_report #: model:ir.ui.menu,name:account_financial_report.menu_oca_reports msgid "OCA accounting reports" @@ -1435,6 +1539,11 @@ msgstr "" msgid "Starting account in a range" msgstr "" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__superior_limit +msgid "Superior Limit" +msgstr "" + #. module: account_financial_report #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0 #: model_terms:ir.ui.view,arch_db:account_financial_report.report_general_ledger_lines diff --git a/account_financial_report/i18n/es.po b/account_financial_report/i18n/es.po index 55a7c83b0968..e819278a1207 100644 --- a/account_financial_report/i18n/es.po +++ b/account_financial_report/i18n/es.po @@ -53,6 +53,11 @@ msgstr "91 - 120 d." msgid "Taxes summary" msgstr "Resumen de Impuestos" +#. module: account_financial_report +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "Intervals configuration" +msgstr "Configuración de intervalos" + #. module: account_financial_report #: model_terms:ir.ui.view,arch_db:account_financial_report.aged_partner_balance_wizard #: model_terms:ir.ui.view,arch_db:account_financial_report.general_ledger_wizard @@ -92,6 +97,11 @@ msgstr "Extracto XLSX Account Financial Report" msgid "Account" msgstr "Cuenta" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__account_age_report_config_id +msgid "Account Age Report Config" +msgstr "Configuración del informe de calidad de deuda" + #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__account_code_from #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__account_code_from @@ -150,14 +160,17 @@ msgstr "Activar centralización" msgid "Additional Filtering" msgstr "Filtrado adicional" +#. module: account_financial_report +#: model:ir.actions.act_window,name:account_financial_report.action_aged_partner_report_configuration +msgid "Age Partner Report Configuration" +msgstr "Configuración Calidad de deuda" + #. module: account_financial_report #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines msgid "" "Age ≤ 120\n" -" d." +" d." msgstr "" -"Tiempo ≤ 120\n" -" d." #. module: account_financial_report #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0 @@ -392,14 +405,28 @@ msgstr "Grupos Hijos" #. module: account_financial_report #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0 #: code:addons/account_financial_report/report/vat_report_xlsx.py:0 +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__code #: model_terms:ir.ui.view,arch_db:account_financial_report.report_trial_balance_lines_header #: model_terms:ir.ui.view,arch_db:account_financial_report.report_vat_report_base #, python-format msgid "Code" msgstr "Código" +#. module: account_financial_report +#: code:addons/account_financial_report/models/account_age_report_configuration.py:0 +#: model:ir.model.constraint,message:account_financial_report.constraint_account_age_report_configuration_line_unique_name_code_config_combination +#, python-format +msgid "Code and Name must be unique per report configuration" +msgstr "El código y nombre debe ser único por cada configuración del informe" + +#. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_res_company +msgid "Companies" +msgstr "Compañías" + #. module: account_financial_report #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0 +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__company_id #: model:ir.model.fields,field_description:account_financial_report.field_account_financial_report_abstract_wizard__company_id #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__company_id #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__company_id @@ -417,6 +444,18 @@ msgid "Compute accounts" msgstr "Cuentas calculadas" #. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_res_config_settings +msgid "Config Settings" +msgstr "Opciones de configuración" + +#. module: account_financial_report +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "Configurations" +msgstr "Configuraciones" + +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__create_uid +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__create_uid #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__create_uid #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__create_uid #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__create_uid @@ -427,6 +466,8 @@ msgid "Created by" msgstr "Creado por" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__create_date +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__create_date #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__create_date #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__create_date #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__create_date @@ -600,6 +641,8 @@ msgid "Detail Taxes" msgstr "Detalle de impuestos" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__display_name +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__display_name #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__display_name #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__display_name #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__display_name @@ -614,13 +657,11 @@ msgstr "Nombre mostrado" #: model:ir.model.fields,help:account_financial_report.field_open_items_report_wizard__foreign_currency #: model:ir.model.fields,help:account_financial_report.field_trial_balance_report_wizard__foreign_currency msgid "" -"Display foreign currency for move lines, unless account currency is not " -"setup through chart of accounts will display initial and final balance in " -"that currency." +"Display foreign currency for move lines, unless account currency is not setup through chart of accounts " +"will display initial and final balance in that currency." msgstr "" -"Mostrar moneda extranjera para líneas de movimiento contable, a menos que la " -"moneda de la cuenta no esté configurada a través del plan de cuentas " -"mostrará el saldo inicial y final en esa moneda." +"Mostrar moneda extranjera para líneas de movimiento contable, a menos que la moneda de la cuenta no esté " +"configurada a través del plan de cuentas mostrará el saldo inicial y final en esa moneda." #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_trial_balance_report_wizard__hide_parent_hierarchy_level @@ -875,8 +916,7 @@ msgid "" " only one unaffected earnings account." msgstr "" "El Libro mayor solo se puede calcular si la empresa seleccionada tiene \n" -" solo una " -"cuenta de resultados no afectados." +" solo una cuenta de resultados no afectados." #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__group_option @@ -888,6 +928,13 @@ msgstr "Agrupar por" msgid "Grouped By" msgstr "Agrupado por" +#. module: account_financial_report +#: model:ir.model.fields,help:account_financial_report.field_res_company__age_partner_config_id +#: model:ir.model.fields,help:account_financial_report.field_res_config_settings__default_age_partner_config_id +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "Here you can set the intervals that will appear on the Aged Partner Balance." +msgstr "Aquí puede configurar los intervalos que aparecerán en el informe de Calidad de la deuda." + #. module: account_financial_report #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0 #: code:addons/account_financial_report/report/open_items_xlsx.py:0 @@ -916,6 +963,8 @@ msgid "Hierarchy Levels to display" msgstr "Niveles de Jerarquía a mostrar" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__id +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__id #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__id #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__id #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__id @@ -923,16 +972,16 @@ msgstr "Niveles de Jerarquía a mostrar" #: model:ir.model.fields,field_description:account_financial_report.field_trial_balance_report_wizard__id #: model:ir.model.fields,field_description:account_financial_report.field_vat_report_wizard__id msgid "ID" -msgstr "ID" +msgstr "" #. module: account_financial_report #: model:ir.model.fields,help:account_financial_report.field_account_account__centralized msgid "" -"If flagged, no details will be displayed in the General Ledger report (the " -"webkit one only), only centralized amounts per period." +"If flagged, no details will be displayed in the General Ledger report (the webkit one only), only " +"centralized amounts per period." msgstr "" -"Si se marca, no se mostrarán detalles en el informe del libro mayor (solo el " -"webkit), solo importes centralizados por período." +"Si se marca, no se mostrarán detalles en el informe del libro mayor (solo el webkit), solo importes " +"centralizados por período." #. module: account_financial_report #: model_terms:ir.ui.view,arch_db:account_financial_report.report_trial_balance_lines_header @@ -960,6 +1009,13 @@ msgstr "" msgid "Initial balance" msgstr "Saldo inicial" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id +#: model:ir.model.fields,field_description:account_financial_report.field_res_company__age_partner_config_id +#: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id +msgid "Intervals configuration" +msgstr "Configuración de intervalos" + #. module: account_financial_report #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0 @@ -1026,6 +1082,8 @@ msgid "Journals" msgstr "Diarios" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration____last_update +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line____last_update #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard____last_update #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard____last_update #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard____last_update @@ -1036,6 +1094,8 @@ msgid "Last Modified on" msgstr "Última modificación en" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__write_uid +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__write_uid #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__write_uid #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__write_uid #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__write_uid @@ -1046,6 +1106,8 @@ msgid "Last Updated by" msgstr "Última actualización por" #. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__write_date +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__write_date #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__write_date #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__write_date #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__write_date @@ -1075,6 +1137,27 @@ msgstr "Nivel %s" msgid "Limit hierarchy levels" msgstr "Limitar niveles de jerarquía" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__line_ids +msgid "Line" +msgstr "Línea" + +#. module: account_financial_report +#: code:addons/account_financial_report/models/account_age_report_configuration.py:0 +#, python-format +msgid "Superior Limit must be greather than zero" +msgstr "El límite superior debe ser mayor que cero" + +#. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_account_age_report_configuration_line +msgid "Model to set interval lines for Age partner balance report" +msgstr "Modelo para establecer líneas de intervalo para el informe de Calidad de deuda" + +#. module: account_financial_report +#: model:ir.model,name:account_financial_report.model_account_age_report_configuration +msgid "Model to set intervals for Age partner balance report" +msgstr "Modelo para establecer intervalos en el informe de Calidad de deuda" + #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__move_target msgid "Move Target" @@ -1085,9 +1168,17 @@ msgstr "Asiento Objetivo" msgid "Moves" msgstr "Asientos" +#. module: account_financial_report +#: code:addons/account_financial_report/models/account_age_report_configuration.py:0 +#, python-format +msgid "Must complete Configuration Lines" +msgstr "Debe completar las líneas de configuración" + #. module: account_financial_report #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0 #: code:addons/account_financial_report/report/vat_report_xlsx.py:0 +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__name +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__name #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_all_taxes #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_ledger_journal_taxes #: model_terms:ir.ui.view,arch_db:account_financial_report.report_vat_report_base @@ -1146,6 +1237,11 @@ msgstr "Sin Postear" msgid "Not due" msgstr "Deuda" +#. module: account_financial_report +#: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form +msgid "OCA Aged Report Configuration" +msgstr "Configuración del informe Calidad de deuda OCA" + #. module: account_financial_report #: model:ir.ui.menu,name:account_financial_report.menu_oca_reports msgid "OCA accounting reports" @@ -1452,6 +1548,11 @@ msgstr "Fecha de inicio" msgid "Starting account in a range" msgstr "Cuenta inicial en un rango" +#. module: account_financial_report +#: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__superior_limit +msgid "Superior Limit" +msgstr "Límite superior" + #. module: account_financial_report #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0 #: model_terms:ir.ui.view,arch_db:account_financial_report.report_general_ledger_lines @@ -1558,31 +1659,22 @@ msgstr "Impuestos" #. module: account_financial_report #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:0 #, python-format -msgid "" -"The Company in the General Ledger Report Wizard and in Date Range must be " -"the same." +msgid "The Company in the General Ledger Report Wizard and in Date Range must be the same." msgstr "" -"La empresa en el Asistente de informe de Contabilidad General y de rango de " -"fechas debe ser la misma." +"La empresa en el Asistente de informe de Contabilidad General y de rango de fechas debe ser la misma." #. module: account_financial_report #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:0 #, python-format -msgid "" -"The Company in the Trial Balance Report Wizard and in Date Range must be the " -"same." +msgid "The Company in the Trial Balance Report Wizard and in Date Range must be the same." msgstr "" -"La empresa en el Asistente de informe de Balance de comprobación y en rango " -"de fechas debe ser la misma." +"La empresa en el Asistente de informe de Balance de comprobación y en rango de fechas debe ser la misma." #. module: account_financial_report #: code:addons/account_financial_report/wizard/vat_report_wizard.py:0 #, python-format -msgid "" -"The Company in the Vat Report Wizard and in Date Range must be the same." -msgstr "" -"La empresa en el Asistente para informes de IVA y en rango de fechas debe " -"ser la misma." +msgid "The Company in the Vat Report Wizard and in Date Range must be the same." +msgstr "La empresa en el Asistente para informes de IVA y en rango de fechas debe ser la misma." #. module: account_financial_report #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:0 @@ -1593,9 +1685,7 @@ msgstr "El nivel de jerarquía a filtrar debe ser mayor que 0." #. module: account_financial_report #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain msgid "This domain will be used to select specific domain for Journal Items" -msgstr "" -"Este dominio se usará para seleccionar dominios específicos para Apuntes " -"Contables" +msgstr "Este dominio se usará para seleccionar dominios específicos para Apuntes Contables" #. module: account_financial_report #: model_terms:ir.ui.view,arch_db:account_financial_report.report_trial_balance_filters @@ -1610,7 +1700,7 @@ msgstr "A:" #. module: account_financial_report #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_account_ending_cumul msgid "Total" -msgstr "Total" +msgstr "" #. module: account_financial_report #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0 @@ -1653,10 +1743,8 @@ msgid "" "Trial Balance can be computed only if selected company have only\n" " one unaffected earnings account." msgstr "" -"El balance de sumas y saldos solo puede calcularse si la compañía " -"seleccionada tiene una y solo \n" -" una cuenta de " -"ganancias." +"El balance de sumas y saldos solo puede calcularse si la compañía seleccionada tiene una y solo \n" +" una cuenta de ganancias." #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__unaffected_earnings_account @@ -1668,13 +1756,11 @@ msgstr "Cuenta de Ganancias No Afectadas" #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__hide_account_at_0 #: model:ir.model.fields,help:account_financial_report.field_open_items_report_wizard__hide_account_at_0 msgid "" -"Use this filter to hide an account or a partner with an ending balance at 0. " -"If partners are filtered, debits and credits totals will not match the trial " -"balance." +"Use this filter to hide an account or a partner with an ending balance at 0. If partners are filtered, " +"debits and credits totals will not match the trial balance." msgstr "" -"Use este filtro para ocultar las cuentas o empresas con saldo final 0. Si " -"las empresas se filtran, los debe y haber totales no coincidirán con el " -"balance de sumas y saldos." +"Use este filtro para ocultar las cuentas o empresas con saldo final 0. Si las empresas se filtran, los " +"debe y haber totales no coincidirán con el balance de sumas y saldos." #. module: account_financial_report #: model:ir.model.fields,help:account_financial_report.field_trial_balance_report_wizard__show_hierarchy @@ -1738,11 +1824,11 @@ msgstr "Ver" #. module: account_financial_report #: model:ir.model.fields,help:account_financial_report.field_trial_balance_report_wizard__hide_account_at_0 msgid "" -"When this option is enabled, the trial balance will not display accounts " -"that have initial balance = debit = credit = end balance = 0" +"When this option is enabled, the trial balance will not display accounts that have initial balance = debit " +"= credit = end balance = 0" msgstr "" -"Cuando habilite esta opción el balance de sumas y saldos no va a mostrar " -"cuentas que tengan saldo inicial = débito = crédito = saldo final = 0" +"Cuando habilite esta opción el balance de sumas y saldos no va a mostrar cuentas que tengan saldo inicial " +"= débito = crédito = saldo final = 0" #. module: account_financial_report #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__with_account_name @@ -1813,35 +1899,3 @@ msgstr "ancho: 38.92%;" #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_ledger_journal_table_header msgid "width: 8.11%;" msgstr "ancho: 8.11%;" - -#~ msgid "Child Accounts" -#~ msgstr "Cuentas Hijas" - -#~ msgid "Computed Accounts" -#~ msgstr "Cuentas Calculadas" - -#~ msgid "" -#~ "Computed Accounts: Use when the account group have codes\n" -#~ " that represent prefixes of the actual accounts.\n" -#~ "\n" -#~ " Child Accounts: Use when your account groups are hierarchical.\n" -#~ "\n" -#~ " No hierarchy: Use to display just the accounts, without any " -#~ "grouping.\n" -#~ " " -#~ msgstr "" -#~ "Cuentas Calculadas: Usar cuando el grupo de cuentas tiene códigos \n" -#~ " que representan prefijos de las cuentas reales.\n" -#~ "\n" -#~ " Cuentas Hijas: Usar cuando los grupos de cuentas son " -#~ "jerárquicos.\n" -#~ "\n" -#~ " Sin jerarquía: Usar para mostrar sólo las cuentas, sin ninguna " -#~ "agrupación.\n" -#~ " " - -#~ msgid "Hierarchy On" -#~ msgstr "Jerarquía en" - -#~ msgid "No hierarchy" -#~ msgstr "Sin jerarquía" diff --git a/account_financial_report/models/__init__.py b/account_financial_report/models/__init__.py index af829b36a4e4..154d80e38603 100644 --- a/account_financial_report/models/__init__.py +++ b/account_financial_report/models/__init__.py @@ -3,3 +3,4 @@ from . import account from . import account_move_line from . import ir_actions_report +from . import res_config_settings diff --git a/account_financial_report/models/account_age_report_configuration.py b/account_financial_report/models/account_age_report_configuration.py index 235c01283fb8..ab113f8b1f37 100644 --- a/account_financial_report/models/account_age_report_configuration.py +++ b/account_financial_report/models/account_age_report_configuration.py @@ -1,24 +1,48 @@ # Copyright 2023 Ernesto García +# Copyright 2023 Carolina Fernandez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import fields, models +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError class AccountAgeReportConfiguration(models.Model): _name = "account.age.report.configuration" _description = "Model to set intervals for Age partner balance report" - name = fields.Char() - company_id = fields.Many2one("res.company", default=lambda self: self.env.company) + name = fields.Char(required=True) + company_id = fields.Many2one( + "res.company", default=lambda self: self.env.company, readonly=True + ) line_ids = fields.One2many( "account.age.report.configuration.line", "account_age_report_config_id" ) + @api.constrains("line_ids") + def _check_line_ids(self): + for rec in self: + if not rec.line_ids: + raise ValidationError(_("Must complete Configuration Lines")) + class AccountAgeReportConfigurationLine(models.Model): _name = "account.age.report.configuration.line" + _description = "Model to set interval lines for Age partner balance report" - name = fields.Char() - code = fields.Char() + name = fields.Char(required=True) + code = fields.Char(required=True) account_age_report_config_id = fields.Many2one("account.age.report.configuration") - lower_limit = fields.Integer() superior_limit = fields.Integer() + + @api.constrains("superior_limit") + def _check_superior_limit(self): + for rec in self: + if rec.superior_limit <= 0: + raise ValidationError(_("Superior Limit must be greather than zero")) + + _sql_constraints = [ + ( + "unique_name_code_config_combination", + "UNIQUE(name,code,account_age_report_config_id)", + _("Code and Name must be unique per report configuration"), + ) + ] diff --git a/account_financial_report/models/res_config_settings.py b/account_financial_report/models/res_config_settings.py new file mode 100644 index 000000000000..56826b0e927e --- /dev/null +++ b/account_financial_report/models/res_config_settings.py @@ -0,0 +1,14 @@ +# Copyright 2023 Tecnativa - Carolina Fernandez +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + default_age_partner_config_id = fields.Many2one( + "account.age.report.configuration", + string="Intervals configuration", + default_model="aged.partner.balance.report.wizard", + ) diff --git a/account_financial_report/readme/CONFIGURE.rst b/account_financial_report/readme/CONFIGURE.rst new file mode 100644 index 000000000000..ca27ac3c0ade --- /dev/null +++ b/account_financial_report/readme/CONFIGURE.rst @@ -0,0 +1,26 @@ +To configure dynamic intervals for Aged Partner Balance you need to: + +Go on 'Settings' -> 'Invoicing' -> 'OCA Aged Report Configuration'. + +Click on option 'Configurations' and create new record. + +Create new interval. +The name established on line will be the column to display in Aged Partner Balance. +Superior limit established on line is the interval + +Example of configuration superior limit: + +-> 15 +-> 30 +-> 60 + +It means the first interval is from 0 to 15, the second from 16 to 30, and the third is 61+. + +Go on 'Invoicing' -> 'Reports' -> 'OCA accounting reports' -> 'Aged Partner Balance' + +When wizard is open, you need to select your interval configuration and print report. + +If you want to get default interval configuration any time you wish to print Aged Partner Report, +you can set default interval configuration per company in: + +'Settings' -> 'Invoicing' -> 'OCA Aged Report Configuration'. diff --git a/account_financial_report/readme/CONTRIBUTORS.rst b/account_financial_report/readme/CONTRIBUTORS.rst index f0bb7b8bcf3e..f8373c582104 100644 --- a/account_financial_report/readme/CONTRIBUTORS.rst +++ b/account_financial_report/readme/CONTRIBUTORS.rst @@ -24,6 +24,7 @@ * João Marques * Alexandre D. Díaz * Víctor Martínez + * Carolina Fernandez * `Sygel `__: diff --git a/account_financial_report/readme/DESCRIPTION.rst b/account_financial_report/readme/DESCRIPTION.rst index f638de8b901b..353fa34e2af7 100644 --- a/account_financial_report/readme/DESCRIPTION.rst +++ b/account_financial_report/readme/DESCRIPTION.rst @@ -14,3 +14,7 @@ currency used in account move lines is properly shown. In case that in an account has not been configured a second currency foreign currency balances are not available. + +Invoicing / Settings / Invoicing / OCA Aged Report Configuration you will be able to set +dynamic intervals that will appear on the Aged Partner Balance. +For further information, check CONFIGURE.rst diff --git a/account_financial_report/report/aged_partner_balance.py b/account_financial_report/report/aged_partner_balance.py index 173dfc9e4c89..88bebe1255cf 100644 --- a/account_financial_report/report/aged_partner_balance.py +++ b/account_financial_report/report/aged_partner_balance.py @@ -71,15 +71,22 @@ def _calculate_amounts( else: ag_pb_data[acc_id]["older"] += residual ag_pb_data[acc_id][prt_id]["older"] += residual - for line in interval_lines.sorted("superior_limit"): - if today >= due_date + timedelta( - days=line.lower_limit - ) and today <= due_date + timedelta(days=line.superior_limit): + for index, line in enumerate(interval_lines): + next_line = ( + interval_lines[index + 1] if index + 1 < len(interval_lines) else None + ) + lower_limit = 0 if not index else line.superior_limit + if ( + next_line + and today >= due_date + timedelta(days=lower_limit) + and today <= due_date + timedelta(days=next_line.superior_limit) + ): ag_pb_data[acc_id][line.code] += residual ag_pb_data[acc_id][prt_id][line.code] += residual - else: - ag_pb_data[acc_id][line.code] += 0 - ag_pb_data[acc_id][prt_id][line.code] += 0 + if not next_line: + if today >= due_date + timedelta(days=line.superior_limit): + ag_pb_data[acc_id][line.code] += residual + ag_pb_data[acc_id][prt_id][line.code] += residual return ag_pb_data def _get_account_partial_reconciled(self, company_id, date_at_object): @@ -267,12 +274,23 @@ def _compute_maturity_date(self, ml, date_at_object): ml["120_days"] += amount else: ml["older"] += amount - match_interval = interval_lines.filtered( - lambda line: today >= due_date + timedelta(days=line.lower_limit) - and today <= due_date + timedelta(days=line.superior_limit) - ) - if match_interval: - ml[match_interval.code] += amount + + for index, interval_line in enumerate(interval_lines): + next_line = ( + interval_lines[index + 1] if index + 1 < len(interval_lines) else None + ) + lower_limit = 0 if not index else interval_lines[index].superior_limit + if ( + next_line + and today >= due_date + timedelta(days=lower_limit) + and today <= due_date + timedelta(days=next_line.superior_limit) + ): + ml[interval_line.code] += amount + break + if not next_line: + if today >= due_date + timedelta(days=interval_line.superior_limit): + ml[interval_line.code] += amount + break def _create_account_list( self, diff --git a/account_financial_report/report/aged_partner_balance_xlsx.py b/account_financial_report/report/aged_partner_balance_xlsx.py index c282f13e6be7..5b9742c7662b 100644 --- a/account_financial_report/report/aged_partner_balance_xlsx.py +++ b/account_financial_report/report/aged_partner_balance_xlsx.py @@ -1,6 +1,7 @@ # Author: Julien Coux # Copyright 2016 Camptocamp SA # Copyright 2021 Tecnativa - João Marques +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import _, models @@ -20,86 +21,83 @@ def _get_report_name(self, report, data=False): report_name = report_name + suffix return report_name - def _get_report_columns(self, report): - column_index = 2 if not report.show_move_line_details else 8 - report_columns = {} - if not report.show_move_line_details: - report_columns = { - 0: {"header": _("Partner"), "field": "name", "width": 70}, - 1: { - "header": _("Residual"), - "field": "residual", - "field_footer_total": "residual", - "type": "amount", - "width": 14, - }, - } - if report.age_partner_config_id: - for interval in report.age_partner_config_id.line_ids: - report_columns[column_index] = { - "header": interval.name, - "field": interval.code, - "field_footer_total": interval.code, - "field_footer_percent": f"percent_{interval.code}", + def _get_report_columns_without_move_line_details(self, report, column_index): + report_columns = { + 0: {"header": _("Partner"), "field": "name", "width": 70}, + 1: { + "header": _("Residual"), + "field": "residual", + "field_footer_total": "residual", + "type": "amount", + "width": 14, + }, + 2: { + "header": _("Current"), + "field": "current", + "field_footer_total": "current", + "field_footer_percent": "percent_current", + "type": "amount", + "width": 14, + }, + } + if not report.age_partner_config_id: + report_columns.update( + { + 3: { + "header": _("Age ≤ 30 d."), + "field": "30_days", + "field_footer_total": "30_days", + "field_footer_percent": "percent_30_days", "type": "amount", "width": 14, - } - column_index += 1 - else: - report_columns.update( - { - 2: { - "header": _("Current"), - "field": "current", - "field_footer_total": "current", - "field_footer_percent": "percent_current", - "type": "amount", - "width": 14, - }, - 3: { - "header": _("Age ≤ 30 d."), - "field": "30_days", - "field_footer_total": "30_days", - "field_footer_percent": "percent_30_days", - "type": "amount", - "width": 14, - }, - 4: { - "header": _("Age ≤ 60 d."), - "field": "60_days", - "field_footer_total": "60_days", - "field_footer_percent": "percent_60_days", - "type": "amount", - "width": 14, - }, - 5: { - "header": _("Age ≤ 90 d."), - "field": "90_days", - "field_footer_total": "90_days", - "field_footer_percent": "percent_90_days", - "type": "amount", - "width": 14, - }, - 6: { - "header": _("Age ≤ 120 d."), - "field": "120_days", - "field_footer_total": "120_days", - "field_footer_percent": "percent_120_days", - "type": "amount", - "width": 14, - }, - 7: { - "header": _("Older"), - "field": "older", - "field_footer_total": "older", - "field_footer_percent": "percent_older", - "type": "amount", - "width": 14, - }, - } - ) - return report_columns + }, + 4: { + "header": _("Age ≤ 60 d."), + "field": "60_days", + "field_footer_total": "60_days", + "field_footer_percent": "percent_60_days", + "type": "amount", + "width": 14, + }, + 5: { + "header": _("Age ≤ 90 d."), + "field": "90_days", + "field_footer_total": "90_days", + "field_footer_percent": "percent_90_days", + "type": "amount", + "width": 14, + }, + 6: { + "header": _("Age ≤ 120 d."), + "field": "120_days", + "field_footer_total": "120_days", + "field_footer_percent": "percent_120_days", + "type": "amount", + "width": 14, + }, + 7: { + "header": _("Older"), + "field": "older", + "field_footer_total": "older", + "field_footer_percent": "percent_older", + "type": "amount", + "width": 14, + }, + } + ) + for interval in report.age_partner_config_id.line_ids: + report_columns[column_index] = { + "header": interval.name, + "field": interval.code, + "field_footer_total": interval.code, + "field_footer_percent": f"percent_{interval.code}", + "type": "amount", + "width": 14, + } + column_index += 1 + return report_columns + def _get_report_columns_with_move_line_details(self, report, column_index): report_columns = { 0: {"header": _("Date"), "field": "date", "width": 11}, 1: {"header": _("Entry"), "field": "entry", "width": 18}, @@ -116,30 +114,19 @@ def _get_report_columns(self, report): "type": "amount", "width": 14, }, + 8: { + "header": _("Current"), + "field": "current", + "field_footer_total": "current", + "field_footer_percent": "percent_current", + "field_final_balance": "current", + "type": "amount", + "width": 14, + }, } - if report.age_partner_config_id: - for interval in report.age_partner_config_id.line_ids: - report_columns[column_index] = { - "header": interval.name, - "field": interval.code, - "field_footer_total": interval.code, - "field_footer_percent": f"percent_{interval.code}", - "type": "amount", - "width": 14, - } - column_index += 1 - else: + if not report.age_partner_config_id: report_columns.update( { - 8: { - "header": _("Current"), - "field": "current", - "field_footer_total": "current", - "field_footer_percent": "percent_current", - "field_final_balance": "current", - "type": "amount", - "width": 14, - }, 9: { "header": _("Age ≤ 30 d."), "field": "30_days", @@ -187,8 +174,25 @@ def _get_report_columns(self, report): }, } ) + for interval in report.age_partner_config_id.line_ids: + report_columns[column_index] = { + "header": interval.name, + "field": interval.code, + "field_footer_total": interval.code, + "field_footer_percent": f"percent_{interval.code}", + "type": "amount", + "width": 14, + } + column_index += 1 return report_columns + def _get_report_columns(self, report): + if not report.show_move_line_details: + return self._get_report_columns_without_move_line_details( + report, column_index=3 + ) + return self._get_report_columns_with_move_line_details(report, column_index=8) + def _get_report_filters(self, report): return [ [_("Date at filter"), report.date_at.strftime("%d/%m/%Y")], diff --git a/account_financial_report/report/templates/aged_partner_balance.xml b/account_financial_report/report/templates/aged_partner_balance.xml index 6ddff6cf9ca6..d51c780f4969 100644 --- a/account_financial_report/report/templates/aged_partner_balance.xml +++ b/account_financial_report/report/templates/aged_partner_balance.xml @@ -108,7 +108,7 @@ - + diff --git a/account_financial_report/static/description/index.html b/account_financial_report/static/description/index.html index fb0d735b9ee8..d2676ad85888 100644 --- a/account_financial_report/static/description/index.html +++ b/account_financial_report/static/description/index.html @@ -367,7 +367,7 @@

Account Financial Reports

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:faa622980ad4879fec62c35294122d90b25186ad8c482227bd6cb48cb22b38be +!! source digest: sha256:812fa812f37c1789dab91bea9f3e25e0dba581bdb9bd2b1fedbf739dc2bb7bc1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This module adds a set of financial reports. They are accessible under @@ -385,27 +385,49 @@

Account Financial Reports

currency used in account move lines is properly shown.

In case that in an account has not been configured a second currency foreign currency balances are not available.

+

Invoicing / Settings / Invoicing / OCA Aged Report Configuration you will be able to set +dynamic intervals that will appear on the Aged Partner Balance

Table of contents

+
+

Configuration

+

To configure dynamic intervals for Aged Partner Balance you need to:

+

Gallinao on ‘Settings’ -> ‘Invoicing’ -> ‘OCA Aged Report Configuration’.

+

Click on option ‘Configurations’ and create new record.

+

Create new interval. +The name established on line will be the column to display in Aged Partner Balance. +Superior limit established on line is the interval

+

Example of configuration superior limit:

+

-> 15 +-> 30 +-> 60

+

It means the first interval is from 0 to 15, the second from 16 to 30, and the third is 61+.

+

Go on ‘Invoicing’ -> ‘Reports’ -> ‘OCA accounting reports’ -> ‘Aged Partner Balance’

+

When wizard is open, you need to select your interval configuration and print report.

+

If you want to get default interval configuration any time you wish to print Aged Partner Report, +you can set default interval configuration per company in:

+

‘Settings’ -> ‘Invoicing’ -> ‘OCA Aged Report Configuration’.

+
-

Known issues / Roadmap

+

Known issues / Roadmap

  • ‘VAT Report’ is valid only for cases where it’s met that for each Tax defined: all the “Account tags” of all the @@ -417,15 +439,15 @@

    Known issues / Roadmap

-

Changelog

+

Changelog

-

11.0.2.5.0 (2019-04-26)

+

11.0.2.5.0 (2019-04-26)

  • In the Trial Balance you have an option to hide parent hierarchy levels
-

11.0.2.4.1 (2019-01-08)

+

11.0.2.4.1 (2019-01-08)

  • Handle better multicompany behaviour
  • Improve how title appears in the reports
  • @@ -433,7 +455,7 @@

    11.0.2.4.1 (2019-01-08)

-

11.0.2.3.1 (2018-11-29)

+

11.0.2.3.1 (2018-11-29)

  • In the Trial Balance you can apply a filter by hierarchy levels
  • In the General Ledger you can apply a filter by Analytic Tag
  • @@ -442,7 +464,7 @@

    11.0.2.3.1 (2018-11-29)

-

Bug Tracker

+

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 @@ -450,9 +472,9 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Camptocamp SA
  • initOS GmbH
  • @@ -461,7 +483,7 @@

    Authors

-

Contributors

+

Contributors

  • Sygel:
  • -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association

    OCA, or the Odoo Community Association, is a nonprofit organization whose diff --git a/account_financial_report/tests/__init__.py b/account_financial_report/tests/__init__.py index 90ec389b6249..ad6fd1ef7e80 100644 --- a/account_financial_report/tests/__init__.py +++ b/account_financial_report/tests/__init__.py @@ -7,3 +7,4 @@ from . import test_open_items from . import test_trial_balance from . import test_vat_report +from . import test_age_report_configuration diff --git a/account_financial_report/tests/test_age_report_configuration.py b/account_financial_report/tests/test_age_report_configuration.py new file mode 100644 index 000000000000..80cc4b31f9e5 --- /dev/null +++ b/account_financial_report/tests/test_age_report_configuration.py @@ -0,0 +1,42 @@ +# Copyright 2023 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.exceptions import ValidationError +from odoo.tests import common + + +class TestAccountAgeReportConfiguration(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.account_age_report_config = cls.env[ + "account.age.report.configuration" + ].create( + { + "name": "Intervals configuration", + "line_ids": [ + ( + 0, + 0, + { + "name": "1-30", + "code": "30_days", + "superior_limit": 30, + }, + ), + ], + } + ) + + def test_check_line_ids_constraint(self): + with self.assertRaises(ValidationError): + self.env["account.age.report.configuration"].create( + {"name": "Interval configuration", "line_ids": False} + ) + + def test_check_lower_superior_limit_constraint(self): + with self.assertRaises(ValidationError): + self.account_age_report_config.line_ids.superior_limit = 0 + + with self.assertRaises(ValidationError): + self.account_age_report_config.line_ids.superior_limit = -1 diff --git a/account_financial_report/tests/test_aged_partner_balance.py b/account_financial_report/tests/test_aged_partner_balance.py index 69b868068852..826658d9ba9f 100644 --- a/account_financial_report/tests/test_aged_partner_balance.py +++ b/account_financial_report/tests/test_aged_partner_balance.py @@ -1,4 +1,5 @@ # Copyright 2021 Simone Rubino - Agile Business Group +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.tests import TransactionCase @@ -20,15 +21,41 @@ def setUpClass(cls): ) ) cls.wizard_model = cls.env["aged.partner.balance.report.wizard"] - - def test_report(self): - """Check that report is produced correctly.""" - wizard = self.wizard_model.create( + cls.wizard_with_line_details = cls.wizard_model.create( { "show_move_line_details": True, "receivable_accounts_only": True, } ) + cls.wizard_without_line_details = cls.wizard_model.create( + { + "show_move_line_details": False, + "receivable_accounts_only": True, + } + ) + cls.account_age_report_config = cls.env[ + "account.age.report.configuration" + ].create( + { + "name": "Intervals configuration", + "line_ids": [ + ( + 0, + 0, + { + "name": "1-30", + "code": "30_days", + "superior_limit": 30, + }, + ), + ], + } + ) + + def test_report_without_aged_report_configuration(self): + """Check that report is produced correctly.""" + wizard = self.wizard_with_line_details + wizard.onchange_type_accounts_only() data = wizard._prepare_report_aged_partner_balance() @@ -43,3 +70,58 @@ def test_report(self): data=data, ) self.assertTrue(result) + + second_wizard = self.wizard_without_line_details + + second_wizard.onchange_type_accounts_only() + data = second_wizard._prepare_report_aged_partner_balance() + + # Simulate web client behavior: + # default value is a datetime.date but web client sends back strings + data.update({"date_at": data["date_at"].strftime(DEFAULT_SERVER_DATE_FORMAT)}) + result = test_reports.try_report( + self.env.cr, + self.env.uid, + "account_financial_report.aged_partner_balance", + second_wizard.ids, + data=data, + ) + self.assertTrue(result) + + def test_report_with_aged_report_configuration(self): + """Check that report is produced correctly.""" + wizard = self.wizard_with_line_details + wizard.age_partner_config_id = self.account_age_report_config.id + + wizard.onchange_type_accounts_only() + data = wizard._prepare_report_aged_partner_balance() + + # Simulate web client behavior: + # default value is a datetime.date but web client sends back strings + data.update({"date_at": data["date_at"].strftime(DEFAULT_SERVER_DATE_FORMAT)}) + result = test_reports.try_report( + self.env.cr, + self.env.uid, + "account_financial_report.aged_partner_balance", + wizard.ids, + data=data, + ) + self.assertTrue(result) + + second_wizard = self.wizard_without_line_details + second_wizard.age_partner_config_id = self.account_age_report_config.id + + second_wizard.onchange_type_accounts_only() + data = second_wizard._prepare_report_aged_partner_balance() + + # Simulate web client behavior: + # default value is a datetime.date but web client sends back strings + data.update({"date_at": data["date_at"].strftime(DEFAULT_SERVER_DATE_FORMAT)}) + result = test_reports.try_report( + self.env.cr, + self.env.uid, + "account_financial_report.aged_partner_balance", + second_wizard.ids, + data=data, + ) + self.assertTrue(result) diff --git a/account_financial_report/view/account_age_report_configuration_views.xml b/account_financial_report/view/account_age_report_configuration_views.xml index 58412efb6ef9..426b3a9cdb24 100644 --- a/account_financial_report/view/account_age_report_configuration_views.xml +++ b/account_financial_report/view/account_age_report_configuration_views.xml @@ -1,5 +1,6 @@ @@ -12,12 +13,10 @@ - - @@ -25,4 +24,22 @@ + + + Age partner report configuration tree + account.age.report.configuration + + + + + + + + + + Age Partner Report Configuration + account.age.report.configuration + tree,form + + diff --git a/account_financial_report/view/res_config_settings_views.xml b/account_financial_report/view/res_config_settings_views.xml new file mode 100644 index 000000000000..91509e85fa19 --- /dev/null +++ b/account_financial_report/view/res_config_settings_views.xml @@ -0,0 +1,56 @@ + + + + + res.config.settings + + + +

    +

    OCA Aged Report Configuration

    +
    +
    +
    +
    + Intervals configuration +
    + Here you can set the intervals that will appear on the Aged Partner Balance. +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + diff --git a/account_financial_report/wizard/aged_partner_balance_wizard.py b/account_financial_report/wizard/aged_partner_balance_wizard.py index d83cf27bd28a..8333e13a7b7e 100644 --- a/account_financial_report/wizard/aged_partner_balance_wizard.py +++ b/account_financial_report/wizard/aged_partner_balance_wizard.py @@ -40,7 +40,9 @@ class AgedPartnerBalanceWizard(models.TransientModel): comodel_name="account.account", help="Ending account in a range", ) - age_partner_config_id = fields.Many2one("account.age.report.configuration") + age_partner_config_id = fields.Many2one( + "account.age.report.configuration", string="Intervals configuration" + ) @api.onchange("account_code_from", "account_code_to") def on_change_account_range(self): diff --git a/account_financial_report/wizard/aged_partner_balance_wizard_view.xml b/account_financial_report/wizard/aged_partner_balance_wizard_view.xml index 686c9c658174..12b1900dd11d 100644 --- a/account_financial_report/wizard/aged_partner_balance_wizard_view.xml +++ b/account_financial_report/wizard/aged_partner_balance_wizard_view.xml @@ -31,10 +31,10 @@ widget="many2many_tags" options="{'no_create': True}" /> -