def METHOD_NAME(
    self, amount_company_currency, amount_payment_currency, payments
):
    if self.payment_type == "outbound":
        name = _("Payment order %s") % self.name
        account = self.journal_id.payment_credit_account_id
    else:
        name = _("Debit order %s") % self.name
        account = self.journal_id.payment_debit_account_id
    partner = self.env["res.partner"]
    for index, payment in enumerate(payments):
        if index == 0:
            partner = payment.payment_line_ids[0].partner_id
        elif payment.payment_line_ids[0].partner_id != partner:
            # we have different partners in the grouped move
            partner = self.env["res.partner"]
            break
    sign = self.payment_type == "outbound" and -1 or 1
    vals = {
        "name": name,
        "partner_id": partner.id,
        "account_id": account.id,
        "credit": (
            self.payment_type == "outbound" and amount_company_currency or 0.0
        ),
        "debit": (
            self.payment_type == "inbound" and amount_company_currency or 0.0
        ),
        "currency_id": payments[0].currency_id.id,
        "amount_currency": amount_payment_currency * sign,
    }
    return vals