跳至內容
選單
此問題已被標幟
2 回覆
12544 瀏覽次數

I have a field which i want to make it readonly for all the user from a group, lets say base.group_userA. any other users will be able to edit and save the field. How do i do that in openerp?. I have already set all CRUD access rights for all users.

 'WO_NOTES' : fields.text("Description"), 

in xml

<field name="WO_NOTES"/>.

 

 

頭像
捨棄
最佳答案

I had the same problem, only I wanted to show fields only to users in a group. I solved this by inheriting the view and made changes to the specific group.

In your case it should look something like this:

<?xml version="1.0"?>
<openerp>
    <data>
<record model="ir.ui.view"  id="view_id">
    <field name="name">view.id</field>
    <field name="model">your.model</field>
    <field name="inherit_id" ref="id_of_inherited_view"/>
    <field name="groups_id" eval="[(6, 0, [ref('base.group_userA') ])]"/>
    <field name="arch" type="xml">
        <field name="WO_NOTES" position="attributes">
            <attribute name="readonly">1</attribute>
        </field>
    </field>
</record>
    </data>
</openerp>

Hope this helps!

頭像
捨棄
最佳答案

Create a new group and inherit the field view and assign readonly for that paticular field.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
12月 21
9718
2
1月 16
4391
1
5月 23
3949
2
8月 20
2917
0
11月 15
4717