Parent's on_change modifying a value is not reflected on the line
The attached tarball contains a minimal module displaying the behaviour that I will try to explain the more clearly possible. To display it you should install this module, create a new "Header" and in the header create a new "Line". You select "Split" for the status of the line and a quantity > 1.
The code in Header splits the quantity and create a new line with the remaining quantity. Unfortunately the quantity of the current line although set by the on_change does not change even if you quit the cell. This behavior is tryton specific and works as expected on sao.
I identified that the origin of the error is the fact that the editable widget attached to the cell is not updated when we receive the data from the on_change call while the value stored in the record is indeed changed.
The way I fixed it is by modifying the 'on_editing_done' (which is called a second time because the value changed) to skip the method if the cell has been updated. But while reviewing my patch I noticed that it was the same as testing if the widget related to the column has an editable entry linked to it. Which makes the whole function useless (you can access my WIP in the review if you want a clearer view of the changes I did … it's in editabletree.py).
Files
Download | Creator | Timestamp | Type |
---|---|---|---|
entry_concurrency.tgz | @nicoe | 2020-04-16 08:09:02.350000 UTC | application/x-gtar-compressed |