In hamburger button:
First, I used this code to make the entire section read-only, but it also disabled the hamburger icon, so I could not add lots at all:
<xpath expr="//field[@name='move_ids_without_package']" position="attributes">
Then, I changed the code by setting each individual column to read-only, leaving only the hamburger icon editable:
<xpath expr="//field[@name='move_ids_without_package']/list/field[@name='product_id']" position="attributes">
(…and similar XPaths for other columns)
The result is: all columns are read-only, so users cannot add new products — which is correct — and the hamburger icon still works, which is also what I want.
However, I also want to hide the “Add a line” button.
I tried:
This hides Add a line, but it disappears permanently.
<xpath expr="//field[@name='move_ids_without_package']/list" position="attributes">
But this does not work — look like the create attribute seems to accept only True/False/1/0 and ignores domain-like expressions.
My question is:
Is it possible to hide the “Add a line” button conditionally (based on state and approval fields) while still keeping the hamburger icon editable?