Don Kirkby
Don Kirkby

Reputation: 56660

Hide sidebar button in OpenERP

I'm trying to write a module for OpenERP 6.1 that will hide the "Send an SMS" button on the Partner form. I tried overwriting the window action's id with a different name and src_model, but only the name change appeared. I traced through the code, and it looks like the ir_values records from the base module are still linking the action to the res.partner model.

Is there a legitimate way to hide a sidebar button, or am I going to have to modify the base module? I briefly tried restricting permissions on the wizard's table, but that didn't seem to have an effect.

Upvotes: 3

Views: 1846

Answers (5)

Sudhir Arya
Sudhir Arya

Reputation: 3743

Just add multi="True" on .
This allows to hide the action in form view but you can use it from "action" gear icon in menu.

<act_window id="action_partner_sms_send" 
    name="Send an SMS"
    res_model="partner.sms.send"
    src_model="res.partner"
    view_mode="form"
    target="new"
    key2="client_action_multi"
    multi="True"/>

Reference: https://lists.launchpad.net/openerp-dev/msg00012.html

Thank you.

Upvotes: 1

Sudhir Arya
Sudhir Arya

Reputation: 3743

Just try the <delete> tag, it works for XML as well as YAML. You can delete a specific record by its XML id, or use search criteria.

<delete model="ir.actions.act_window" id="other_module.action_id"/>

Upvotes: 2

OmaL
OmaL

Reputation: 5044

Please try by creating a new group and provide this group to your button/link and don't add this group to any user.

Upvotes: 0

Daniel Reis
Daniel Reis

Reputation: 13342

Go to the "Settings" module:

  • Open menu option Customization -> Low Level Objects -> Window Actions.
  • Search for "SMS" in the Action Name and open it's form.
  • In the "Security" tab you can set the groups that can view this action. Add the "Administrator / Configuration" group and it will be hidden to regular users.

Upvotes: 1

Shelton
Shelton

Reputation: 116

In the view for the window add

multi="False" 

<act_window name="Invoice Membership"
        res_model="membership.invoice"
        src_model="res.partner"
        multi="False"
        key2="client_action_multi"
        view_mode="form"
        id="action_membership_invoice_view"/>

Upvotes: 1

Related Questions