title: Odoo restrict delete of record that is still referenced (m2m)
body: <p>I have this field:</p>
  
  <pre><code>range_application_ids = fields.Many2many('insurance.commission.rule.range.application', 'application_rule_range_rel', 'rule_range_id',
      'application_id', 'Applications', ondelete='restrict', required=True)
  </code></pre>
  
  <p>I need to restricts delete of that models (<code>insurance.commission.rule.range.application</code>) records if it is referenced through Many2many relation. Now if I go to that models records list and delete any of it, Odoo won't throw any warning and lets me do it. Then when I got to another models record that has relation with <code>insurance.commission.rule.range.application</code> through many2many field, I see that it was removed (and that field is required). Setting <code>ondelete='restrict'</code> did not do anything.</p>
  
  <p>Is there a way to restrict such deletes with Odoo standard functionality or I need to implement such checking myself?</p>