attrs readonly doesn't work with one2many fields

Bug #507533 reported by David Janssens
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Undecided
Sananaz (Open ERP)

Bug Description

in web client v5:
When setting a one2many field readonly using the 'attrs=' attribute, the field can still be edited.
(meaning lines can still be added to the field, although it is supposed to be read-only)

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Can you paste here how you are doing it?

Cristian,

Revision history for this message
David Janssens (david.j-almacom) wrote : Re: [Bug 507533] Re: attrs readonly doesn't work with one2many fields

for example:

<field name="lines" attrs="{'readonly':[('other_field','!=',123)]}"/>

it works for regular fields but not for one2many.
i checked in the form_state.js file in web client and saw that is
missing (although apparently it supports many2many).

Thanks,
--
David Janssens
Almacom (Thailand) Ltd.
http://almacom.co.th/

Cristian Salamea (GnuThink) wrote:
> Can you paste here how you are doing it?
>
> Cristian,
>
>

Revision history for this message
David Janssens (david.j-almacom) wrote :

here is a quick patch to fix one2many readonly problem

Thanks,
--
David Janssens
Almacom (Thailand) Ltd.
http://almacom.co.th/

David Janssens wrote:
> for example:
>
> <field name="lines" attrs="{'readonly':[('other_field','!=',123)]}"/>
>
> it works for regular fields but not for one2many.
> i checked in the form_state.js file in web client and saw that is
> missing (although apparently it supports many2many).
>
> Thanks,
>

Navrang Oza (noz-tiny)
Changed in openobject-client-web:
assignee: nobody → sma (Tiny) (sma-tiny)
Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello,

Its fixed in stable. Please update your code and notify us.

Revision-Info:
2806 <email address hidden>

Thanks.

Changed in openobject-client-web:
status: New → Fix Committed
Changed in openobject-client-web:
milestone: none → 5.0.11
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.