from odoo import api, models


class PaymentLinkWizardExternalTax(models.TransientModel):
    _inherit = "payment.link.wizard"

    @api.model
    def default_get(self, fields):
        res_id = self._context.get('active_id')
        res_model = self._context.get('active_model')


        if res_id and res_model:
            self.env[res_model].browse(res_id)._get_and_set_external_taxes_on_eligible_records()

        return super().default_get(fields)
