Skip to content

[17.0][IMP] base_tier_validation: add support for custom actions in TierReviewMenu #1120

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

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

Conversation

MaxyMoos
Copy link
Contributor

@MaxyMoos MaxyMoos commented Jul 9, 2025

This commit adds the possibility for modules inheriting from base_tier_validation to customize the ir.actions.act_window to run when a user clicks on the TierReviewMenu entries.

For example, the current behavior when using account_move_tier_validation is to use the default views for account.move, which leads users to a Kanban view of the Moves by default, and the Tree/List view has no "Partner" column.
With this PR, adding a small JS module such as:

/* @odoo-module */
import { patch } from "@web/core/utils/patch";
import { TierReviewMenu } from "@base_tier_validation/components/tier_review_menu/tier_review_menu.esm";


patch(TierReviewMenu.prototype, {
    async getCustomAction(group) {
        if (group.model === 'account.move') {
            const action = 'account.action_move_journal_line';
            return this.action.loadAction(action);
        }
        return super.getCustomAction(group);
    }
});

would then open the classic "Journal Entries" default views, showing the "Partner" column in the tree view, etc...

Of course, the default behavior of this addition is to fallback on the current approach.
Also, we now pass the group variable to the getAvailableViews call so this can be customized too.

@OCA-git-bot
Copy link
Contributor

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

@MaxyMoos MaxyMoos force-pushed the 17.0-base_tier_validation-allow-custom-actions-in-tier-review-menu branch from 9354592 to 6f8f4b1 Compare July 9, 2025 08:52
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.

2 participants