server-ux
server-ux copied to clipboard
[17.0][IMP] base_tier_validation: add support for custom actions in TierReviewMenu
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.
Hi @LoisRForgeFlow, some modules you are maintaining are being modified, check this out!
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
Hi @LoisRForgeFlow, just bumping this as it seems it'll get closed automatically real soon. Would love to get your opinion on whether this improvement seems relevant whenever you get some time.