parameters: (self)
return_statement: return super(AccountPaymentMethodLine, unused_payment_method_lines).unlink()
docstring: Payment method lines which are used in a payment should not be deleted from the database,
          only the link betweend them and the journals must be broken.
docstring_summary: Payment method lines which are used in a payment should not be deleted from the database,
          only the link betweend them and the journals must be broken.
docstring_tokens: Payment method lines which are used in a payment should not be deleted from the database only the link betweend them and the journals must be broken .
function: def unlink(self):
          """
          Payment method lines which are used in a payment should not be deleted from the database,
          only the link betweend them and the journals must be broken.
          """
          unused_payment_method_lines = self
          for line in self:
              payment_count = self.env['account.payment'].search_count([('payment_method_line_id', '=', line.id)])
              if payment_count > 0:
                  unused_payment_method_lines -= line
  
          (self - unused_payment_method_lines).write({'journal_id': False})
  
          return super(AccountPaymentMethodLine, unused_payment_method_lines).unlink()
function_tokens: def unlink ( self ) : unused_payment_method_lines = self for line in self : payment_count = self . env [ 'account.payment' ] . search_count ( [ ( 'payment_method_line_id' , '=' , line . id ) ] ) if payment_count > 0 : unused_payment_method_lines -= line ( self - unused_payment_method_lines ) . write ( { 'journal_id' : False } ) return super ( AccountPaymentMethodLine , unused_payment_method_lines ) . unlink ( )