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

Hello, I have Odoo 8.

I override the "create" method of the model "product.pricelist.item" in which I do some things after the record is created. In updating the record, I have some problems, so I don't want to allow the update. How can I turn off the "save" button when the user is updating, or how to display an error message when the user presses this button?

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

Use security groups... 
By putting a user in high security restricted gruoup you can deny him some rights... 
For any field (attribute) of any model you can specify CRUD (create,read,update, delte) rights...

You can modify them in GUI (Settings > Technical > Security 
Or modify then via custom module and import security rules : )

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

Thanks for your answer! And how can I don't allow update action for any user? On all fields of a model

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

I have created a rule in a custom module: "access_noModificaPriceListItem,access_noModificaPricelistItem,model_product_pricelist_item,,1,0,1,1" . Also I go to Techicanl -> Models -> product.pricelist.item and I uncheck all permissions of write. But the admin user still can modify the record

user admin is "superuser" with "supercow" privileges : ) closest thing to root user in linux, or admininistrator on windows... he is actualy supposed to be able to do things like that, also... user admin is not intended to be used for regular activities like creating documents etc.... that is the task for regular users :) (according to their group/user policies)

Tác giả

I'll go to create a regular user... thanks!

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 22
15428
1
thg 11 21
5509
0
thg 1 21
2783
8
thg 5 20
8428
0
thg 12 23
3345