Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

3

How to remove "View Delivery Order" button from confirmed sale orders for a specific user?

By
Anas Taji
on 3/1/13, 5:19 PM 2,710 views

Hi all,,

For the confirmed sale orders, is it possible to hide one of the header buttons for a specific user? in my case, "View Delivery Order"

Thanks in advance..%

2
nazarii
On 3/2/13, 4:10 PM

Yes, it is possible. Here is my solution:

  1. create functional boolean field in stock.picking model that will return True or False, depending on user logged in;
  2. In xml using xpath modify attributes of this button, include this func field, smth like this:

    <xpath expr="//button[@name='button_name']" position="attributes"> <attribute name="attrs">{'invisible': [('func_field', '=', False)]}</attribute> </xpath>

Don't forget to add your functional field to stock.picking form view.

Thanks for the response, and here is another way Go to Settings->User Interface->Views and edit "sale.order.form.sale.stock" by changing the groups associated with the button.

<button name="action_view_delivery" string="View Delivery Order" type="object" class="oe_highlight" attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}" groups="base.group_user"/>

You may change the group which you want to give there users access to the button, so i change it to base.group_sale_manager.

Smart Way LLC, Anas Taji
on 3/2/13, 4:47 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 3/1/13, 5:19 PM
Seen: 2710 times
Last updated: 3/16/15, 8:10 AM