Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
15063 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
1704
2
thg 7 25
4706
3
thg 2 25
14887
1
thg 4 25
2062
Export Import Đã xử lý
1
thg 4 25
1959