Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
14134 Widoki

Hi I need to disable the export option for some users. I tired in Human resources/employee group by removing write and create access of ir.exports & ir.exports.line. When I logged in particular user it shows error " access denied " but I can able to export the products.So kindly provide the solution ASAP.

Thanks & Regards Sakthivel P

Awatar
Odrzuć

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

Najlepsza odpowiedź

Hello,

You cannot directly hide export button.To hide export you need to override related js file and add some code. Or inherit related template and hide it...

Thanks..

Awatar
Odrzuć
Autor

HI Pinakin, Thanks for your info. based on your answer we can hide export option for all users but I need to hide this export option for particular users alone. whether it can be possible?

Thanks sakthivel

Yes, its possible... Just create one group..... and override js file and in js file check current user have access..

Autor

Basically I m Functional consultant, is there any sample code available for this in launchpad?

Najlepsza odpowiedź

this is the exact what you are looking: https://youtu.be/EKKXWlZHlV0

Awatar
Odrzuć
Najlepsza odpowiedź

Hi, i found a solution for this problem , Only admin can do export data :

Export action need two ressources (the java script file and CSS file) located in the Web module, so what i did is to override these 2 ressources and add groups attributes. and this is how i solved it.

  1. first create an xml file export_hide.xml for example

  2. paste the code down below

  3. then go to your __openerp__ add in 'depends':['web',],'data':['export_hide.xml']

this is the code of hide_export.xml : :

<template id="export_hide_web" inherit_id="web.assets_backend">
    <xpath expr="//link[@href='/web/static/src/css/data_export.css']" position="replace">
        <link rel="stylesheet" href="/web/static/src/css/data_export.css" groups="Your admin groupe" />
    </xpath>
        <xpath expr="//script[@src='/web/static/src/js/data_export.js']" position="replace">
            <script type="text/javascript" src="/web/static/src/js/data_export.js" groups="Your admin group"></script>
    </xpath>
</template>



Awatar
Odrzuć