<?xml version="1.0"?>
<t t-name="account_edi_ubl_cii.ubl_20_PartyType">
        <t xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
            <t t-set="partner" t-value="vals.get('partner') or builder.env['res.partner']"/>
            <cbc:EndpointID t-att="vals.get('endpoint_id_attrs', {})" t-out="vals.get('endpoint_id')"/>
            <cac:PartyIdentification t-foreach="vals.get('party_identification_vals', [])" t-as="party_vals">
                <cbc:ID t-att="party_vals.get('id_attrs', {})" t-out="party_vals.get('id')"/>
            </cac:PartyIdentification>
            <cac:PartyName t-foreach="vals.get('party_name_vals', [])" t-as="party_vals">
                <cbc:Name t-out="party_vals.get('name')"/>
            </cac:PartyName>
            <cac:PostalAddress>
                <t t-call="{{AddressType_template}}">
                    <t t-set="vals" t-value="vals.get('postal_address_vals', {})"/>
                </t>
            </cac:PostalAddress>
            <cac:PhysicalLocation>
                <t t-set="physical_location_vals" t-value="vals.get('physical_location_vals', {})"/>
                <cac:Address>
                    <t t-call="{{AddressType_template}}">
                        <t t-set="vals" t-value="physical_location_vals.get('address_vals', {})"/>
                    </t>
                </cac:Address>
            </cac:PhysicalLocation>
            <cac:PartyTaxScheme t-foreach="vals.get('party_tax_scheme_vals', [])" t-as="foreach_vals">
                <cbc:RegistrationName t-out="foreach_vals.get('registration_name')"/>
                <cbc:CompanyID t-att="foreach_vals.get('company_id_attrs', {})" t-out="foreach_vals.get('company_id')"/>
                <cbc:TaxLevelCode t-att="foreach_vals.get('tax_level_code_attrs', {})" t-out="foreach_vals.get('tax_level_code')"/>
                <cac:RegistrationAddress>
                    <t t-call="{{AddressType_template}}">
                        <t t-set="vals" t-value="foreach_vals.get('registration_address_vals', {})"/>
                    </t>
                </cac:RegistrationAddress>
                <cac:TaxScheme>
                    <t t-set="tax_scheme_vals" t-value="foreach_vals.get('tax_scheme_vals', {})"/>
                    <cbc:ID t-att="tax_scheme_vals.get('id_attrs', {})" t-out="tax_scheme_vals.get('id')"/>
                    <cbc:Name t-out="tax_scheme_vals.get('name')"/>
                </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:PartyLegalEntity t-foreach="vals.get('party_legal_entity_vals', [])" t-as="foreach_vals">
                <cbc:RegistrationName t-out="foreach_vals.get('registration_name')"/>
                <cbc:CompanyID t-att="foreach_vals.get('company_id_attrs', {})" t-out="foreach_vals.get('company_id')"/>
                <cac:RegistrationAddress>
                    <t t-call="{{AddressType_template}}">
                        <t t-set="vals" t-value="foreach_vals.get('registration_address_vals', {})"/>
                    </t>
                </cac:RegistrationAddress>
            </cac:PartyLegalEntity>
            <cac:Contact>
                <t t-set="contact_vals" t-value="vals.get('contact_vals', {})"/>
                <cbc:ID t-out="contact_vals.get('id')"/>
                <cbc:Name t-out="contact_vals.get('name')"/>
                <cbc:Telephone t-out="contact_vals.get('telephone')"/>
                <cbc:ElectronicMail t-out="contact_vals.get('electronic_mail')"/>
            </cac:Contact>
            <cac:Person>
                <t t-set="person_vals" t-value="vals.get('person_vals', {})"/>
                <cbc:FirstName t-out="person_vals.get('first_name')"/>
                <cbc:FamilyName t-out="person_vals.get('family_name')"/>
            </cac:Person>
        </t>
    </t>

    