As we know, there is a button "Add an item" in tree view of form view, click button "Add an item" to create a new line of the one2many.
As we know, there is a field "state" in many models.
So, I try to fix that match the following two requirements:
1) when state is not "done", I can see "Add an item" and edit other lines.
2) when state is "done", "Add an item" is disappear and edit other lines.
I have tried a lot but failed.
Such as:
1)
<tree create="0" edit="1">
It's not dynamic, so it does't match any requirements.
2)
<tree create="[('state','!=','done')]" edit="1">
Does not take effect and gives an error.
Error message: "Unknown CORS error" "An unknown CORS error occured. The error probably originates from a JavaScript file served from a different origin. (Opening your browser console might give you a hint on the error.) "
3)
<tree create="state!='done'" edit="1">
Error is the same with above.
4)
<tree attrs="{'create':[('state','!=','done')]}" edit="1">
No effect or error.