def METHOD_NAME(self, vals):
    res = super(ResPartner, self).METHOD_NAME(vals)
    # REVIEW: Force Contrain vat
    # https://github.com/odoo/odoo/issues/23242
    for partner in self:
        if vals.get("vat") or vals.get("country_id"):
            country = (
                self.env["res.country"].browse(vals.get("country_id"))
                or partner.country_id
            )
            if country.code == "ES":
                self.check_vat()
            self._pms_check_unique_vat()
    return res