How to make a single field editable for a specific group in a form view?

Hi all,

I’m trying to make the quantity field editable in the production form view for users in a specific group (sample_production_user).
Right now, non-admin users can’t create or edit this form which is what I would want, everything but the quantity field.

    <!-- Quantity can be changed by Woven Label Designer -->
    <record model="ir.model.field.access" id="access_production_quantity_woven_label_designer">
        <field name="model">production</field>
        <field name="field">quantity</field>
        <field name="group" ref="sample_production_user"/>
        <field name="perm_create" eval="True"/>
        <field name="perm_read"   eval="True"/>
        <field name="perm_write"  eval="True"/>
        <field name="perm_delete" eval="False"/>
    </record>

How can I do something similar in Tryton — allow only this group to edit just the quantity field in the form, while keeping the rest of the model read-only for them?

Thanks!

This is complicated to do it with the model/field access only because you can not use the model access to make it read-only and then allow just one field. The model/field access are not exception based but addition of layers.
Of course you could create field access that restrict the access to all the field except quantity but it is complicated and difficult to maintain.

For me the best option is to remove the create/write access on the model for this group and create a wizard accessible to this group that update the quantity.

Thanks for the reply. Yes, that makes complete sense now you mentioned a wizard to change a single field in my case. Yeah I can imagine restricting a single field sounds complicated.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.