I want to hide the products action button from normal users, How can I do it? can someone know?? don't need AI answers, i tried but not working.
This question has been flagged
Hello Kalana Piyumatha
you can check below link if it is according to your requirement.
https://apps.odoo.com/apps/modules/19.0/gt_hide_action_menu
Thank you!
Hello Kalana Piyumantha,
To hide the "Action" button on the product form view for normal users in Odoo, you can override the behavior using a small JavaScript patch.
Step 1: Create a JS file
Add a new JavaScript file in your module (e.g., static/src/js/hide_action_menu.js) and include the following code:
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { FormController } from "@web/views/form/form_controller";
import { user } from "@web/core/user";
patch(FormController.prototype, {
getStaticActionMenuItems() {
if (
this.props.resModel === "product.template" &&
!user.isSystem
) {
return {};
}
return super.getStaticActionMenuItems(...arguments);
},
});
Step 2: Load the JS in Manifest
Add the JS file to your module’s __manifest__.py:
'assets': {
'web.assets_backend': [
'your_module_name/static/src/js/hide_action_menu.js',
],
},If you have any questions, feel free to reach out.
Hope this helps!
Thanks and Regards,
Email: odoo@aktivsoftware.com
Hello,
Visit my answer:https://www.odoo.com/forum/help-1/hide-duplicate-and-delete-button-per-user-294653
You need to do little changes in code as per your requirement.
Let me know if you need assistance regarding this.
Thanks
info@codespheretech.in
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
0
Sep 25
|
2288 | ||
|
How do you create a button?
Solved
|
|
3
Apr 17
|
4118 | |
|
|
0
Apr 17
|
6307 | ||
|
|
3
Dec 25
|
554 | ||
|
|
2
May 24
|
10406 |