odoo-addon-account-financial-report 16.0.1.15.2.2__py3-none-any.whl → 16.0.1.16.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 (43) hide show
  1. odoo/addons/account_financial_report/README.rst +14 -1
  2. odoo/addons/account_financial_report/__manifest__.py +5 -1
  3. odoo/addons/account_financial_report/data/report_column_data.xml +358 -0
  4. odoo/addons/account_financial_report/i18n/account_financial_report.pot +125 -0
  5. odoo/addons/account_financial_report/models/__init__.py +1 -0
  6. odoo/addons/account_financial_report/models/account_financial_report_column.py +17 -0
  7. odoo/addons/account_financial_report/readme/CONTRIBUTORS.rst +1 -0
  8. odoo/addons/account_financial_report/readme/DESCRIPTION.rst +3 -0
  9. odoo/addons/account_financial_report/readme/HISTORY.rst +5 -0
  10. odoo/addons/account_financial_report/readme/ROADMAP.rst +3 -0
  11. odoo/addons/account_financial_report/report/abstract_report.py +15 -0
  12. odoo/addons/account_financial_report/report/aged_partner_balance.py +18 -12
  13. odoo/addons/account_financial_report/report/general_ledger.py +27 -24
  14. odoo/addons/account_financial_report/report/journal_ledger.py +27 -22
  15. odoo/addons/account_financial_report/report/open_items.py +24 -19
  16. odoo/addons/account_financial_report/report/templates/general_ledger.xml +116 -52
  17. odoo/addons/account_financial_report/report/templates/journal_ledger.xml +79 -31
  18. odoo/addons/account_financial_report/report/templates/open_items.xml +51 -22
  19. odoo/addons/account_financial_report/report/trial_balance.py +30 -26
  20. odoo/addons/account_financial_report/report/vat_report.py +21 -16
  21. odoo/addons/account_financial_report/security/ir.model.access.csv +1 -0
  22. odoo/addons/account_financial_report/static/description/index.html +33 -19
  23. odoo/addons/account_financial_report/tests/test_aged_partner_balance.py +4 -4
  24. odoo/addons/account_financial_report/tests/test_general_ledger.py +1 -1
  25. odoo/addons/account_financial_report/tests/test_journal_ledger.py +5 -5
  26. odoo/addons/account_financial_report/tests/test_open_items.py +1 -1
  27. odoo/addons/account_financial_report/tests/test_trial_balance.py +4 -4
  28. odoo/addons/account_financial_report/tests/test_vat_report.py +1 -1
  29. odoo/addons/account_financial_report/view/account_financial_report_column_view.xml +46 -0
  30. odoo/addons/account_financial_report/wizard/abstract_wizard.py +25 -1
  31. odoo/addons/account_financial_report/wizard/aged_partner_balance_wizard.py +17 -15
  32. odoo/addons/account_financial_report/wizard/general_ledger_wizard.py +26 -23
  33. odoo/addons/account_financial_report/wizard/general_ledger_wizard_view.xml +7 -0
  34. odoo/addons/account_financial_report/wizard/journal_ledger_wizard.py +19 -17
  35. odoo/addons/account_financial_report/wizard/journal_ledger_wizard_view.xml +48 -32
  36. odoo/addons/account_financial_report/wizard/open_items_wizard.py +20 -18
  37. odoo/addons/account_financial_report/wizard/open_items_wizard_view.xml +67 -54
  38. odoo/addons/account_financial_report/wizard/trial_balance_wizard.py +26 -24
  39. odoo/addons/account_financial_report/wizard/vat_report_wizard.py +15 -13
  40. {odoo_addon_account_financial_report-16.0.1.15.2.2.dist-info → odoo_addon_account_financial_report-16.0.1.16.0.dist-info}/METADATA +16 -3
  41. {odoo_addon_account_financial_report-16.0.1.15.2.2.dist-info → odoo_addon_account_financial_report-16.0.1.16.0.dist-info}/RECORD +43 -40
  42. {odoo_addon_account_financial_report-16.0.1.15.2.2.dist-info → odoo_addon_account_financial_report-16.0.1.16.0.dist-info}/WHEEL +0 -0
  43. {odoo_addon_account_financial_report-16.0.1.15.2.2.dist-info → odoo_addon_account_financial_report-16.0.1.16.0.dist-info}/top_level.txt +0 -0
@@ -372,7 +372,7 @@ ul.auto-toc {
372
372
  !! This file is generated by oca-gen-addon-readme !!
373
373
  !! changes will be overwritten. !!
374
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375
- !! source digest: sha256:14f61f914c003a9be1f6858481e6d0ac51c7e0c774327146136252cc7122b514
375
+ !! source digest: sha256:2311452f4504c6892d30479b8e6fac1bc1ea626fc889d40c4e10910386df6c4d
376
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377
377
  <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-financial-reporting/tree/16.0/account_financial_report"><img alt="OCA/account-financial-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-account_financial_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
378
  <p>This module adds a set of financial reports. They are accessible under
@@ -385,6 +385,8 @@ Invoicing / Reporting / OCA accounting reports.</p>
385
385
  <li>VAT Report</li>
386
386
  <li>Journal Ledger</li>
387
387
  </ul>
388
+ <p>It is possible to select the columns to show and limit the size of some of them from the
389
+ columns page.</p>
388
390
  <p>Currently General ledger, Trial Balance and Open Items are fully compatible with a foreign
389
391
  currency set up in account in order to display balances. Moreover, any foreign
390
392
  currency used in account move lines is properly shown.</p>
@@ -399,16 +401,17 @@ For further information, check CONFIGURE.rst</p>
399
401
  <li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
400
402
  <li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
401
403
  <li><a class="reference internal" href="#changelog" id="toc-entry-3">Changelog</a><ul>
402
- <li><a class="reference internal" href="#section-1" id="toc-entry-4">11.0.2.5.0 (2019-04-26)</a></li>
403
- <li><a class="reference internal" href="#section-2" id="toc-entry-5">11.0.2.4.1 (2019-01-08)</a></li>
404
- <li><a class="reference internal" href="#section-3" id="toc-entry-6">11.0.2.3.1 (2018-11-29)</a></li>
404
+ <li><a class="reference internal" href="#section-1" id="toc-entry-4">15.0.3.2.3 (2025-02-17)</a></li>
405
+ <li><a class="reference internal" href="#section-2" id="toc-entry-5">11.0.2.5.0 (2019-04-26)</a></li>
406
+ <li><a class="reference internal" href="#section-3" id="toc-entry-6">11.0.2.4.1 (2019-01-08)</a></li>
407
+ <li><a class="reference internal" href="#section-4" id="toc-entry-7">11.0.2.3.1 (2018-11-29)</a></li>
405
408
  </ul>
406
409
  </li>
407
- <li><a class="reference internal" href="#bug-tracker" id="toc-entry-7">Bug Tracker</a></li>
408
- <li><a class="reference internal" href="#credits" id="toc-entry-8">Credits</a><ul>
409
- <li><a class="reference internal" href="#authors" id="toc-entry-9">Authors</a></li>
410
- <li><a class="reference internal" href="#contributors" id="toc-entry-10">Contributors</a></li>
411
- <li><a class="reference internal" href="#maintainers" id="toc-entry-11">Maintainers</a></li>
410
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-8">Bug Tracker</a></li>
411
+ <li><a class="reference internal" href="#credits" id="toc-entry-9">Credits</a><ul>
412
+ <li><a class="reference internal" href="#authors" id="toc-entry-10">Authors</a></li>
413
+ <li><a class="reference internal" href="#contributors" id="toc-entry-11">Contributors</a></li>
414
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-12">Maintainers</a></li>
412
415
  </ul>
413
416
  </li>
414
417
  </ul>
@@ -442,26 +445,35 @@ are different.</li>
442
445
  <li>It would be nice to have in reports a column indicating the
443
446
  state of the entries when the option “All Entries” is selected
444
447
  in “Target Moves” field in a wizard</li>
448
+ <li>Adapt reports so that the order of the columns displayed is dynamic</li>
449
+ <li>Remove duplicated options to show columns (it has not been made in a stable version so
450
+ as not to generate confusion in users)</li>
445
451
  </ul>
446
452
  </div>
447
453
  <div class="section" id="changelog">
448
454
  <h2><a class="toc-backref" href="#toc-entry-3">Changelog</a></h2>
449
455
  <div class="section" id="section-1">
450
- <h3><a class="toc-backref" href="#toc-entry-4">11.0.2.5.0 (2019-04-26)</a></h3>
456
+ <h3><a class="toc-backref" href="#toc-entry-4">15.0.3.2.3 (2025-02-17)</a></h3>
451
457
  <ul class="simple">
452
- <li>In the Trial Balance you have an option to hide parent hierarchy levels</li>
458
+ <li>Added the option to select columns to display and the ability to limit the width of the text</li>
453
459
  </ul>
454
460
  </div>
455
461
  <div class="section" id="section-2">
456
- <h3><a class="toc-backref" href="#toc-entry-5">11.0.2.4.1 (2019-01-08)</a></h3>
462
+ <h3><a class="toc-backref" href="#toc-entry-5">11.0.2.5.0 (2019-04-26)</a></h3>
463
+ <ul class="simple">
464
+ <li>In the Trial Balance you have an option to hide parent hierarchy levels</li>
465
+ </ul>
466
+ </div>
467
+ <div class="section" id="section-3">
468
+ <h3><a class="toc-backref" href="#toc-entry-6">11.0.2.4.1 (2019-01-08)</a></h3>
457
469
  <ul class="simple">
458
470
  <li>Handle better multicompany behaviour</li>
459
471
  <li>Improve how title appears in the reports</li>
460
472
  <li>Improve performance in General Ledger</li>
461
473
  </ul>
462
474
  </div>
463
- <div class="section" id="section-3">
464
- <h3><a class="toc-backref" href="#toc-entry-6">11.0.2.3.1 (2018-11-29)</a></h3>
475
+ <div class="section" id="section-4">
476
+ <h3><a class="toc-backref" href="#toc-entry-7">11.0.2.3.1 (2018-11-29)</a></h3>
465
477
  <ul class="simple">
466
478
  <li>In the Trial Balance you can apply a filter by hierarchy levels</li>
467
479
  <li>In the General Ledger you can apply a filter by Analytic Tag</li>
@@ -470,7 +482,7 @@ in “Target Moves” field in a wizard</li>
470
482
  </div>
471
483
  </div>
472
484
  <div class="section" id="bug-tracker">
473
- <h2><a class="toc-backref" href="#toc-entry-7">Bug Tracker</a></h2>
485
+ <h2><a class="toc-backref" href="#toc-entry-8">Bug Tracker</a></h2>
474
486
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues">GitHub Issues</a>.
475
487
  In case of trouble, please check there if your issue has already been reported.
476
488
  If you spotted it first, help us to smash it by providing a detailed and welcomed
@@ -478,18 +490,19 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
478
490
  <p>Do not contact contributors directly about support or help with technical issues.</p>
479
491
  </div>
480
492
  <div class="section" id="credits">
481
- <h2><a class="toc-backref" href="#toc-entry-8">Credits</a></h2>
493
+ <h2><a class="toc-backref" href="#toc-entry-9">Credits</a></h2>
482
494
  <div class="section" id="authors">
483
- <h3><a class="toc-backref" href="#toc-entry-9">Authors</a></h3>
495
+ <h3><a class="toc-backref" href="#toc-entry-10">Authors</a></h3>
484
496
  <ul class="simple">
485
497
  <li>Camptocamp</li>
486
498
  <li>initOS GmbH</li>
487
499
  <li>redCOR AG</li>
488
500
  <li>ForgeFlow</li>
501
+ <li>Tecnativa</li>
489
502
  </ul>
490
503
  </div>
491
504
  <div class="section" id="contributors">
492
- <h3><a class="toc-backref" href="#toc-entry-10">Contributors</a></h3>
505
+ <h3><a class="toc-backref" href="#toc-entry-11">Contributors</a></h3>
493
506
  <ul class="simple">
494
507
  <li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
495
508
  <li>Yannick Vaucher &lt;<a class="reference external" href="mailto:yannick.vaucher&#64;camptocamp.com">yannick.vaucher&#64;camptocamp.com</a>&gt;</li>
@@ -517,6 +530,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
517
530
  <li>Alexandre D. Díaz</li>
518
531
  <li>Víctor Martínez</li>
519
532
  <li>Carolina Fernandez</li>
533
+ <li>Carlos Dauden</li>
520
534
  </ul>
521
535
  </li>
522
536
  <li><a class="reference external" href="https://www.sygel.es">Sygel</a>:<ul>
@@ -538,7 +552,7 @@ April 2016.</p>
538
552
  </ul>
539
553
  </div>
540
554
  <div class="section" id="maintainers">
541
- <h3><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h3>
555
+ <h3><a class="toc-backref" href="#toc-entry-12">Maintainers</a></h3>
542
556
  <p>This module is maintained by the OCA.</p>
543
557
  <a class="reference external image-reference" href="https://odoo-community.org">
544
558
  <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -66,7 +66,7 @@ class TestAgedPartnerBalance(TransactionCase):
66
66
  wizard = self.wizard_with_line_details
67
67
 
68
68
  wizard.onchange_type_accounts_only()
69
- data = wizard._prepare_report_aged_partner_balance()
69
+ data = wizard._prepare_report_data()
70
70
 
71
71
  # Simulate web client behavior:
72
72
  # default value is a datetime.date but web client sends back strings
@@ -82,7 +82,7 @@ class TestAgedPartnerBalance(TransactionCase):
82
82
 
83
83
  second_wizard = self.wizard_without_line_details
84
84
  second_wizard.onchange_type_accounts_only()
85
- data = second_wizard._prepare_report_aged_partner_balance()
85
+ data = second_wizard._prepare_report_data()
86
86
 
87
87
  # Simulate web client behavior:
88
88
  # default value is a datetime.date but web client sends back strings
@@ -125,7 +125,7 @@ class TestAgedPartnerBalance(TransactionCase):
125
125
  wizard.age_partner_config_id = self.account_age_report_config.id
126
126
 
127
127
  wizard.onchange_type_accounts_only()
128
- data = wizard._prepare_report_aged_partner_balance()
128
+ data = wizard._prepare_report_data()
129
129
 
130
130
  # Simulate web client behavior:
131
131
  # default value is a datetime.date but web client sends back strings
@@ -143,7 +143,7 @@ class TestAgedPartnerBalance(TransactionCase):
143
143
  second_wizard.age_partner_config_id = self.account_age_report_config.id
144
144
 
145
145
  second_wizard.onchange_type_accounts_only()
146
- data = second_wizard._prepare_report_aged_partner_balance()
146
+ data = second_wizard._prepare_report_data()
147
147
 
148
148
  # Simulate web client behavior:
149
149
  # default value is a datetime.date but web client sends back strings
@@ -125,7 +125,7 @@ class TestGeneralLedgerReport(AccountTestInvoicingCommon):
125
125
  "centralize": centralize,
126
126
  }
127
127
  )
128
- data = general_ledger._prepare_report_general_ledger()
128
+ data = general_ledger._prepare_report_data()
129
129
  res_data = self.env[
130
130
  "report.account_financial_report.general_ledger"
131
131
  ]._get_report_values(general_ledger, data)
@@ -177,7 +177,7 @@ class TestJournalReport(AccountTestInvoicingCommon):
177
177
  "move_target": "all",
178
178
  }
179
179
  )
180
- data = wiz._prepare_report_journal_ledger()
180
+ data = wiz._prepare_report_data()
181
181
  res_data = self.JournalLedgerReport._get_report_values(wiz, data)
182
182
  self.check_report_journal_debit_credit(res_data, 100, 100)
183
183
 
@@ -186,7 +186,7 @@ class TestJournalReport(AccountTestInvoicingCommon):
186
186
  res_data = self.JournalLedgerReport._get_report_values(wiz, data)
187
187
  self.check_report_journal_debit_credit(res_data, 200, 200)
188
188
  wiz.move_target = "posted"
189
- data = wiz._prepare_report_journal_ledger()
189
+ data = wiz._prepare_report_data()
190
190
  res_data = self.JournalLedgerReport._get_report_values(wiz, data)
191
191
  self.check_report_journal_debit_credit(res_data, 0, 0)
192
192
 
@@ -203,7 +203,7 @@ class TestJournalReport(AccountTestInvoicingCommon):
203
203
  self.check_report_journal_debit_credit(res_data, 200, 200)
204
204
 
205
205
  wiz.date_from = self.previous_fy_date_start
206
- data = wiz._prepare_report_journal_ledger()
206
+ data = wiz._prepare_report_data()
207
207
  res_data = self.JournalLedgerReport._get_report_values(wiz, data)
208
208
  self.check_report_journal_debit_credit(res_data, 300, 300)
209
209
 
@@ -238,7 +238,7 @@ class TestJournalReport(AccountTestInvoicingCommon):
238
238
  "move_target": "all",
239
239
  }
240
240
  )
241
- data = wiz._prepare_report_journal_ledger()
241
+ data = wiz._prepare_report_data()
242
242
  res_data = self.JournalLedgerReport._get_report_values(wiz, data)
243
243
  self.check_report_journal_debit_credit(res_data, 250, 250)
244
244
  self.check_report_journal_debit_credit_taxes(res_data, 0, 300, 0, 50)
@@ -276,7 +276,7 @@ class TestJournalReport(AccountTestInvoicingCommon):
276
276
  "move_target": "all",
277
277
  }
278
278
  )
279
- data = wiz._prepare_report_journal_ledger()
279
+ data = wiz._prepare_report_data()
280
280
  res_data = self.JournalLedgerReport._get_report_values(wiz, data)
281
281
 
282
282
  self.check_report_journal_debit_credit(res_data, 250, 250)
@@ -86,5 +86,5 @@ class TestOpenItems(AccountTestInvoicingCommon):
86
86
  }
87
87
  )
88
88
  wizard.on_change_account_range()
89
- res = wizard._prepare_report_open_items()
89
+ res = wizard._prepare_report_data()
90
90
  self.assertEqual(res["grouped_by"], wizard.grouped_by)
@@ -192,7 +192,7 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
192
192
  "show_partner_details": with_partners,
193
193
  }
194
194
  )
195
- data = trial_balance._prepare_report_trial_balance()
195
+ data = trial_balance._prepare_report_data()
196
196
  res_data = self.env[
197
197
  "report.account_financial_report.trial_balance"
198
198
  ]._get_report_values(trial_balance, data)
@@ -547,7 +547,7 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
547
547
  "fy_start_date": self.fy_date_start,
548
548
  }
549
549
  )
550
- data = trial_balance._prepare_report_trial_balance()
550
+ data = trial_balance._prepare_report_data()
551
551
  res_data = self.env[
552
552
  "report.account_financial_report.trial_balance"
553
553
  ]._get_report_values(trial_balance, data)
@@ -600,7 +600,7 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
600
600
  "fy_start_date": self.fy_date_start,
601
601
  }
602
602
  )
603
- data = trial_balance._prepare_report_trial_balance()
603
+ data = trial_balance._prepare_report_data()
604
604
  res_data = self.env[
605
605
  "report.account_financial_report.trial_balance"
606
606
  ]._get_report_values(trial_balance, data)
@@ -654,7 +654,7 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
654
654
  "fy_start_date": self.fy_date_start,
655
655
  }
656
656
  )
657
- data = trial_balance._prepare_report_trial_balance()
657
+ data = trial_balance._prepare_report_data()
658
658
  res_data = self.env[
659
659
  "report.account_financial_report.trial_balance"
660
660
  ]._get_report_values(trial_balance, data)
@@ -218,7 +218,7 @@ class TestVATReport(AccountTestInvoicingCommon):
218
218
  "tax_detail": True,
219
219
  }
220
220
  )
221
- data = vat_report._prepare_vat_report()
221
+ data = vat_report._prepare_report_data()
222
222
  res_data = self.env[
223
223
  "report.account_financial_report.vat_report"
224
224
  ]._get_report_values(vat_report, data)
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <record model="ir.ui.view" id="view_account_financial_report_column_form">
4
+ <field name="name">account.financial.report.column.form.inherit</field>
5
+ <field name="model">account.financial.report.column</field>
6
+ <field name="type">form</field>
7
+ <field name="arch" type="xml">
8
+ <form>
9
+ <sheet>
10
+ <group>
11
+ <field name="name" />
12
+ <field
13
+ name="limit"
14
+ attrs="{'invisible': [('field_type', '!=', 'string')]}"
15
+ />
16
+ <field name="is_visible" widget="boolean_toggle" />
17
+ </group>
18
+ <group>
19
+ <field name="expression_label" />
20
+ <field name="sequence" />
21
+ <field name="field_type" />
22
+ </group>
23
+ </sheet>
24
+ </form>
25
+ </field>
26
+ </record>
27
+ <record model="ir.ui.view" id="view_account_financial_report_column_tree">
28
+ <field name="name">account.financial.report.column.tree</field>
29
+ <field name="model">account.financial.report.column</field>
30
+ <field name="type">tree</field>
31
+ <field name="arch" type="xml">
32
+ <tree editable="bottom" create="false" delete="false">
33
+ <field name="sequence" widget="handle" />
34
+ <field name="name" readonly="1" />
35
+ <field name="expression_label" readonly="1" optional="hide" />
36
+ <field name="is_visible" widget="boolean_toggle" />
37
+ <field name="field_type" optional="hide" />
38
+ <field
39
+ name="limit"
40
+ attrs="{'invisible': [('field_type', '!=', 'string')]}"
41
+ optional="show"
42
+ />
43
+ </tree>
44
+ </field>
45
+ </record>
46
+ </odoo>
@@ -1,7 +1,8 @@
1
1
  # Copyright 2019 Lorenzo Battistini @ TAKOBI
2
+ # Copyright 2025 Tecnativa - Carlos Dauden
2
3
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
4
 
4
- from odoo import fields, models
5
+ from odoo import api, fields, models
5
6
 
6
7
 
7
8
  class AbstractWizard(models.AbstractModel):
@@ -34,6 +35,20 @@ class AbstractWizard(models.AbstractModel):
34
35
  required=False,
35
36
  string="Company",
36
37
  )
38
+ # Hack inverse to force save columns options and do not create table x_rel
39
+ column_ids = fields.Many2many(
40
+ comodel_name="account.financial.report.column",
41
+ store=False,
42
+ inverse=lambda self: self,
43
+ )
44
+
45
+ @api.model
46
+ def default_get(self, fields):
47
+ res = super().default_get(fields)
48
+ res["column_ids"] = self.env["account.financial.report.column"].search(
49
+ [("res_model", "=", self._name)]
50
+ )
51
+ return res
37
52
 
38
53
  def button_export_html(self):
39
54
  self.ensure_one()
@@ -49,3 +64,12 @@ class AbstractWizard(models.AbstractModel):
49
64
  self.ensure_one()
50
65
  report_type = "xlsx"
51
66
  return self._export(report_type)
67
+
68
+ def _limit_text(self, value, limit=0):
69
+ if value and limit and len(value) > limit:
70
+ value = value[:limit] + "..."
71
+ return value
72
+
73
+ def _prepare_report_data(self):
74
+ self.ensure_one()
75
+ return {"wizard_name": self._name, "wizard_id": self.id}
@@ -117,7 +117,7 @@ class AgedPartnerBalanceWizard(models.TransientModel):
117
117
 
118
118
  def _print_report(self, report_type):
119
119
  self.ensure_one()
120
- data = self._prepare_report_aged_partner_balance()
120
+ data = self._prepare_report_data()
121
121
  if report_type == "xlsx":
122
122
  report_name = "a_f_r.report_aged_partner_balance_xlsx"
123
123
  else:
@@ -131,20 +131,22 @@ class AgedPartnerBalanceWizard(models.TransientModel):
131
131
  .report_action(self, data=data)
132
132
  )
133
133
 
134
- def _prepare_report_aged_partner_balance(self):
135
- self.ensure_one()
136
- return {
137
- "wizard_id": self.id,
138
- "date_at": self.date_at,
139
- "date_from": self.date_from or False,
140
- "only_posted_moves": self.target_move == "posted",
141
- "company_id": self.company_id.id,
142
- "account_ids": self.account_ids.ids,
143
- "partner_ids": self.partner_ids.ids,
144
- "show_move_line_details": self.show_move_line_details,
145
- "account_financial_report_lang": self.env.lang,
146
- "age_partner_config_id": self.age_partner_config_id.id,
147
- }
134
+ def _prepare_report_data(self):
135
+ res = super()._prepare_report_data()
136
+ res.update(
137
+ {
138
+ "date_at": self.date_at,
139
+ "date_from": self.date_from or False,
140
+ "only_posted_moves": self.target_move == "posted",
141
+ "company_id": self.company_id.id,
142
+ "account_ids": self.account_ids.ids,
143
+ "partner_ids": self.partner_ids.ids,
144
+ "show_move_line_details": self.show_move_line_details,
145
+ "account_financial_report_lang": self.env.lang,
146
+ "age_partner_config_id": self.age_partner_config_id.id,
147
+ }
148
+ )
149
+ return res
148
150
 
149
151
  def _export(self, report_type):
150
152
  """Default export is PDF."""
@@ -269,7 +269,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
269
269
 
270
270
  def _print_report(self, report_type):
271
271
  self.ensure_one()
272
- data = self._prepare_report_general_ledger()
272
+ data = self._prepare_report_data()
273
273
  if report_type == "xlsx":
274
274
  report_name = "a_f_r.report_general_ledger_xlsx"
275
275
  else:
@@ -283,28 +283,31 @@ class GeneralLedgerReportWizard(models.TransientModel):
283
283
  .report_action(self, data=data)
284
284
  )
285
285
 
286
- def _prepare_report_general_ledger(self):
287
- self.ensure_one()
288
- return {
289
- "wizard_id": self.id,
290
- "date_from": self.date_from,
291
- "date_to": self.date_to,
292
- "only_posted_moves": self.target_move == "posted",
293
- "hide_account_at_0": self.hide_account_at_0,
294
- "foreign_currency": self.foreign_currency,
295
- "company_id": self.company_id.id,
296
- "account_ids": self.account_ids.ids,
297
- "partner_ids": self.partner_ids.ids,
298
- "grouped_by": self.grouped_by,
299
- "cost_center_ids": self.cost_center_ids.ids,
300
- "show_cost_center": self.show_cost_center,
301
- "journal_ids": self.account_journal_ids.ids,
302
- "centralize": self.centralize,
303
- "fy_start_date": self.fy_start_date,
304
- "unaffected_earnings_account": self.unaffected_earnings_account.id,
305
- "account_financial_report_lang": self.env.lang,
306
- "domain": self._get_account_move_lines_domain(),
307
- }
286
+ def _prepare_report_data(self):
287
+ res = super()._prepare_report_data()
288
+ res.update(
289
+ {
290
+ "wizard_id": self.id,
291
+ "date_from": self.date_from,
292
+ "date_to": self.date_to,
293
+ "only_posted_moves": self.target_move == "posted",
294
+ "hide_account_at_0": self.hide_account_at_0,
295
+ "foreign_currency": self.foreign_currency,
296
+ "company_id": self.company_id.id,
297
+ "account_ids": self.account_ids.ids,
298
+ "partner_ids": self.partner_ids.ids,
299
+ "grouped_by": self.grouped_by,
300
+ "cost_center_ids": self.cost_center_ids.ids,
301
+ "show_cost_center": self.show_cost_center,
302
+ "journal_ids": self.account_journal_ids.ids,
303
+ "centralize": self.centralize,
304
+ "fy_start_date": self.fy_start_date,
305
+ "unaffected_earnings_account": self.unaffected_earnings_account.id,
306
+ "account_financial_report_lang": self.env.lang,
307
+ "domain": self._get_account_move_lines_domain(),
308
+ }
309
+ )
310
+ return res
308
311
 
309
312
  def _export(self, report_type):
310
313
  """Default export is PDF."""
@@ -93,6 +93,13 @@
93
93
  context="{'skip_search_count': 1}"
94
94
  />
95
95
  </page>
96
+ <page name="columns" string="Columns">
97
+ <field
98
+ name="column_ids"
99
+ context="{'default_res_name': 'general.ledger.report.wizard'}"
100
+ widget="one2many"
101
+ />
102
+ </page>
96
103
  </notebook>
97
104
  </div>
98
105
  <div
@@ -75,7 +75,7 @@ class JournalLedgerReportWizard(models.TransientModel):
75
75
 
76
76
  def _print_report(self, report_type):
77
77
  self.ensure_one()
78
- data = self._prepare_report_journal_ledger()
78
+ data = self._prepare_report_data()
79
79
  if report_type == "xlsx":
80
80
  report_name = "a_f_r.report_journal_ledger_xlsx"
81
81
  else:
@@ -89,28 +89,30 @@ class JournalLedgerReportWizard(models.TransientModel):
89
89
  .report_action(self, data=data)
90
90
  )
91
91
 
92
- def _prepare_report_journal_ledger(self):
93
- self.ensure_one()
92
+ def _prepare_report_data(self):
93
+ res = super()._prepare_report_data()
94
94
  journals = self.journal_ids
95
95
  if not journals:
96
96
  # Not selecting a journal means that we'll display all journals
97
97
  journals = self.env["account.journal"].search(
98
98
  [("company_id", "=", self.company_id.id)]
99
99
  )
100
- return {
101
- "wizard_id": self.id,
102
- "date_from": self.date_from,
103
- "date_to": self.date_to,
104
- "move_target": self.move_target,
105
- "foreign_currency": self.foreign_currency,
106
- "company_id": self.company_id.id,
107
- "journal_ids": journals.ids,
108
- "sort_option": self.sort_option,
109
- "group_option": self.group_option,
110
- "with_account_name": self.with_account_name,
111
- "account_financial_report_lang": self.env.lang,
112
- "with_auto_sequence": self.with_auto_sequence,
113
- }
100
+ res.update(
101
+ {
102
+ "date_from": self.date_from,
103
+ "date_to": self.date_to,
104
+ "move_target": self.move_target,
105
+ "foreign_currency": self.foreign_currency,
106
+ "company_id": self.company_id.id,
107
+ "journal_ids": journals.ids,
108
+ "sort_option": self.sort_option,
109
+ "group_option": self.group_option,
110
+ "with_account_name": self.with_account_name,
111
+ "account_financial_report_lang": self.env.lang,
112
+ "with_auto_sequence": self.with_auto_sequence,
113
+ }
114
+ )
115
+ return res
114
116
 
115
117
  def _export(self, report_type):
116
118
  """Default export is PDF."""