code: def create_transaction(self, to_account):
          
          from_account = self.statement_import.bank_account
  
          transaction = Transaction.objects.create()
          Leg.objects.create(
              transaction=transaction, account=from_account, amount=+(self.amount * -1)
          )
          Leg.objects.create(transaction=transaction, account=to_account, amount=-(self.amount * -1))
  
          transaction.date = self.date
          transaction.save()
  
          self.transaction = transaction
          self.save()
          return transaction
docs: Create a transaction for this statement amount and account, into to_account
  
          This will also set this StatementLine's ``transaction`` attribute to the newly
          created transaction.
  
          Args:
              to_account (Account): The account the transaction is into / out of.
  
          Returns:
              Transaction: The newly created (and committed) transaction.