Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
4 Ответы
15075 Представления

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

Related Posts Ответы Просмотры Активность
1
июл. 25
1727
2
июл. 25
4741
3
февр. 25
14913
1
апр. 25
2067
Export Import Решено
1
апр. 25
1977