On change method doesn't update inline editing read only value

Bug #1153853 reported by Ignas Karpiejus @ hbee on 2013-03-12
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Opinion
Undecided
OpenERP Publisher's Warranty Team

Bug Description

Hello all,

quick description - adding many2one field, defining tree view with editable="bottom" for it and adding on_change function for one of those tree fields to change other read only field, now when it's in form - it shows changed value in read only field, doesn't write, but just shows (I suppose this is the way it was designed), but when editing is done inline it doesn't update (show) the read only field with passed value (seems as a bug to me). Checked with openerp-7.0-20130305-002149. Thank you in advance.

Related branches

tags: removed: only read
Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance

Hello,

I have checked your issue(with latest code) on both scenario with editable list view and form view but readonly field takes the data passed from the onchange, so this is working as expected.

I have also uploaded a video here for reference : http://youtu.be/4vL3oVnq95U
I am setting the bug status to 'Invalid'.

Regards,
Amit

Changed in openobject-server:
status: New → Invalid

The video is showing the read only field only being updated once the line being edit has lost focus, the field is not updated while it still has focus.
All other fields which are not read only are updated by the on change handler while the line still has focus.

I would consider this an aesthetic bug more than anything, but something which could confuse users.

Thanks,
Craig

Changed in openobject-server:
status: Invalid → Opinion

After further investigation I have found the cause of the problem.
On a tree view, when a line is being edited the edit line is overlaid ontop of the original line. Any of the readonly fields are invisible, but are updated immediately with the onchange. The field which is not being updated is from the original line which does not get updated until the line has lost focus.

Two ways I can think this could be fixed:
* The onchange will also update the original line with the onchange handler - and when an edit is cancelled this line is refreshed anyway so this won't cause major issues.
* The readonly fields are not invisible - but formatting will need adding so they are displayed correctly.

Also I will check to see what the behaviour is if the field is only readonly due to a domain, I'm guessing the line would redraw?

I have got a working fix in place to draw the read only fields as a disabled input element instead of just making it invisible.
It does seem slightly hacky matching the attributes and not matching the sequence field directly, so there is likely a more elegant fix that could be made instead by someone more familiar with the internals of the web server.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers