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

Field authorisation for users

By
shafeequemonp
on 4/22/14, 4:58 AM 930 views

I want to make certain column fields in Notebook->table widget editable for certain users and readonly for other users.how can i do that?can anyone help me to fix it?

2
Roc cheng
On 4/22/14, 6:30 AM

Hi,use attrs for the field in XML: defined create_uid in .py:

'create_uid': fields.many2one('res.users', 'Author', select=True, readonly=True),

the doc for create_uid link

  • create_uid: user who created the record
  • create_date: date when the record was created
  • write_uid: last user who changed the record
  • write_date: date of the last change to the record

Then in XML:

<field name="xxx" string=xxx" attrs="{'readonly':[('create_uid','!=',uid)]}"/>

But that the uid is currently not supported in the attrs attribute:

https://bugs.launchpad.net/openobject-server/+bug/920033

more details you may refer to:

Link

Hope it will help you!

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: 4/22/14, 4:58 AM
Seen: 930 times
Last updated: 3/16/15, 8:10 AM