İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
697 Görünümler

Create a new group

Hide new

Hide new has the person who shouldn't see the button

Show new

Views are shown

I put this code referencing the button name and the other one referencing the tree, but they don't work for me.

<xpath expr="//header/button[@name='316']" position="attributes">

  <attribute name="groups">sales_team.ocultar_nuevo</attribute>

</xpath>

<!--

<xpath expr="//tree" position="attributes" groups="sales_team.ocultar_nuevo">

  <attribute name="create">false</attribute>

</xpath>-->

<xpath expr="//header/button[@name='316']" position="attributes">

  <attribute name="groups">sales_team.mostrar_nuevo</attribute>

</xpath>

<!--

<xpath expr="//tree" position="attributes" groups="sales_team.mostrar_nuevo">

  <attribute name="create">true</attribute>

</xpath>-->

I even looked for the main view sale.order and added the group there and it still doesn't show up, that was the first thing I did before creating the inherited views



Thank you very much for everything, and I hope you can help me.

Best regards



Avatar
Vazgeç

In your screens you're applying a group on the Create Invoice button / refer to an action 316 (Create invoice in your setup), in the subject you talk about new Sales. What do you want to accomplish exactly? Do you want to prevent specific users from creating Sale Orders? Because this should be handled by groups only - without any view modification. For this to be a meaningful setup in terms of the general structure, you may refer to https://www.odoo.com/de_DE/forum/hilfe-1/new-group-in-the-sales-category-in-odoo-17-279845#answer-279850 (different topic, but it outlines how groups in general interact with each other). In short, you probably want to define a group prior to group_sale_salesman_all_leads, i.e. group_sale_salesman_all_leads_read_only and set it and its predecessors 1,0,0,0 (read only - or 1,1,0,0 read and write but no create).

Üretici

That's right, I wish people in groups couldn't create sell orders.
I had created two groups, one for hiding and one for viewing. I did this because when I hid the person and removed them from the hide group, they wouldn't see the button again.

Üretici

I really just want to hide the New button.

I was doing this based on a group; I created two because when I hid and removed the person from the group, they wouldn't see the button even though they weren't part of that group.

The question is, is it possible to do it on the

<xpath expr="//header/button[@name='316']" position="attributes">

Or on this

<attribute name="groups">sales_team.show_new</attribute>


</xpath>

Üretici

Thanks for your response.

The issue is, if the person is in the CRM module and needs to create a quote, they do this based on the sale.order module. Since the checkbox is not selected, an error will be thrown. How can this be resolved with your module, or how would it be done?

'That's right, I wish people in groups couldn't create sell orders.' and 'I really just want to hide the New button.' - which one is it? When randomly changing requirements, things get messy - and cumbersome. Consider phrasing a new question that covers all the aspects of what you actually want to achieve and what you've done so far to try to achieve it.
Also, the question 'Why are we even trying to do this?' seems fair at this point: 'Users should be able to create SO - but only from those buttons I want them to use.' - why is that? What kind of users are we dealing with? Are these external sales persons meant to work on assigned leads only? Should they then really not be able to provide you with new Sales when they just happen to know someone who wants to buy your goods or services?

Üretici

This is the code that hides the button again.
<xpath expr="//tree" position="attributes" groups="sales_team.ocultar_nuevo">
<attribute name="create">false</attribute>
</xpath>

Üretici

Thank you very much.

I understood what you were saying about groups and levels. Just one question: when creating the group and making the call in the view inherited from sale.order.tree, why is the button hidden once if the user hasn't been added to the group?

Oh, yes, I created the group as a technical group.

En İyi Yanıt

Hi,


To hide the new button in the 'sale.order', you must remove the create access for the user group.

1- Enable developer mode.

2- Go to the user group.

      Settings > Users & Companies > Groups 

      You can just select your user group that needs to hide the New button.

3- Disable the create access for the sales model as follows.



4-  If you log in as the user in that user group, you can see that the 'New' button is invisible.


Hope it helps

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Ağu 25
147
1
Şub 25
1312
2
Haz 25
1999
3
Ağu 25
324
2
Ağu 25
334