code: def delete(self):
          
          ids = self.rpc_model.search(self.domain, context=self.context)
          if ids:
              self.rpc_model.delete(ids)
docs: Delete all records matching the query.
  
          Warning: This is a desctructive operation.
  
          Not every model allows deletion of records and several models
          even restrict based on status. For example, deleting products
          that have been transacted is restricted. Another example is sales
          orders which can be deleted only when they are draft.
  
          If deletion fails, a server error is thrown.