Commit Graph

28 Commits

Author SHA1 Message Date
Florian da Costa
5814c1ba45 [FIX] rename call to get method of ir.default model 2025-01-31 10:17:02 +01:00
Florian da Costa
9a8bdf10ab [18][FIX] account_financial_report : make aged report configuration working with multi-company 2025-01-31 09:41:05 +01:00
chaule97
01f22b8256 [MIG] account_financial_report: Migration to 18.0 2024-12-04 14:40:57 +07:00
chaule97
c46e83a4a4 [IMP] account_financial_report: pre-commit auto fixes 2024-12-04 14:40:56 +07:00
SilvioC2C
f3a8695c0c [FIX] account_financial_report: fix ValueError
``analytic_distribution`` is a JSON field where keys are 'account.id' or 'account.id,account.id'
Eg: https://github.com/odoo/odoo/blob/8479b4e/addons/sale/models/account_move_line.py#L158
Previous implementation tried to convert to ``int`` the ``analytic_distribution`` dict keys, leading to a ``ValueError``.
This commit fixes this bug.
2024-11-29 15:38:41 +07:00
Carolina Fernandez
6d6937346a [17.0][IMP] account_financial_report: Set custom intervales in aged report 2024-11-29 15:38:41 +07:00
Jairo Llopis
2671e21526 [FIX] account_financial_report: optimize computation of analytic accounts
Installing the module in a big DB was very slow.

I applied several optimizations to the method for working better with big datasets:
- Prefetch all analytic account distribution.
- Batch writes as much as possible.

@moduon MT-4982
2024-11-29 15:38:41 +07:00
Henrik Norlin
0b128f03ee [IMP] account_financial_report: pre-commit auto fixes 2024-11-29 15:38:41 +07:00
Akim Juillerat
e9a88296ff Avoid error on installation with missing analytic account
When installing the module account_financial_report, a relational table between
account_move_line and account_analytic_account is created and computed.

However, if an analytic account was used only on draft invoices before being deleted,
its ID will remain in the JSON column analytic_distibution of account_move_line.
In that case we get a ForeignKeyViolation because the ID doesn't exist in
account_analytic_account table.

Therefore, we need to check if the ID exists during the computation to avoid
inserting it in the relational table and raising the error.
2024-11-29 15:38:41 +07:00
Jairo Llopis
85632d7639 [FIX] account_financial_report: endless installation
Installing the module in a DB with more than 50000 accounts and groups made the install stall.

It turns out this method's implementation produced almost endless recursion. it was also depending on some fields that never were used.

Now it depends on the parent path, so when one group is moved to another parent, its computed accounts are recomputed, and parents' too, recursively.

Now, the method is much more performant, and the module gets installed in the same DB in 30s.

@moduon MT-1900

Co-authored-by: Eduardo De Miguel <edu@moduon.team>
2024-11-29 15:38:41 +07:00
David Ramia
4de4c3d2b1 [MIG] account_financial_report: Migration to 16.0 2024-11-29 15:38:41 +07:00
Ethan Hildick
7395d1b0ad [14.0][FIX] account_financial_report: Run compute in multi 2024-11-29 15:38:41 +07:00
Jasmin Solanki
2b45a4c62f [MIG] account_financial_report: Migration to 15.0 2024-11-29 15:38:41 +07:00
Jasmin Solanki
dba1ed1287 [IMP] account_financial_report: black, isort, prettier 2024-11-29 15:38:41 +07:00
Iryna Vyshnevska
132df3a92e [FIX] account_financial_report: use proper methods to set context 2024-11-29 15:38:41 +07:00
João Marques
12034178bb [MIG] account_financial_report: Migration to 14.0
Since v14, Odoo defines the `__slots__` attribute in the `BaseModel` class (ea3e39506a)
This makes it impossible to add attributes to an instance like it was done here in v13.
The use of the `report_data` dictionary passed between method is the closes and simples solution to this "issue".

TT26415

Co-authored-by: Alex Cuellar <acuellar@grupoyacck.com>
2024-11-29 15:38:40 +07:00
Joan Sisquella
e8cdafc8d0 [IMP] domain widget performance fix 2024-11-29 15:38:40 +07:00
Pedro M. Baeza
cbacc1455c [FIX+IMP] account_financial_report: data can be None + no context mangling
Depending on the calling method, data can be something different from a dictionary
(like `None` if no keyword argument is provided), so this will crash. Example:
mis_builder is crashing in its tests.

We prevent that checking for a falsy value before trying to access the dictionary.

We also avoid context mangling for non AFR reports (those without the key
`account_financial_report_lang` in the dictionary), not callign to `with_context`
in that case.
2024-11-29 15:38:40 +07:00
Andrea
8cb94660e0 [FIX] translation not loaded 2024-11-29 15:38:40 +07:00
Ernesto Tejeda
712d4a898a [MIG] account_financial_report: Migration to 13.0 2024-11-29 15:38:40 +07:00
Ernesto Tejeda
40c874a112 [IMP] account_financial_report: black, isort 2024-11-29 15:38:40 +07:00
Joan Sisquella
1227d53d4f [12.0] account_financial_report: refactor 2024-11-29 15:38:40 +07:00
Quentin Groulard
efd0123bf6 [FIX] Few fixes to solve warnings:
- _description in account_financial_report_abstract
- _description in vat.report.wizard
- Two fields using same label 'Accounts' in account.group
- Two fields using same label 'Account' in report_journal_ledger_move_line
- Two fields using same label 'Partner' in report_journal_ledger_move_line
- Two fields using same label 'Accounts' in report_trial_balance_account
- Two fields using same label 'Tax' in report_vat_report_taxtag
- Two fields using same label 'Tax' in report_vat_report_tax
- Two fields using same label 'Filter accounts' in general.ledger.report.wizard
2024-11-29 15:38:40 +07:00
Iryna Vushnevska
8b43ea4758 [IMP] account_financial_reports: Several improvements:
* Move to less files to compile variables
* hide contacts on partner
* Add reports to res partner actions
* initialize wizard from context
* initialize wizard by current fiscal year
2024-11-29 15:38:40 +07:00
Jordi Ballester Alomar
49ca90f15c [account_financial_report]
- minor usability fixes for multicompany
- improve performance of general ledger using a new index
2024-11-29 15:38:40 +07:00
Pedro M. Baeza
072859bcb7 [FIX] account_financial_report: 2 things:
* Fix account group level computation

  Depends was not correct for recomputing when needed + better algorithm

* Make hide details on 0 work properly

  * Passing values to general ledger was stripping some correct records
  * Computed field for hiding lines doesn't have proper dependencies nor is not
    taking into account float currency accuracy
2024-11-29 15:38:40 +07:00
Fekete Mihai
2547753dcc Update links in report, add account group file, update trial balance with hierarchy.
Update indentation, remove empty lines from header.

Update test.

Update pylint.

Remove company_id on computing accounts, since account.group is not a company based model, filtering accounts is done on trial balance report.

Update account variables.

Improve condition in padding on accounts.

Add option to print hierarchy based on defined accounts/computed accounts.

Add VAT report, hierarchy from tax tags ans taxes.

Fix pylint, xlsx report generation header.

Update code to select code_prefix or name.

Update code to select code_prefix or name.

Update code to select code_prefix or name.

Fix domain in base amounts in vat report.

Change trial balance code_prefix or name.

Update trail balance, add tests for vat report.

Update pylint, amounts as monetary, many2one option on generation excels.

Update pulint.

Add VAT Report in readme.

Add VAT Report in readme.

Update array_agg.

Update array_agg.

Update array_agg.

Add option in VAT Report to be printed on Tax Tags - Tax Groups.

Add widget to hierarchy_on on trial balance.
2024-11-29 15:38:40 +07:00
Jordi Ballester
554ad61027 [MIG] account_financial_report_qweb: Migration to 11.0
* dynamize general ledger
2024-11-29 15:38:40 +07:00