Hello All,
Is it possible to hide the Export button from the Action drop down menu list for the specific model and view?
Here is the screenshot.
Edit : 17-11-2017.
Here is the solution I've tried but was not work, after following the link reference provided.
JS File
odoo.define('my_module.PortalManagement', function (require) {
"use strict";
var core = require('web.core'); var Model = require('web.Model'); var Sidebar = require('web.Sidebar') Sidebar.include({ init: function () { var self = this; var ids; this._super.apply(this, arguments); self.view = self.getParent(); }, add_items: function (section_code, items) { var UserModel = new Model('res.users'); UserModel.call('has_group', ['mm_portal_user_management.user_area_manager']).done(function (has_user_portal_mgmt) { alert(has_user_portal_mgmt) if (has_user_portal_mgmt === true) { var new_items = []; for (var i = 0; i < items.length; i++) { if (items[i]['label'] != "Export") { new_items.push(items[i]); }; }; return self._super.call(this, section_code, new_items); } else { this._super.apply(this, arguments); } }); }, });
});
XML FILE
<?xml version="1.0" encoding="utf-8"?>
<odoo> <template id="assets_backend_export" name="Portal Export Assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <script type="text/javascript" src="/my_module/static/src/js/disable_export.js"></script> </xpath> </template>
</odoo>
This is the code I've applied to check for the specific user group assigned to user to overcome the the issue, but was not working well.
I got the following error.
Neither call or apply function is callable inside add_items() method. does any one has idea how could be resolve this error?
Regards,
Anil.
Following link may be useful, please go through..
http://www.hitechnologia.com/forum/odoo-forum-1/question/odoo-openerp-how-to-hide-export-option-more-export-in-odoo-for-single-user-or-all-users-315
Dynamic Action Menu Hider is an advanced Odoo module designed to enhance user experience by providing dynamic control over action menu buttons in both list and form views. This app enables you to hide or show critical action buttons like Delete, Duplicate, Export, Export All, Archive, and Unarchive based on configurable settings and user permissions. Ideal for administrators and managers who need granular control over user actions, this app ensures that sensitive or unnecessary actions are only available to authorized users, improving data security and streamlining workflows.
https://apps.odoo.com/apps/modules/16.0/mh_all_in_one_hide_action_menu