odoo-addon-account-financial-report 17.0.1.0.0.13__py3-none-any.whl → 17.0.1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of odoo-addon-account-financial-report might be problematic. Click here for more details.

Files changed (27) hide show
  1. odoo/addons/account_financial_report/README.rst +38 -1
  2. odoo/addons/account_financial_report/__manifest__.py +4 -1
  3. odoo/addons/account_financial_report/i18n/account_financial_report.pot +111 -13
  4. odoo/addons/account_financial_report/i18n/es.po +112 -3
  5. odoo/addons/account_financial_report/models/__init__.py +2 -0
  6. odoo/addons/account_financial_report/models/account_age_report_configuration.py +47 -0
  7. odoo/addons/account_financial_report/models/res_config_settings.py +14 -0
  8. odoo/addons/account_financial_report/readme/CONFIGURE.md +26 -0
  9. odoo/addons/account_financial_report/readme/CONTRIBUTORS.md +1 -0
  10. odoo/addons/account_financial_report/readme/DESCRIPTION.md +4 -0
  11. odoo/addons/account_financial_report/report/aged_partner_balance.py +79 -3
  12. odoo/addons/account_financial_report/report/aged_partner_balance_xlsx.py +144 -104
  13. odoo/addons/account_financial_report/report/templates/aged_partner_balance.xml +428 -333
  14. odoo/addons/account_financial_report/security/ir.model.access.csv +2 -0
  15. odoo/addons/account_financial_report/security/security.xml +8 -0
  16. odoo/addons/account_financial_report/static/description/index.html +47 -21
  17. odoo/addons/account_financial_report/tests/__init__.py +1 -0
  18. odoo/addons/account_financial_report/tests/test_age_report_configuration.py +42 -0
  19. odoo/addons/account_financial_report/tests/test_aged_partner_balance.py +84 -5
  20. odoo/addons/account_financial_report/view/account_age_report_configuration_views.xml +41 -0
  21. odoo/addons/account_financial_report/view/res_config_settings_views.xml +51 -0
  22. odoo/addons/account_financial_report/wizard/aged_partner_balance_wizard.py +4 -0
  23. odoo/addons/account_financial_report/wizard/aged_partner_balance_wizard_view.xml +2 -3
  24. {odoo_addon_account_financial_report-17.0.1.0.0.13.dist-info → odoo_addon_account_financial_report-17.0.1.1.0.dist-info}/METADATA +39 -2
  25. {odoo_addon_account_financial_report-17.0.1.0.0.13.dist-info → odoo_addon_account_financial_report-17.0.1.1.0.dist-info}/RECORD +27 -20
  26. {odoo_addon_account_financial_report-17.0.1.0.0.13.dist-info → odoo_addon_account_financial_report-17.0.1.1.0.dist-info}/WHEEL +0 -0
  27. {odoo_addon_account_financial_report-17.0.1.0.0.13.dist-info → odoo_addon_account_financial_report-17.0.1.1.0.dist-info}/top_level.txt +0 -0
@@ -53,6 +53,11 @@ msgstr "91 - 120 d."
53
53
  msgid "<b>Taxes summary</b>"
54
54
  msgstr "<b>Resumen de Impuestos</b>"
55
55
 
56
+ #. module: account_financial_report
57
+ #: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form
58
+ msgid "<span class=\"o_form_label\">Intervals configuration</span>"
59
+ msgstr "<span class=\"o_form_label\">Configuración de intervalos</span>"
60
+
56
61
  #. module: account_financial_report
57
62
  #: model_terms:ir.ui.view,arch_db:account_financial_report.aged_partner_balance_wizard
58
63
  #: model_terms:ir.ui.view,arch_db:account_financial_report.general_ledger_wizard
@@ -93,6 +98,11 @@ msgstr "Extracto XLSX Account Financial Report"
93
98
  msgid "Account"
94
99
  msgstr "Cuenta"
95
100
 
101
+ #. module: account_financial_report
102
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__account_age_report_config_id
103
+ msgid "Account Age Report Config"
104
+ msgstr "Configuración del informe de calidad de deuda"
105
+
96
106
  #. module: account_financial_report
97
107
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__account_code_from
98
108
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__account_code_from
@@ -427,6 +437,7 @@ msgstr "C??digo"
427
437
  #. module: account_financial_report
428
438
  #. odoo-python
429
439
  #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0
440
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__company_id
430
441
  #: model:ir.model.fields,field_description:account_financial_report.field_account_financial_report_abstract_wizard__company_id
431
442
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__company_id
432
443
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__company_id
@@ -444,6 +455,18 @@ msgid "Compute accounts"
444
455
  msgstr "Cuentas calculadas"
445
456
 
446
457
  #. module: account_financial_report
458
+ #: model:ir.model,name:account_financial_report.model_res_config_settings
459
+ msgid "Config Settings"
460
+ msgstr "Ajustes de configuración"
461
+
462
+ #. module: account_financial_report
463
+ #: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form
464
+ msgid "Configurations"
465
+ msgstr "Configuraciones"
466
+
467
+ #. module: account_financial_report
468
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__create_uid
469
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__create_uid
447
470
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__create_uid
448
471
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__create_uid
449
472
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__create_uid
@@ -454,6 +477,8 @@ msgid "Created by"
454
477
  msgstr "Creado por"
455
478
 
456
479
  #. module: account_financial_report
480
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__create_date
481
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__create_date
457
482
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__create_date
458
483
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__create_date
459
484
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__create_date
@@ -468,6 +493,7 @@ msgstr "Creado el"
468
493
  #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
469
494
  #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0
470
495
  #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
496
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
471
497
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_general_ledger_lines
472
498
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_all_taxes
473
499
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_ledger_journal_table_header
@@ -528,6 +554,7 @@ msgstr "Moneda"
528
554
  #. module: account_financial_report
529
555
  #. odoo-python
530
556
  #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
557
+ #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
531
558
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines
532
559
  #, python-format
533
560
  msgid "Current"
@@ -618,6 +645,7 @@ msgstr "Hasta"
618
645
  #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
619
646
  #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0
620
647
  #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
648
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
621
649
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_general_ledger_lines
622
650
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_all_taxes
623
651
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_ledger_journal_table_header
@@ -642,6 +670,8 @@ msgid "Detail Taxes"
642
670
  msgstr "Detalle de impuestos"
643
671
 
644
672
  #. module: account_financial_report
673
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__display_name
674
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__display_name
645
675
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__display_name
646
676
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__display_name
647
677
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__display_name
@@ -727,6 +757,9 @@ msgstr "Cuenta final en un rango"
727
757
  #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
728
758
  #: code:addons/account_financial_report/report/open_items_xlsx.py:0
729
759
  #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
760
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
761
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
762
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
730
763
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_general_ledger_ending_cumul
731
764
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_trial_balance_lines_header
732
765
  #, python-format
@@ -773,6 +806,7 @@ msgstr "N??mero de asiento"
773
806
  #. module: account_financial_report
774
807
  #. odoo-javascript
775
808
  #: code:addons/account_financial_report/static/src/xml/report.xml:0
809
+ #: code:addons/account_financial_report/static/src/xml/report.xml:0
776
810
  #, python-format
777
811
  msgid "Export"
778
812
  msgstr "Exportar"
@@ -918,8 +952,7 @@ msgid ""
918
952
  " only one unaffected earnings account."
919
953
  msgstr ""
920
954
  "El Libro mayor solo se puede calcular si la empresa seleccionada tiene \n"
921
- " solo una cuenta "
922
- "de resultados no afectados."
955
+ " solo una cuenta de resultados no afectados."
923
956
 
924
957
  #. module: account_financial_report
925
958
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__group_option
@@ -931,6 +964,12 @@ msgstr "Agrupar por"
931
964
  msgid "Grouped By"
932
965
  msgstr "Agrupado por"
933
966
 
967
+ #. module: account_financial_report
968
+ #: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form
969
+ msgid ""
970
+ "Here you can set the intervals that will appear on the Aged Partner Balance."
971
+ msgstr "Aquí puede configurar los intervalos que aparecerán en el informe de Calidad de la deuda."
972
+
934
973
  #. module: account_financial_report
935
974
  #. odoo-python
936
975
  #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
@@ -960,6 +999,8 @@ msgid "Hierarchy Levels to display"
960
999
  msgstr "Niveles de Jerarqu??a a mostrar"
961
1000
 
962
1001
  #. module: account_financial_report
1002
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__id
1003
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__id
963
1004
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__id
964
1005
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__id
965
1006
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__id
@@ -978,6 +1019,18 @@ msgstr ""
978
1019
  "Si se marca, no se mostrar??n detalles en el informe del libro mayor (solo "
979
1020
  "el webkit), solo importes centralizados por per??odo."
980
1021
 
1022
+ #. module: account_financial_report
1023
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__inferior_limit
1024
+ msgid "Inferior Limit"
1025
+ msgstr "Límite inferior"
1026
+
1027
+ #. module: account_financial_report
1028
+ #. odoo-python
1029
+ #: code:addons/account_financial_report/models/account_age_report_configuration.py:0
1030
+ #, python-format
1031
+ msgid "Inferior Limit must be greather than zero"
1032
+ msgstr "El límite inferior debe ser mayor que cero"
1033
+
981
1034
  #. module: account_financial_report
982
1035
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_trial_balance_lines_header
983
1036
  msgid ""
@@ -1000,11 +1053,20 @@ msgstr ""
1000
1053
  #. odoo-python
1001
1054
  #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
1002
1055
  #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
1056
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
1057
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
1058
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
1003
1059
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_general_ledger_lines
1004
1060
  #, python-format
1005
1061
  msgid "Initial balance"
1006
1062
  msgstr "Saldo inicial"
1007
1063
 
1064
+ #. module: account_financial_report
1065
+ #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1066
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1067
+ msgid "Intervals configuration"
1068
+ msgstr "Configuración de intervalos"
1069
+
1008
1070
  #. module: account_financial_report
1009
1071
  #. odoo-python
1010
1072
  #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
@@ -1074,6 +1136,8 @@ msgid "Journals"
1074
1136
  msgstr "Diarios"
1075
1137
 
1076
1138
  #. module: account_financial_report
1139
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__write_uid
1140
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__write_uid
1077
1141
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__write_uid
1078
1142
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__write_uid
1079
1143
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__write_uid
@@ -1084,6 +1148,8 @@ msgid "Last Updated by"
1084
1148
  msgstr "??ltima actualizaci??n por"
1085
1149
 
1086
1150
  #. module: account_financial_report
1151
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__write_date
1152
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__write_date
1087
1153
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__write_date
1088
1154
  #: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__write_date
1089
1155
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__write_date
@@ -1115,15 +1181,32 @@ msgstr "Nivel %s"
1115
1181
  msgid "Limit hierarchy levels"
1116
1182
  msgstr "Limitar niveles de jerarqu??a"
1117
1183
 
1184
+ #. module: account_financial_report
1185
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__line_ids
1186
+ msgid "Line"
1187
+ msgstr "Línea"
1188
+
1118
1189
  #. module: account_financial_report
1119
1190
  #. odoo-python
1120
1191
  #: code:addons/account_financial_report/report/general_ledger.py:0
1192
+ #: code:addons/account_financial_report/report/general_ledger.py:0
1121
1193
  #: code:addons/account_financial_report/report/open_items.py:0
1122
1194
  #: code:addons/account_financial_report/report/trial_balance.py:0
1195
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1123
1196
  #, python-format
1124
1197
  msgid "Missing Partner"
1125
1198
  msgstr ""
1126
1199
 
1200
+ #. module: account_financial_report
1201
+ #: model:ir.model,name:account_financial_report.model_account_age_report_configuration_line
1202
+ msgid "Model to set interval lines for Age partner balance report"
1203
+ msgstr "Modelo para establecer líneas de intervalo para el informe de Calidad de deuda"
1204
+
1205
+ #. module: account_financial_report
1206
+ #: model:ir.model,name:account_financial_report.model_account_age_report_configuration
1207
+ msgid "Model to set intervals for Age partner balance report"
1208
+ msgstr "Modelo para establecer intervalos en el informe de Calidad de deuda"
1209
+
1127
1210
  #. module: account_financial_report
1128
1211
  #: model:ir.model.fields,field_description:account_financial_report.field_journal_ledger_report_wizard__move_target
1129
1212
  msgid "Move Target"
@@ -1134,10 +1217,19 @@ msgstr "Asiento Objetivo"
1134
1217
  msgid "Moves"
1135
1218
  msgstr "Asientos"
1136
1219
 
1220
+ #. module: account_financial_report
1221
+ #. odoo-python
1222
+ #: code:addons/account_financial_report/models/account_age_report_configuration.py:0
1223
+ #, python-format
1224
+ msgid "Must complete Configuration Lines"
1225
+ msgstr "Debe completar las líneas de configuración"
1226
+
1137
1227
  #. module: account_financial_report
1138
1228
  #. odoo-python
1139
1229
  #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0
1140
1230
  #: code:addons/account_financial_report/report/vat_report_xlsx.py:0
1231
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration__name
1232
+ #: model:ir.model.fields,field_description:account_financial_report.field_account_age_report_configuration_line__name
1141
1233
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_all_taxes
1142
1234
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_journal_ledger_journal_taxes
1143
1235
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_vat_report_base
@@ -1145,6 +1237,13 @@ msgstr "Asientos"
1145
1237
  msgid "Name"
1146
1238
  msgstr "Nombre"
1147
1239
 
1240
+ #. module: account_financial_report
1241
+ #. odoo-python
1242
+ #: code:addons/account_financial_report/models/account_age_report_configuration.py:0
1243
+ #, python-format
1244
+ msgid "Name must be unique per report configuration"
1245
+ msgstr "El nombre debe ser único por cada configuración del informe"
1246
+
1148
1247
  #. module: account_financial_report
1149
1248
  #. odoo-python
1150
1249
  #: code:addons/account_financial_report/report/vat_report_xlsx.py:0
@@ -1195,6 +1294,11 @@ msgstr "Sin Postear"
1195
1294
  msgid "Not due"
1196
1295
  msgstr "Deuda"
1197
1296
 
1297
+ #. module: account_financial_report
1298
+ #: model_terms:ir.ui.view,arch_db:account_financial_report.res_config_settings_view_form
1299
+ msgid "OCA Aged Report Configuration"
1300
+ msgstr "Configuración del informe Calidad de deuda OCA"
1301
+
1198
1302
  #. module: account_financial_report
1199
1303
  #: model:ir.ui.menu,name:account_financial_report.menu_oca_reports
1200
1304
  msgid "OCA accounting reports"
@@ -1203,6 +1307,7 @@ msgstr "Informes de contabilidad OCA"
1203
1307
  #. module: account_financial_report
1204
1308
  #. odoo-python
1205
1309
  #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
1310
+ #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
1206
1311
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines
1207
1312
  #, python-format
1208
1313
  msgid "Older"
@@ -1271,6 +1376,7 @@ msgstr "Inicial"
1271
1376
  #. module: account_financial_report
1272
1377
  #. odoo-python
1273
1378
  #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
1379
+ #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
1274
1380
  #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
1275
1381
  #: code:addons/account_financial_report/report/journal_ledger_xlsx.py:0
1276
1382
  #: code:addons/account_financial_report/report/open_items_xlsx.py:0
@@ -1344,6 +1450,7 @@ msgstr "Porcentajes"
1344
1450
  #. module: account_financial_report
1345
1451
  #. odoo-python
1346
1452
  #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
1453
+ #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
1347
1454
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_trial_balance_lines_header
1348
1455
  #, python-format
1349
1456
  msgid "Period balance"
@@ -1410,11 +1517,12 @@ msgstr "Ref - Etiqueta"
1410
1517
  #. module: account_financial_report
1411
1518
  #: model:ir.model,name:account_financial_report.model_ir_actions_report
1412
1519
  msgid "Report Action"
1413
- msgstr "Acci??n Informe"
1520
+ msgstr "Acción de informe"
1414
1521
 
1415
1522
  #. module: account_financial_report
1416
1523
  #. odoo-python
1417
1524
  #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
1525
+ #: code:addons/account_financial_report/report/aged_partner_balance_xlsx.py:0
1418
1526
  #: code:addons/account_financial_report/report/open_items_xlsx.py:0
1419
1527
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_lines_header
1420
1528
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_move_lines
@@ -1817,6 +1925,7 @@ msgstr "Cuenta con Nombre"
1817
1925
  #. module: account_financial_report
1818
1926
  #. odoo-python
1819
1927
  #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
1928
+ #: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
1820
1929
  #: code:addons/account_financial_report/report/open_items_xlsx.py:0
1821
1930
  #: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
1822
1931
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_general_ledger_filters
@@ -1,4 +1,6 @@
1
+ from . import account_age_report_configuration
1
2
  from . import account_group
2
3
  from . import account
3
4
  from . import account_move_line
4
5
  from . import ir_actions_report
6
+ from . import res_config_settings
@@ -0,0 +1,47 @@
1
+ # Copyright 2023 Ernesto García
2
+ # Copyright 2023 Carolina Fernandez
3
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4
+ from odoo import _, api, fields, models
5
+ from odoo.exceptions import ValidationError
6
+
7
+
8
+ class AccountAgeReportConfiguration(models.Model):
9
+ _name = "account.age.report.configuration"
10
+ _description = "Model to set intervals for Age partner balance report"
11
+
12
+ name = fields.Char(required=True)
13
+ company_id = fields.Many2one(
14
+ "res.company", default=lambda self: self.env.company, readonly=True
15
+ )
16
+ line_ids = fields.One2many(
17
+ "account.age.report.configuration.line", "account_age_report_config_id"
18
+ )
19
+
20
+ @api.constrains("line_ids")
21
+ def _check_line_ids(self):
22
+ for rec in self:
23
+ if not rec.line_ids:
24
+ raise ValidationError(_("Must complete Configuration Lines"))
25
+
26
+
27
+ class AccountAgeReportConfigurationLine(models.Model):
28
+ _name = "account.age.report.configuration.line"
29
+ _description = "Model to set interval lines for Age partner balance report"
30
+
31
+ name = fields.Char(required=True)
32
+ account_age_report_config_id = fields.Many2one("account.age.report.configuration")
33
+ inferior_limit = fields.Integer()
34
+
35
+ @api.constrains("inferior_limit")
36
+ def _check_inferior_limit(self):
37
+ for rec in self:
38
+ if rec.inferior_limit <= 0:
39
+ raise ValidationError(_("Inferior Limit must be greather than zero"))
40
+
41
+ _sql_constraints = [
42
+ (
43
+ "unique_name_config_combination",
44
+ "UNIQUE(name,account_age_report_config_id)",
45
+ _("Name must be unique per report configuration"),
46
+ )
47
+ ]
@@ -0,0 +1,14 @@
1
+ # Copyright 2023 Tecnativa - Carolina Fernandez
2
+ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
3
+
4
+ from odoo import fields, models
5
+
6
+
7
+ class ResConfigSettings(models.TransientModel):
8
+ _inherit = "res.config.settings"
9
+
10
+ default_age_partner_config_id = fields.Many2one(
11
+ "account.age.report.configuration",
12
+ string="Intervals configuration",
13
+ default_model="aged.partner.balance.report.wizard",
14
+ )
@@ -0,0 +1,26 @@
1
+ To configure dynamic intervals for Aged Partner Balance you need to:
2
+
3
+ Go on 'Settings' -> 'Invoicing' -> 'OCA Aged Report Configuration'.
4
+
5
+ Click on option 'Configurations' and create new record.
6
+
7
+ Create new interval.
8
+ The name established on line will be the column to display in Aged Partner Balance.
9
+ Inferior limit established on line is the interval
10
+
11
+ Example of configuration inferior limit:
12
+
13
+ -> 15
14
+ -> 30
15
+ -> 60
16
+
17
+ It means the first interval is from 0 to 15, the second from 16 to 30, and the third is 61+.
18
+
19
+ Go on 'Invoicing' -> 'Reports' -> 'OCA accounting reports' -> 'Aged Partner Balance'
20
+
21
+ When wizard is open, you need to select your interval configuration and print report.
22
+
23
+ If you want to get default interval configuration any time you wish to print Aged Partner Report,
24
+ you can set default interval configuration per company in:
25
+
26
+ 'Settings' -> 'Invoicing' -> 'OCA Aged Report Configuration'.
@@ -23,6 +23,7 @@
23
23
  - Jo??o Marques
24
24
  - Alexandre D. D??az
25
25
  - V??ctor Mart??nez
26
+ - Carolina Fernandez
26
27
  - [Sygel](https://www.sygel.es):
27
28
  - Harald Panten
28
29
  - Valentin Vinagre
@@ -15,3 +15,7 @@ properly shown.
15
15
 
16
16
  In case that in an account has not been configured a second currency
17
17
  foreign currency balances are not available.
18
+
19
+ Invoicing / Settings / Invoicing / OCA Aged Report Configuration you will be able to set
20
+ dynamic intervals that will appear on the Aged Partner Balance.
21
+ For further information, check CONFIGURE.rst
@@ -25,6 +25,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
25
25
  ag_pb_data[acc_id]["90_days"] = 0.0
26
26
  ag_pb_data[acc_id]["120_days"] = 0.0
27
27
  ag_pb_data[acc_id]["older"] = 0.0
28
+ for interval_line in self.env.context["age_partner_config"].line_ids:
29
+ ag_pb_data[acc_id][interval_line] = 0.0
28
30
  return ag_pb_data
29
31
 
30
32
  @api.model
@@ -39,6 +41,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
39
41
  ag_pb_data[acc_id][prt_id]["120_days"] = 0.0
40
42
  ag_pb_data[acc_id][prt_id]["older"] = 0.0
41
43
  ag_pb_data[acc_id][prt_id]["move_lines"] = []
44
+ for interval_line in self.env.context["age_partner_config"].line_ids:
45
+ ag_pb_data[acc_id][prt_id][interval_line] = 0.0
42
46
  return ag_pb_data
43
47
 
44
48
  @api.model
@@ -47,6 +51,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
47
51
  ):
48
52
  ag_pb_data[acc_id]["residual"] += residual
49
53
  ag_pb_data[acc_id][prt_id]["residual"] += residual
54
+ interval_lines = self.env.context["age_partner_config"].line_ids
50
55
  today = date_at_object
51
56
  if not due_date or today <= due_date:
52
57
  ag_pb_data[acc_id]["current"] += residual
@@ -66,8 +71,34 @@ class AgedPartnerBalanceReport(models.AbstractModel):
66
71
  else:
67
72
  ag_pb_data[acc_id]["older"] += residual
68
73
  ag_pb_data[acc_id][prt_id]["older"] += residual
74
+ if due_date:
75
+ days_difference = abs((today - due_date).days)
76
+ for index, line in enumerate(interval_lines):
77
+ lower_limit = (
78
+ 0 if not index else interval_lines[index - 1].inferior_limit
79
+ )
80
+ next_line = (
81
+ interval_lines[index] if index < len(interval_lines) else None
82
+ )
83
+ interval_range = self._get_values_for_range_intervals(
84
+ lower_limit, next_line.inferior_limit
85
+ )
86
+ if (
87
+ days_difference in interval_range
88
+ or days_difference == line.inferior_limit
89
+ ):
90
+ ag_pb_data[acc_id][line] += residual
91
+ ag_pb_data[acc_id][prt_id][line] += residual
92
+ break
69
93
  return ag_pb_data
70
94
 
95
+ def _get_values_for_range_intervals(self, num1, num2):
96
+ min_num = min(num1, num2)
97
+ max_num = max(num1, num2)
98
+ if abs(num2 - num1) == 1:
99
+ return [max_num]
100
+ return list(range(min_num + 1, max_num))
101
+
71
102
  def _get_account_partial_reconciled(self, company_id, date_at_object):
72
103
  domain = [("max_date", ">", date_at_object), ("company_id", "=", company_id)]
73
104
  fields = [
@@ -235,6 +266,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
235
266
  "older": 0.0,
236
267
  }
237
268
  )
269
+ interval_lines = self.env.context["age_partner_config"].line_ids
270
+ for interval_line in interval_lines:
271
+ ml[interval_line] = 0.0
238
272
  due_date = ml["due_date"]
239
273
  amount = ml["residual"]
240
274
  today = date_at_object
@@ -250,6 +284,24 @@ class AgedPartnerBalanceReport(models.AbstractModel):
250
284
  ml["120_days"] += amount
251
285
  else:
252
286
  ml["older"] += amount
287
+ if due_date:
288
+ days_difference = abs((today - due_date).days)
289
+ for index, interval_line in enumerate(interval_lines):
290
+ lower_limit = (
291
+ 0 if not index else interval_lines[index - 1].inferior_limit
292
+ )
293
+ next_line = (
294
+ interval_lines[index] if index < len(interval_lines) else None
295
+ )
296
+ interval_range = self._get_values_for_range_intervals(
297
+ lower_limit, next_line.inferior_limit
298
+ )
299
+ if (
300
+ days_difference in interval_range
301
+ or days_difference == interval_line.inferior_limit
302
+ ):
303
+ ml[interval_line] += amount
304
+ break
253
305
 
254
306
  def _create_account_list(
255
307
  self,
@@ -261,6 +313,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
261
313
  date_at_oject,
262
314
  ):
263
315
  aged_partner_data = []
316
+ interval_lines = self.env.context["age_partner_config"].line_ids
264
317
  for account in accounts_data.values():
265
318
  acc_id = account["id"]
266
319
  account.update(
@@ -275,6 +328,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
275
328
  "partners": [],
276
329
  }
277
330
  )
331
+ for interval_line in interval_lines:
332
+ account[interval_line] = ag_pb_data[acc_id][interval_line]
278
333
  for prt_id in ag_pb_data[acc_id]:
279
334
  if isinstance(prt_id, int):
280
335
  partner = {
@@ -287,6 +342,10 @@ class AgedPartnerBalanceReport(models.AbstractModel):
287
342
  "120_days": ag_pb_data[acc_id][prt_id]["120_days"],
288
343
  "older": ag_pb_data[acc_id][prt_id]["older"],
289
344
  }
345
+ for interval_line in interval_lines:
346
+ partner[interval_line] = ag_pb_data[acc_id][prt_id][
347
+ interval_line
348
+ ]
290
349
  if show_move_line_details:
291
350
  move_lines = []
292
351
  for ml in ag_pb_data[acc_id][prt_id]["move_lines"]:
@@ -306,6 +365,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
306
365
 
307
366
  @api.model
308
367
  def _calculate_percent(self, aged_partner_data):
368
+ interval_lines = self.env.context["age_partner_config"].line_ids
309
369
  for account in aged_partner_data:
310
370
  if abs(account["residual"]) > 0.01:
311
371
  total = account["residual"]
@@ -331,6 +391,10 @@ class AgedPartnerBalanceReport(models.AbstractModel):
331
391
  ),
332
392
  }
333
393
  )
394
+ for interval_line in interval_lines:
395
+ account[f"percent_{interval_line.id}"] = abs(
396
+ round((account[interval_line] / total) * 100, 2)
397
+ )
334
398
  else:
335
399
  account.update(
336
400
  {
@@ -342,6 +406,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
342
406
  "percent_older": 0.0,
343
407
  }
344
408
  )
409
+ for interval_line in interval_lines:
410
+ account[f"percent_{interval_line.id}"] = 0.0
345
411
  return aged_partner_data
346
412
 
347
413
  def _get_report_values(self, docids, data):
@@ -355,12 +421,17 @@ class AgedPartnerBalanceReport(models.AbstractModel):
355
421
  date_from = data["date_from"]
356
422
  only_posted_moves = data["only_posted_moves"]
357
423
  show_move_line_details = data["show_move_line_details"]
424
+ aged_partner_configuration = self.env[
425
+ "account.age.report.configuration"
426
+ ].browse(data["age_partner_config_id"])
358
427
  (
359
428
  ag_pb_data,
360
429
  accounts_data,
361
430
  partners_data,
362
431
  journals_data,
363
- ) = self._get_move_lines_data(
432
+ ) = self.with_context(
433
+ age_partner_config=aged_partner_configuration
434
+ )._get_move_lines_data(
364
435
  company_id,
365
436
  account_ids,
366
437
  partner_ids,
@@ -369,7 +440,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
369
440
  only_posted_moves,
370
441
  show_move_line_details,
371
442
  )
372
- aged_partner_data = self._create_account_list(
443
+ aged_partner_data = self.with_context(
444
+ age_partner_config=aged_partner_configuration
445
+ )._create_account_list(
373
446
  ag_pb_data,
374
447
  accounts_data,
375
448
  partners_data,
@@ -377,7 +450,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
377
450
  show_move_line_details,
378
451
  date_at_object,
379
452
  )
380
- aged_partner_data = self._calculate_percent(aged_partner_data)
453
+ aged_partner_data = self.with_context(
454
+ age_partner_config=aged_partner_configuration
455
+ )._calculate_percent(aged_partner_data)
381
456
  return {
382
457
  "doc_ids": [wizard_id],
383
458
  "doc_model": "open.items.report.wizard",
@@ -388,6 +463,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
388
463
  "only_posted_moves": only_posted_moves,
389
464
  "aged_partner_balance": aged_partner_data,
390
465
  "show_move_lines_details": show_move_line_details,
466
+ "age_partner_config": aged_partner_configuration,
391
467
  }
392
468
 
393
469
  def _get_ml_fields(self):