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