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

make fields as read only based on groups

By
nagarjuna
on 9/8/15, 7:16 AM 469 views

i have 2 groups in my application (group_staff, group_user). i have the below view

<record id="view_staff_reservation_form" model="ir.ui.view">

<field name="name">reservation.form.view</field>

<field name="model">reservations.reservation</field>

<field name="arch" type="xml">

<tree string="Reservation">

<field name="id"></field>

<field name="reserve_item_id"></field>

<field name="is_reserve"></field>

<field name="is_reserve_accepted"></field>

</tree>

</field>

</record>

i need to make is_reserve field is readonly for group_staff and i need to make is_reserve_accepted field is readonly for group_user. can anybody help on this

0
nagarjuna
On 9/9/15, 2:02 AM

Hi Ludovic CHEVALIER,

Thanks for the reply. i tried it. but not working

0
Ludovic CHEVALIER
On 9/8/15, 11:47 AM

Maybe something like this:

        <field name="is_reserve" readonly="1" groups="group_staff"/>
<field name="is_reserve" groups="group_user"/>
<field name="is_reserve_accepted" readonly="1" groups="group_user">
<field name="is_reserve_accepted" groups="group_staff">

Bye!

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

1 follower(s)

Stats

Asked: 9/8/15, 7:16 AM
Seen: 469 times
Last updated: 9/9/15, 2:02 AM