Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to prevent user from inputting specific data on a field?

By
David
on 3/27/14, 5:37 PM 777 views

I want to prevent a user/group from editing a Purchase Order based on whether the partner reference field is blank or not. I tried to create a non global record rule with the following domain rule:

[('partner_ref', '=', False)]

applied to create, write and delete. As expected, the user can't create, delete or change a purchase order with a non blank partner reference. But, if the user create a record with a blank partner reference, save it, and then edit, he can save it with a non blank field, which is not what I want. How can I prevent that?

Set the permission for particular user or group in ir.model.access.csv under security.

silvi
on 3/28/14, 12:18 AM

They already have all model access permissions, in addition to those I want to limit based on a specific field value, hence the use of Record Rules.

David
on 3/28/14, 12:40 PM
0
PJ Soule
On 3/28/14, 12:44 PM

Hello,

You can, by view inheritance, hide the partner_ref field for that group, it should work.

The field should be visible to the user, but read-only.

David
on 3/28/14, 3:25 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 3/27/14, 5:37 PM
Seen: 777 times
Last updated: 3/16/15, 8:10 AM