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][ADD] account_analytic_report: New module account_analytic_report #730

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

BernatObrador
Copy link
Contributor

@BernatObrador BernatObrador commented Dec 19, 2024

New module account_analytic_report

Using this module is straightforward. Follow these steps:

  • Navigate to the Report:
    Go to Invoicing -> Reporting -> Analytic Trial Balance.

  • Customize the Report with Filters:
    Adjust the report using the available options:

    • Group by Analytic Account:
      Groups the results by analytic accounts instead of financial accounts.

    • Show Hierarchy and Limit Hierarchy Level:
      Displays the amounts split by the hierarchy levels of financial accounts.

    • Filter Accounts:
      When used independently (without grouping by analytic accounts or showing hierarchy), the results will be split by both financial accounts.
      Example: Filtering by accounts Test 1 and Test 2:

              | Initial Balance | Test 1   | Test 2   | Ending Balance
      400000  |        0        | $3600    | $2400    |     $6000
      
    • Show Months (Excel export only):
      Enabled when filtering accounts without grouping by analytic accounts or showing hierarchy. It generates a separate sheet in the Excel file for each filtered account, detailing the amounts by month within the selected date range.

cc https://github.com/APSL 162352

@miquelalzanillas @lbarry-apsl @mpascuall @peluko00 @javierobcn @ppyczko please review

@BernatObrador BernatObrador changed the title [ADD] account_analytic_report: New module account_analytic_report [17][ADD] account_analytic_report: New module account_analytic_report Dec 19, 2024
@BernatObrador BernatObrador force-pushed the 17.0-add-account_analytic_report branch 3 times, most recently from f39c207 to cf5484e Compare December 19, 2024 13:10
@BernatObrador
Copy link
Contributor Author

@pedrobaeza Does this PR need to be reviewed again?

Copy link
Contributor

@peluko00 peluko00 left a comment

Choose a reason for hiding this comment

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

LGTM, tested in runboat and code review

@pedrobaeza pedrobaeza added this to the 17.0 milestone Dec 19, 2024
"author": "APSL-Nagarro, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-analytic",
"category": "Account",
"depends": ["analytic", "account_financial_report"],
Copy link
Member

Choose a reason for hiding this comment

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

Depending on account_financial_report is a very heavy one. Can you light up a bit this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using some of the trial balance bases from this module as a base. Would it be better to just copy the necessary files from account_financial_report?

Copy link
Member

Choose a reason for hiding this comment

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

It depends on how much you are reusing and the need for that. Can you specify?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm utilizing all the abstract classes provided by the account_financial_report module for trial balances. These classes include QWeb styles and templates, Excel export functionality with styles, PDF export features and some basics for the report. Specifically, I'm inheriting the following classes: report.account_financial_report.abstract_report_xlsx, report.account_financial_report.abstract_report, and account_financial_report_abstract_wizard."

Copy link
Member

Choose a reason for hiding this comment

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

Seeing the amount of code you need here, not to call super, etc, it seems you are just replacing the existing logic with your own, so I think to not depend on them isn't too much. Can you maybe do a PoC to see?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this could result in duplicated code between this module and account_financial_report. Do you think this is a viable approach? The logic for Excel generation and report styling is already provided by account_financial_report.

One alternative could be renaming this module to something like account_financial_report_analytic or account_financial_report_extension_analytic, to better reflect its relationship with the original module.

Copy link
Member

Choose a reason for hiding this comment

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

I still think they should be independent. You may want this feature without requiring the other. I think the coupling level is very low. Not all the declared styles in account_financial_report are used here.

@BernatObrador BernatObrador force-pushed the 17.0-add-account_analytic_report branch from cf5484e to ee95c7e Compare December 20, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants