Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
1278 Vizualizări

Hey,

I want the user to be able to see a form (of the sale.order model) despite not having write access.

I have managed to give him read access with no write access based on some custom Record Rules, but despite having read access he cannot enter and see the form. What I was expecting is for him to be able to see the form and get the "denied error" when clicking on the "Edit" button

What am i missing?


Many thanks guys I have been searching, reading docs, watching yt videos for days to achieve my goal still failing (though learning a lot about security, groups, access rights, etc)

Imagine profil
Abandonează
Autor Cel mai bun răspuns

thanks, the scenario is:
sale.order has two groups: admin and regular user.
At first both users should be able to CRUD the sale.order. Afterwards only admins can mark the sale.order as "done", once it reaches this state, then regular users should not have write permissions on sale.order anymore. 

I have done this with Record Rules, on regular user's group:

Rule 1, sale.order, read, create and delete

Rule 2, sale.order, write if sale.order.state != "done"

But as I said before, once sale.order.state == "done", the regular user cannot open (read) the sale.order form cause it shows a Denied write error....

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

1. Go to settings->user & companies -> Group-> create

2. Select the application as sale 

3. select the users

4. set the access right -> model (sale)-> Tick the read access only


You can refer to the YouTube video on Security in Odoo 16: Groups and Access Rights in Odoo | Odoo 16 Development Tutorials

https://www.youtube.com/watch?v=PmSepSujsBk


Hope it helps



Imagine profil
Abandonează
Cel mai bun răspuns

Not sure whether this is practical for you, but you could copy the Form View and amend the XML to make the Form Read-only.  Authorize some users to only the new menu option running the updated form view.


Imagine profil
Abandonează

 <form string="Sales Order" edit="0" class="o_sale_order">

Related Posts Răspunsuri Vizualizări Activitate
2
ian. 25
1826
1
sept. 22
3862
1
dec. 20
6310
0
aug. 19
3360
1
iul. 24
839