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
@@ -20,67 +20,84 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
20
20
  report_name = report_name + suffix
21
21
  return report_name
22
22
 
23
- def _get_report_columns(self, report):
24
- if not report.show_move_line_details:
25
- return {
26
- 0: {"header": _("Partner"), "field": "name", "width": 70},
27
- 1: {
28
- "header": _("Residual"),
29
- "field": "residual",
30
- "field_footer_total": "residual",
31
- "type": "amount",
32
- "width": 14,
33
- },
34
- 2: {
35
- "header": _("Current"),
36
- "field": "current",
37
- "field_footer_total": "current",
38
- "field_footer_percent": "percent_current",
39
- "type": "amount",
40
- "width": 14,
41
- },
42
- 3: {
43
- "header": _("Age ??? 30 d."),
44
- "field": "30_days",
45
- "field_footer_total": "30_days",
46
- "field_footer_percent": "percent_30_days",
47
- "type": "amount",
48
- "width": 14,
49
- },
50
- 4: {
51
- "header": _("Age ??? 60 d."),
52
- "field": "60_days",
53
- "field_footer_total": "60_days",
54
- "field_footer_percent": "percent_60_days",
55
- "type": "amount",
56
- "width": 14,
57
- },
58
- 5: {
59
- "header": _("Age ??? 90 d."),
60
- "field": "90_days",
61
- "field_footer_total": "90_days",
62
- "field_footer_percent": "percent_90_days",
63
- "type": "amount",
64
- "width": 14,
65
- },
66
- 6: {
67
- "header": _("Age ??? 120 d."),
68
- "field": "120_days",
69
- "field_footer_total": "120_days",
70
- "field_footer_percent": "percent_120_days",
71
- "type": "amount",
72
- "width": 14,
73
- },
74
- 7: {
75
- "header": _("Older"),
76
- "field": "older",
77
- "field_footer_total": "older",
78
- "field_footer_percent": "percent_older",
79
- "type": "amount",
80
- "width": 14,
81
- },
23
+ def _get_report_columns_without_move_line_details(self, report, column_index):
24
+ report_columns = {
25
+ 0: {"header": _("Partner"), "field": "name", "width": 70},
26
+ 1: {
27
+ "header": _("Residual"),
28
+ "field": "residual",
29
+ "field_footer_total": "residual",
30
+ "type": "amount",
31
+ "width": 14,
32
+ },
33
+ 2: {
34
+ "header": _("Current"),
35
+ "field": "current",
36
+ "field_footer_total": "current",
37
+ "field_footer_percent": "percent_current",
38
+ "type": "amount",
39
+ "width": 14,
40
+ },
41
+ }
42
+ if not report.age_partner_config_id:
43
+ report_columns.update(
44
+ {
45
+ 3: {
46
+ "header": _("Age ≤ 30 d."),
47
+ "field": "30_days",
48
+ "field_footer_total": "30_days",
49
+ "field_footer_percent": "percent_30_days",
50
+ "type": "amount",
51
+ "width": 14,
52
+ },
53
+ 4: {
54
+ "header": _("Age ≤ 60 d."),
55
+ "field": "60_days",
56
+ "field_footer_total": "60_days",
57
+ "field_footer_percent": "percent_60_days",
58
+ "type": "amount",
59
+ "width": 14,
60
+ },
61
+ 5: {
62
+ "header": _("Age ≤ 90 d."),
63
+ "field": "90_days",
64
+ "field_footer_total": "90_days",
65
+ "field_footer_percent": "percent_90_days",
66
+ "type": "amount",
67
+ "width": 14,
68
+ },
69
+ 6: {
70
+ "header": _("Age ≤ 120 d."),
71
+ "field": "120_days",
72
+ "field_footer_total": "120_days",
73
+ "field_footer_percent": "percent_120_days",
74
+ "type": "amount",
75
+ "width": 14,
76
+ },
77
+ 7: {
78
+ "header": _("Older"),
79
+ "field": "older",
80
+ "field_footer_total": "older",
81
+ "field_footer_percent": "percent_older",
82
+ "type": "amount",
83
+ "width": 14,
84
+ },
85
+ }
86
+ )
87
+ for interval in report.age_partner_config_id.line_ids:
88
+ report_columns[column_index] = {
89
+ "header": interval.name,
90
+ "field": interval,
91
+ "field_footer_total": interval,
92
+ "field_footer_percent": f"percent_{interval.id}",
93
+ "type": "amount",
94
+ "width": 14,
82
95
  }
83
- return {
96
+ column_index += 1
97
+ return report_columns
98
+
99
+ def _get_report_columns_with_move_line_details(self, report, column_index):
100
+ report_columns = {
84
101
  0: {"header": _("Date"), "field": "date", "width": 11},
85
102
  1: {"header": _("Entry"), "field": "entry", "width": 18},
86
103
  2: {"header": _("Journal"), "field": "journal", "width": 8},
@@ -105,52 +122,75 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
105
122
  "type": "amount",
106
123
  "width": 14,
107
124
  },
108
- 9: {
109
- "header": _("Age ??? 30 d."),
110
- "field": "30_days",
111
- "field_footer_total": "30_days",
112
- "field_footer_percent": "percent_30_days",
113
- "field_final_balance": "30_days",
114
- "type": "amount",
115
- "width": 14,
116
- },
117
- 10: {
118
- "header": _("Age ??? 60 d."),
119
- "field": "60_days",
120
- "field_footer_total": "60_days",
121
- "field_footer_percent": "percent_60_days",
122
- "field_final_balance": "60_days",
123
- "type": "amount",
124
- "width": 14,
125
- },
126
- 11: {
127
- "header": _("Age ??? 90 d."),
128
- "field": "90_days",
129
- "field_footer_total": "90_days",
130
- "field_footer_percent": "percent_90_days",
131
- "field_final_balance": "90_days",
132
- "type": "amount",
133
- "width": 14,
134
- },
135
- 12: {
136
- "header": _("Age ??? 120 d."),
137
- "field": "120_days",
138
- "field_footer_total": "120_days",
139
- "field_footer_percent": "percent_120_days",
140
- "field_final_balance": "120_days",
141
- "type": "amount",
142
- "width": 14,
143
- },
144
- 13: {
145
- "header": _("Older"),
146
- "field": "older",
147
- "field_footer_total": "older",
148
- "field_footer_percent": "percent_older",
149
- "field_final_balance": "older",
125
+ }
126
+ if not report.age_partner_config_id:
127
+ report_columns.update(
128
+ {
129
+ 9: {
130
+ "header": _("Age ≤ 30 d."),
131
+ "field": "30_days",
132
+ "field_footer_total": "30_days",
133
+ "field_footer_percent": "percent_30_days",
134
+ "field_final_balance": "30_days",
135
+ "type": "amount",
136
+ "width": 14,
137
+ },
138
+ 10: {
139
+ "header": _("Age ≤ 60 d."),
140
+ "field": "60_days",
141
+ "field_footer_total": "60_days",
142
+ "field_footer_percent": "percent_60_days",
143
+ "field_final_balance": "60_days",
144
+ "type": "amount",
145
+ "width": 14,
146
+ },
147
+ 11: {
148
+ "header": _("Age ≤ 90 d."),
149
+ "field": "90_days",
150
+ "field_footer_total": "90_days",
151
+ "field_footer_percent": "percent_90_days",
152
+ "field_final_balance": "90_days",
153
+ "type": "amount",
154
+ "width": 14,
155
+ },
156
+ 12: {
157
+ "header": _("Age ≤ 120 d."),
158
+ "field": "120_days",
159
+ "field_footer_total": "120_days",
160
+ "field_footer_percent": "percent_120_days",
161
+ "field_final_balance": "120_days",
162
+ "type": "amount",
163
+ "width": 14,
164
+ },
165
+ 13: {
166
+ "header": _("Older"),
167
+ "field": "older",
168
+ "field_footer_total": "older",
169
+ "field_footer_percent": "percent_older",
170
+ "field_final_balance": "older",
171
+ "type": "amount",
172
+ "width": 14,
173
+ },
174
+ }
175
+ )
176
+ for interval in report.age_partner_config_id.line_ids:
177
+ report_columns[column_index] = {
178
+ "header": interval.name,
179
+ "field": interval,
180
+ "field_footer_total": interval,
181
+ "field_footer_percent": f"percent_{interval.id}",
150
182
  "type": "amount",
151
183
  "width": 14,
152
- },
153
- }
184
+ }
185
+ column_index += 1
186
+ return report_columns
187
+
188
+ def _get_report_columns(self, report):
189
+ if not report.show_move_line_details:
190
+ return self._get_report_columns_without_move_line_details(
191
+ report, column_index=3
192
+ )
193
+ return self._get_report_columns_with_move_line_details(report, column_index=9)
154
194
 
155
195
  def _get_report_filters(self, report):
156
196
  return [