Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
9018 Lượt xem

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..%

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 23
1335
0
thg 2 23
1789
3
thg 3 18
21845
2
thg 7 16
4581
3
thg 6 23
4211