How to disable quick create menu entry for a specific module in mobile view ?

hi,

i've have to disable create for account in mobile view only.

i'already set an ACL wich works great. but i see, it remains create button in subpanel and quick create menu.

how can i do to remove them in mobile view ?

Parents
  • Hi  , André Lopes' answer is correct. The following lines are an example of how to obtain the result.

    1 .- create the next file "custom/views/right-menu/right-menu-view.js"

    2 .- Add the following lines:

    const customization = require('%app.core%/customization.js');
    const RightMenuView = require('%app.views%/right-menu/right-menu-view');
    const componentManager = require('%app.core%/component-manager');
    
    const CustomRightMenuView = customization.extend(RightMenuView, 
        {
            refillMenu() {
                this.availableActions = this.getAvailableActions();
                
                this.availableActions = _.filter(this.availableActions, function (item) {
                    let isValidCreate = true;
                    switch (item.module) {
                        case "RevenueLineItems":
                        case "Accounts":
                            isValidCreate = false;
                            break;                    
                    }
                  return isValidCreate;
                });
                
                this.render();
            },
        }
    );
    
    module.exports = CustomRightMenuView;
    
    componentManager.registerComponent({
        cmp: CustomRightMenuView,
        baseType: 'right-menu',
    });

    This code avoid creating RevenueLineItems and Accounts from Quick Create.

    I hope to be helpful. 

    Nice day.

Reply Children