states are:-
state = fields.Selection([('Unassigned', 'Unassigned'), ('Assigned', 'Assigned'), ('Is Repair', 'Under Repair'), ('Scraped', 'Scraped')], default="Unassigned", string='States', track_visibility="onchange")
now i want to disable the edit button on the "Scraped" state. I tried all the things that are available over the internet but unfortunately, nothing works for me. Any suggestions would be appreciated.
this is the XML:-
<odoo><data>
<recordid="asset_management_assets__form"model="ir.ui.view"><fieldname="name">asset.assets.formfield><fieldname="model">asset.assetsfield><fieldname="arch"type="xml"><formstring="Assets"><header><buttonid="button_confirm_scrap"name="scrap_action_confirm"string="Scrap"class="btn-primary"type="object"attrs="{'invisible':[['state', 'in', ['Unassigned','Scraped']]]}"/><buttonid="button_confirm_repair"name="repair_action_confirm"string="Mark Repair Done"class="btn-primary"type="object"attrs="{'invisible':[['state', 'in', ['Unassigned', 'Assigned', 'Scraped']]]}"/><fieldname="state"widget="statusbar"/>header><sheet><groupcol="1"><groupcol="4"><separatorstring="Asset"colspan="4"/><fieldname="asset_name"/><fieldname="asset_category"/><fieldname="date_of_purchase"/><fieldname="employee_id"/><fieldname="makeandmodel"/><fieldname="serial_number"/><fieldname="vendor_id"/>group><group><fieldname="comments"/>group><groupcol="4"><separatorstring="Warranty Details"colspan="4"/><fieldname="warranty_start_date"/><fieldname="warranty_end_date"/><fieldname="repair_vendor_id"/>group><groupcol="4"><fieldname="attachments"filename="attachments_name"/><fieldname="attachments_name"invisible="1"/>group>group>sheet><divclass="oe_chatter"><fieldname="message_follower_ids"widget="mail_followers"/><fieldname="activity_ids"widget="mail_activity"/><fieldname="message_ids"widget="mail_thread"/>div>form>field>record>
data>odoo>