I have created a new model in my custom module.
There is a field
state = fields.Selection(
string='Status', readonly=True, default='draft',
selection=[
('draft', 'Draft'),
('open', 'Open'),
('in_payment', 'In payment'),
('paid', 'Paid'),
('cancel', 'Cancelled'),
],
required=False, )
field and functions that change the state depending on how my module works.
I want that when the record goes to the cancel state (when state = cancel) for example the Modify button disappears to prevent the user to modify it
NB: I know the readonly attribute and I don't want to use it
Can someone help me please ?