<?xml version="1.0"?>
<t t-name="account_edi_ubl_cii.ubl_20_PartyType">
        <t xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" 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')"/>
            <t t-foreach="vals.get('party_identification_vals', [])" t-as="party_vals">
                <cac:PartyIdentification>
                    <cbc:ID t-att="party_vals.get('id_attrs', {})" t-out="party_vals.get('id')"/>
                </cac:PartyIdentification>
            </t>
            <t t-foreach="vals.get('party_name_vals', [])" t-as="party_vals">
                <cac:PartyName>
                    <cbc:Name t-out="party_vals.get('name')"/>
                </cac:PartyName>
            </t>
            <cac:PostalAddress>
                <t t-call="{{AddressType_template}}">
                    <t t-set="vals" t-value="vals.get('postal_address_vals', {})"/>
                </t>
            </cac:PostalAddress>
            <t t-foreach="vals.get('party_tax_scheme_vals', [])" t-as="foreach_vals">
                <cac:PartyTaxScheme>
                    <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:TaxScheme>
                        <cbc:ID t-out="foreach_vals.get('tax_scheme_id')"/>
                    </cac:TaxScheme>
                </cac:PartyTaxScheme>
            </t>

            <t t-foreach="vals.get('party_legal_entity_vals', [])" t-as="foreach_vals">
                <cac:PartyLegalEntity>
                    <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>
            </t>
            <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>
        </t>
    </t>

    