I am trying to make an automation using studio's automations, I am doing it with the execute code action, what I want it to do is see if a many2one field exists, if it does delete that record. How do I do it only in studio (v18)? See this code snippet:
# Check if the record has a partner_id if record.partner_id: client = record.partner_id # Attempt to find a lead linked to the client # Need to verify if the lead exists and delete it # Unsure how to proceed with checking and deletion in Studio