Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
1287 Представления

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)

Аватар
Отменить
Автор Лучший ответ

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

Аватар
Отменить
Лучший ответ

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



Аватар
Отменить
Лучший ответ

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.


Аватар
Отменить

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

Related Posts Ответы Просмотры Активность
2
янв. 25
1833
1
сент. 22
3875
1
дек. 20
6337
0
авг. 19
3382
1
июл. 24
850