コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
15094 ビュー

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.

アバター
破棄

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

最善の回答

Hi Anil,

Please check this module , This will help to hide the export button based on user groups.

https://www.odoo.com/apps/modules/10.0/web_disable_export_group/

Thanks

アバター
破棄
著作者

Hi Niyas, Your solution and logic helped me thanks. I modified and used it on my way. very helpful link.

最善の回答

Just follow the steps given in the blog: 

http://change-openerp-web.blogspot.in/2013/08/hide-export-in-more-option-in-openerp-7.html 

https://stackoverflow.com/questions/38005794/hide-delete-button-from-export-data-form-view-in-odoo


アバター
破棄
著作者

Thanks Bouabaker for quick response :), let me try the steps

関連投稿 返信 ビュー 活動
1
7月 25
1745
2
7月 25
4776
3
2月 25
14938
1
4月 25
2077
Export Import 解決済
1
4月 25
2000