Skip to content

[18.0][FIX] commission_oca,account_commission_oca: Restore grouped settlement report - #686

Open
carlosdauden wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-FIX-commission_grouped_settlement_report
Open

carlosdauden wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-FIX-commission_grouped_settlement_report

Conversation

@carlosdauden

Copy link
Copy Markdown
Contributor

The "Grouped Settlement" printable report (a summarized PDF grouping a commission.settlement's lines by day+commission, distinct from the existing itemized settlement report) existed through 17.0 - method, QWeb templates, report action, and its own test - and was entirely dropped in the 18.0 migration, no trace anywhere. Real money/ settlement-facing functionality, silently gone.

Restored verbatim from 17.0 (only renaming xmlid references for the module rename, commission -> commission_oca):

  • commission_oca: CommissionSettlement.grouped_report_lines() (groups settlement lines by day+commission via read_group), the grouped_report_settlement_document/grouped_report_settlement QWeb templates, and the action_grouped_report_settlement report action (bound to commission.settlement, appears in its Print menu).
  • account_commission_oca: the grouped_report_lines() override for settlement_type == "sale_invoice" (groups by date+invoice instead, with invoice/partner/subtotal columns), and the matching XPath view inheritance adding those columns to the base template.

Both ported tests included (test_grouped_report_lines, test_grouped_report_lines_sale_invoice), plus verified both reports actually render to PDF without error, not just pass their unit tests.

@Tecnativa

ping @sergio-teruel @CarlosRoca13 @carlos-lopez-tecnativa

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @pedrobaeza,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:18.0 mod:commission_oca Module commission_oca mod:account_commission_oca Module account_commission_oca labels Sep 7, 2026

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The report was added in this PR for V17: #648, and it was merged in November 2025. However, the migration to V18 was performed in #610 and merged in April 2025. Therefore, when the module was migrated, the report did not exist yet. For this reason, there is no evidence in the migration PR that the report was deleted.

The forward port was missing once the PR was merged. Thanks for forward-porting this!

Comment thread account_commission_oca/tests/test_account_commission.py
Comment thread account_commission_oca/tests/test_account_commission.py Outdated
Comment thread account_commission_oca/views/grouped_report_settlement_templates.xml Outdated
Comment thread account_commission_oca/views/grouped_report_settlement_templates.xml Outdated
Comment thread account_commission_oca/__manifest__.py Outdated
Comment thread commission_oca/__manifest__.py Outdated
@carlosdauden
carlosdauden force-pushed the 18.0-FIX-commission_grouped_settlement_report branch from 43e2cc3 to a6cbfb8 Compare September 9, 2026 14:46
@carlosdauden

Copy link
Copy Markdown
Contributor Author

Changes done

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, please FW-port this to V19. Thanks!

@carlosdauden

Copy link
Copy Markdown
Contributor Author

FW-port done: #687

@rrebollo rrebollo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review: Great work! The code looks good to me (LGTM). Thank you for your contribution! I've provided a few suggestions for your consideration—feel free to address them as you see fit.

Hey, would you be so kind as to review my #676 in return?

Comment thread account_commission_oca/models/commission_settlement.py Outdated
Comment thread commission_oca/reports/grouped_report_settlement_templates.xml Outdated
Comment thread commission_oca/reports/grouped_report_settlement_templates.xml Outdated
…nt report

The "Grouped Settlement" printable report (a summarized PDF grouping a commission.settlement's lines by day+commission, distinct from the existing itemized settlement report) was missing in 18.0. It was added to 17.0 by OCA#648 (merged November 2025), but the 18.0 migration PR OCA#610 had already been merged in April 2025 - before the report existed - so this is a forward-port gap, not something the migration dropped.

Restored verbatim from 17.0 (only renaming xmlid references for the module rename, commission -> commission_oca):

- commission_oca: CommissionSettlement.grouped_report_lines() (groups settlement lines by day+commission via read_group), the grouped_report_settlement_document/grouped_report_settlement QWeb templates, and the action_grouped_report_settlement report action (bound to commission.settlement, appears in its Print menu).
- account_commission_oca: the grouped_report_lines() override for settlement_type == "sale_invoice" (groups by date+invoice instead, with invoice/partner/subtotal columns), and the matching XPath view inheritance adding those columns to the base template.

Both ported tests included (test_grouped_report_lines, test_grouped_report_lines_sale_invoice), plus verified both reports actually render to PDF without error, not just pass their unit tests.
@carlosdauden
carlosdauden force-pushed the 18.0-FIX-commission_grouped_settlement_report branch from a6cbfb8 to f8a40cc Compare September 16, 2026 11:29
@carlosdauden

Copy link
Copy Markdown
Contributor Author

Changes done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved mod:account_commission_oca Module account_commission_oca mod:commission_oca Module commission_oca series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants