title: How to force remove records form lines in odoo?
body: <p>something wrong happened in account moves as adding an analytic account to journal items of vendor bills and I need to loop on all lines in account moves and remove the analytic account from all lines by this bit of code </p>
  
  <pre><code>class NewModule(models.Model):
  _inherit = 'account.move'
  
  def analytic(self):
      all=self.env['account.move'].search([('type','=','in_invoice')])
      ana=all.line_ids.mapped('analytic_account_id')
      ana.unlink()
  </code></pre>
  
  <p>but when this method run I get this error <strong>"The operation cannot be completed: another model requires the record being deleted. If possible, archive it instead.
  Model: Analytic Line (account.analytic.line), Constraint: account_analytic_line_account_id_fkey"</strong> as image below 
  <a href="https://i.stack.imgur.com/96aUx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/96aUx.png" alt="enter image description here"></a></p>
  
  <p>otherwise if tried to remove the analytic account for UI it removed without any issues but there is too many bills to do it manually </p>
  
  <p>any help will be appreciated </p>