Lock Editable Tree based on States


I’m trying to make a one2many editable tree readonly based on states but it doesn’t seem to work in Tryton-SAO 5.0.34. It seems that the issue doesn’t appear in 5.6 but I can’t seem to find any patch for 5.0 for this issue.

May I know how can I resolve this?


What is not working?

Hi @ced,
For example in the image above, which I tested on demo5.0.tryton.org
the one2many tree is still editable when the record state is done.

This is the expected behavior if you set the readonly only on the One2Many. The records inside the One2Many must also set their field as readonly in your case.
But as it is the inventory, the states are already set on the fields. So it seems to be a bug in sao 5.0 which was solved later. It is probably a refactoring otherwise the fix would have been backported.

Even if we still maintain 5.0 series, it is always better to work on the latest because 5.0 maintenance is just best effort and it is a lot reduced over time.