Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] account_financial_report #1101

Merged
merged 258 commits into from
Apr 11, 2024

Conversation

norlinhenrik
Copy link
Contributor

report_action.esm.js caused problems so I disabled the code, since I don't know how to fix it. Anyway, the reports seem to work fine.

BT-astauder and others added 30 commits January 24, 2024 11:57
Some changes in the databases been made in OCA#403, but no migration is needed.
When this module is installed along with other chart account different from generic one,
the number of expected accounts and the computation change (for example, in Spain,
the unaffected earnings account is 129000, choking with group with code prefix 1).

This commit makes the tests resistent to these changes.
When there are a lot of account.move.line (several millions) and print any of
the Qweb reports, that will generate also a lot of transient objects.
As these objects are created with an "insert" query, the cleaning normally
triggered by the count of the records in transient tables is not done, so only
the cleaning based on the age of the records is processed (by default, records
older than 1 hours are deleted), but the cron task is only ran one time per
day. For large setups this can lead to memory errors at that point. This change
prevents the memory error by executing the transient record cleanup for the
report models in this module in SQL.
Currently translated at 73.9% (215 of 291 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/de/
Currently translated at 50.2% (146 of 291 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/es/
Currently translated at 96.2% (178 of 185 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/ar/
Currently translated at 100.0% (291 of 291 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/es/
Currently translated at 83.5% (243 of 291 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/nl/
Currently translated at 100.0% (291 of 291 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/es/
Currently translated at 23.0% (67 of 291 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/it/
- Adds 'Period balance' column
- Renames the option 'Hide accounts at 0'. Means no initial, no debit, credit
  or ending balance for the period.
- Fixes logic to remove lines with 0 activity for the period.
- improve the calculation in the Trial Balance
  of undistributed profits/losses account, and provide a footer note
  to the user explaining why will the ending balances will not be zero, but the
  period's total profit and loss.
- add an extra line for P&L application so that the trial balance zeroes in the
  balance, and total debits = total credits
- refactoring of the unaffected earnings reporting in the general ledger
  and trial balance.
Currently translated at 74.6% (217 of 291 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/de/
Currently translated at 96.4% (291 of 302 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/es/
All reports:
- Rename field to hide accounts at 0 to 'hide_account_at_0'
Trial Balance:
- Add possibility to filter by hierarchy levels
- XLSX format will show the hierarchy levels in bold

General Ledger:
- Add the possibility to filter by analytic tags
- Fixes an error on the default date
Journal Ledger:
- The filter on Journals is now optional. If the user does not choose
a journal, by default it will display all journals.

Aged Partner Balance:
- Fixes an error on the default date
Currently translated at 39.7% (120 of 302 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/ro/
* 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
Currently translated at 21.5% (67 of 312 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/it/
Currently translated at 99.7% (311 of 312 strings)

Translation: account-financial-reporting-11.0/account-financial-reporting-11.0-account_financial_report
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-11-0/account-financial-reporting-11-0-account_financial_report/es/
* Fix wizards for proper multicompany behaviour.
* Fix layout issue
- minor usability fixes for multicompany
- improve performance of general ledger using a new index
@norlinhenrik
Copy link
Contributor Author

I have cherry-picked 4 commits in total from 3 PRs (#1105, #1112, #1114).

@victoralmau
Copy link
Member

Please, cherry-pick #1117

Steps:

 - Accounting > Reporting > OCA accounting reports > Journal Ledger
 - Select Date range and activate Foreign Currency

Get "{'name': 'EUR'} " in currency field

Desired: get EUR
@victoralmau
Copy link
Member

Please cherry-pick #1136

@HaraldPanten
Copy link

@norlinhenrik You're still working on it, right? Did you have the opportunity to check the last comments from Victor?

THX.

…eneral ledger

In v15 it was filtered by the internal_type field (type of account.account.type) to use
"other" (most of the accounts had it set). Now in v16, there is the account_type field
exists and has to be compatible. The in or not in operator is set to "simplify" the
domain and avoid having to set almost all types.
Copy link

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last commits have been added. I tested it in runboat and overall seems to be OK.

Functional review @victoralmau @pedrobaeza

@pedrobaeza
Copy link
Member

/ocabot migration account_financial_report

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Mar 26, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 26, 2024
4 tasks
import {ReportAction} from "@web/webclient/actions/reports/report_action";
import {patch} from "web.utils";
import {useEnrichWithActionLinks} from "./report.esm";
// /** @odoo-module **/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is lost due to this commented:

imagen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch(ReportAction.prototype, "account_financial_report.ReportAction", {
This line is causing error. How to do it in 17.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch(ReportAction.prototype, {
    setup() {

this._super.apply(this, arguments);
TypeError: Cannot read properties of undefined (reading 'apply')

super.apply(...arguments);
TypeError: (intermediate value).apply is not a function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// super.apply(arguments);
TypeError: Cannot read properties of undefined (reading 'el')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super.setup(...arguments);
This worked

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrobaeza Could you check if last changes solves pending issues? Thanks

@norlinhenrik norlinhenrik force-pushed the 17.0-mig-account_financial_report branch from d653fba to b6effa7 Compare March 31, 2024 07:06
@norlinhenrik norlinhenrik force-pushed the 17.0-mig-account_financial_report branch from b6effa7 to 03a3a6f Compare March 31, 2024 07:12
@norlinhenrik norlinhenrik force-pushed the 17.0-mig-account_financial_report branch from 53abd98 to 9f60cdf Compare March 31, 2024 08:46
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working, thanks!

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-1101-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit dce2190 into OCA:17.0 Apr 11, 2024
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 8361090. Thanks a lot for contributing to OCA. ❤️



class AbstractWizard(models.AbstractModel):
_name = "account_financial_report_abstract_wizard"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module name is giving errors when upgrading Odoo!

def validate_model(model):
if "
" in model and "." not in model and not model.startswith("x_") and model not in _VALID_MODELS:
raise SleepyDeveloperError("{} seems to be a table name instead of model name".format(model))
return model

This one blocks the upgrade of Odoo to version v17.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has someone else already ran into this problem?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That error is on migration scripts or Odoo code?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error blocks the upgrade when using CLI command
python <(curl -s https://upgrade.odoo.com/upgrade) test -d <your db name> -t <target version>

We are facing this problem on different projects.
The answer of Odoo is that the module has an incorrect name and we should change it.

The v17 version of the module is not giving an error when installing it on a Vanilla Odoo instance.
I don't know why they are throwing this error...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to make a PR with _name = "account.financial.report.abstract.wizard"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to make a PR with _name = "account.financial.report.abstract.wizard"

Or
_name = "report.account_financial_report.abstract_wizard"

same that:

_name = "report.account_financial_report.vat_report"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes _name = "report.account_financial_report.abstract_wizard" is even better.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is not going to help of course the migration from v14 :-)
Then it needs to be changed there also.
I logged a ticket at Odoo to exclude the abstract classes from this check...because it's not going to create a model at all.
The module works in a vanilla Odoo v17, so it's an upgrade issue.

rven added a commit to DynAppsNV/account-financial-reporting that referenced this pull request May 10, 2024
The original name existing with only underscores is giving errors when upgrading to v17.
This change has been discussed in OCA#1101
@norlinhenrik norlinhenrik deleted the 17.0-mig-account_financial_report branch May 30, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.