(self)
return res
V 1.2
        <element name="NIF" type="T:NIFType"/>
            <length value="9" />
            <pattern value="(([a-z|A-Z]{1}\\d{7}[a-z|A-Z]{1})|(\\d{8}[a-z|A-Z]{1})|
            ([a-z|A-Z]{1}\\d{8}))" />
        :return: VAT Number for Customers from Spain or the Company associated partner.
V 1.2
        <element name="NIF" type="T:NIFType"/>
            <length value="9" />
            <pattern value="(([a-z|A-Z]{1}\\d{7}[a-z|A-Z]{1})|(\\d{8}[a-z|A-Z]{1})|
            ([a-z|A-Z]{1}\\d{8}))" />
        :return: VAT Number for Customers from Spain or the Company associated partner.
V 1 . 2 <element name = NIF type = T : NIFType / > <length value = 9 / > <pattern value = (( [ a - z|A - Z ] { 1 } \\ d { 7 } [ a - z|A - Z ] { 1 } ) | ( \\ d { 8 } [ a - z|A - Z ] { 1 } ) | ( [ a - z|A - Z ] { 1 } \\ d { 8 } )) / > : return : VAT Number for Customers from Spain or the Company associated partner .
def tbai_get_value_nif(self):
        """V 1.2
        <element name="NIF" type="T:NIFType"/>
            <length value="9" />
            <pattern value="(([a-z|A-Z]{1}\\d{7}[a-z|A-Z]{1})|(\\d{8}[a-z|A-Z]{1})|
            ([a-z|A-Z]{1}\\d{8}))" />
        :return: VAT Number for Customers from Spain or the Company associated partner.
        """
        country_code = self.tbai_get_partner_country_code()
        vat_number = self.tbai_get_partner_vat_number()
        if (
            vat_number
            and country_code
            and self.env.ref("base.es").code.upper() == country_code
        ):
            tbai_utils.check_spanish_vat_number(
                _("%s VAT Number") % self.name, vat_number
            )
            res = vat_number
        else:
            res = ""
        return res
def tbai_get_value_nif ( self ) : country_code = self . tbai_get_partner_country_code ( ) vat_number = self . tbai_get_partner_vat_number ( ) if ( vat_number and country_code and self . env . ref ( "base.es" ) . code . upper ( ) == country_code ) : tbai_utils . check_spanish_vat_number ( _ ( "%s VAT Number" ) % self . name , vat_number ) res = vat_number else : res = "" return res