<commit_before><?xml version="1.0" encoding="utf-8"?>
<!-- © 2017 Comunitea
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>
    <template id="assets_common" name="custom css assets" inherit_id="report.assets_common">
        <xpath expr="." position="inside">
            <link rel="stylesheet" href="/custom_documents/static/src/css/custom.css"/>
        </xpath>
    </template>

    <template id="custom_layout">
        <!-- Multicompany -->
        <t t-if="not o and doc">
            <t t-set="o" t-value="doc"/>
        </t>
        <t t-if="o and 'company_id' in o">
            <t t-set="company" t-value="o.company_id"></t>
        </t>
        <t t-if="not o or not 'company_id' in o">
            <t t-set="company" t-value="res_company"></t>
        </t>


        <t t-if="o._name == 'sale.order'" t-call="custom_documents.custom_layout_header_sale" />
        <t t-if="o._name == 'stock.picking'" t-call="custom_documents.custom_layout_header_picking" />
        <t t-if="o._name == 'account.invoice'" t-call="custom_documents.custom_layout_header_invoce" />
        <t t-if="o._name == 'purchase.order'" t-call="custom_documents.custom_layout_header_purchase" />
        <t t-raw="0" />
        <t t-call="custom_documents.custom_layout_footer" />
    </template>

    <!-- cabecera para pedidos y proforma que se tratan como un pedidos, mira si esta marcado el campo neutro y logo se imprime proforma o pedido -->
    <template id="custom_layout_header_sale">
        <div class="header">
            <div class="row">
                <div class="col-xs-6 sombreado" style="margin-bottom: 15px;" t-if=" not o.neutral_document">
                    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>

                    <span t-field="company.partner_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
                    <p><strong>CIF/NIF:</strong> <span t-field="company.vat"/></p>
                    <p><strong>Telf.:</strong> <span t-field="company.phone"/> <strong>FAX:</strong> <span t-field="company.fax"/></p>
                </div>
                <div class="col-xs-5 col-xs-offset-1">

                     <t t-if="not noproforma">
                        <h1 t-if="o.state in ('draft', 'sent')">QUOTATION</h1>
                        <h1 t-if="o.state not in ('proforma', 'draft', 'sent')">ORDER</h1>
                        <h1 t-if="o.state == 'proforma'">PROFORMA</h1>
                    </t>
                     <t t-if="noproforma">
                        <h1 t-if="o.state in ('draft', 'sent')">QUOTATION</h1>
                        <h1 t-if="o.state not in ('draft', 'sent')">ORDER</h1>
                    </t>


                </div>
            </div>
            <div class="row">
                <t t-if="o.partner_shipping_id != o.partner_id">
                    <div class="col-xs-6">
                        <strong>Shipping address:</strong>
                        <div t-field="o.partner_shipping_id"
                            t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True, "min_name": True}'/>
                    </div>
                    <div class="col-xs-6">
                         <strong>Billing address:</strong>
                        <div t-field="o.partner_id"
                                t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "min_name": True}' />
                    </div>
                </t>
                <t t-if="o.partner_shipping_id == o.partner_id">
                    <div class="col-xs-6 col-xs-offset-6">
                         <strong>Shipping and Billing address:</strong>
                        <div t-field="o.partner_id"
                                t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "min_name": True}' />
                    </div>
                </t>
            </div>
            <div class="row" style="margin-top: 15px;">
                <div class="col-xs-12">
                    <table class="custom_table">
                        <thead>
                            <tr>
                                <th>Customer Nª</th>
                                <th>CIF/NIF</th>
                                <th>Page nº</th>
                                <th>Date</th>
                                <th>Order Nº</th>
                                <th>Agent</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><span t-field="o.partner_id.ref"/></td>
                                <td><span t-field="o.partner_id.vat"/></td>
                                <td>
                                    Page: <span class="page"/> of <span class="topage"/>
                                </td>
                                <td><span t-field="o.date_order"/></td>
                                <td><span t-field="o.name"/></td>
                                <td><span t-field="o.user_id.name"/> </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </template>


    <!-- cabecera para albarán, mira si está marcado o campo neutro -->
    <template id="custom_layout_header_picking">
        <div class="header">
            <div class="row">
                <div class="col-xs-6 sombreado" style="margin-bottom: 15px;" t-if=" not o.neutral_document">
                    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>

                    <span t-field="company.partner_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
                    <p><strong>CIF/NIF:</strong> <span t-field="company.vat"/></p>
                    <p><strong>Telf.:</strong> <span t-field="company.phone"/> <strong>FAX:</strong> <span t-field="company.fax"/></p>
                </div>
                <div class="col-xs-6" t-if="o.neutral_document">

                    <span t-field="o.sale_id.partner_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
                </div>
                <div class="col-xs-5 col-xs-offset-1">
                    <h1>PICKING</h1>
                </div>
            </div>
            <!--dirección e envío-->
            <div class="row">
                <t>
                    <div class="col-xs-6 col-xs-offset-6">
                         <strong>Shipping address:</strong>
                        <t t-if="o.location_id.usage == 'supplier'">
                            <div t-field="o.sale_id.partner_shipping_id"
                                    t-field-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": true, "phone_icons": True, "min_name": True}' />
                        </t>
                        <t t-if="o.location_id.usage != 'supplier'">
                            <div t-field="o.partner_id"
                                    t-field-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": true, "phone_icons": True, "min_name": True}' />
                        </t>

                    </div>
                </t>

            </div>

            <div class="row" style="margin-top: 15px;">
                <div class="col-xs-12">
                    <table class="custom_table">
                        <thead>
                            <tr>
                                <th>Customer Nº</th>
                                <th>CIF/NIF</th>
                                <th>Page nº</th>
                                <th>Date</th>
                                <th>Order Nº</th>
                                <th>Agent</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><span t-field="o.partner_id.ref"/></td>
                                <td><span t-field="o.partner_id.vat"/></td>
                                <td>
                                    Page: <span class="page"/> of <span class="topage"/>
                                </td>
                                <td><span t-field="o.min_date"/></td>
                                <td><span t-field="o.sale_id.name"/></td>
                                <td><span/> </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </template>

<commit_msg>[FIX]custom_documents: En albaranes se muestra el nº de cliente del pedido.<commit_after><?xml version="1.0" encoding="utf-8"?>
<!-- © 2017 Comunitea
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>
    <template id="assets_common" name="custom css assets" inherit_id="report.assets_common">
        <xpath expr="." position="inside">
            <link rel="stylesheet" href="/custom_documents/static/src/css/custom.css"/>
        </xpath>
    </template>

    <template id="custom_layout">
        <!-- Multicompany -->
        <t t-if="not o and doc">
            <t t-set="o" t-value="doc"/>
        </t>
        <t t-if="o and 'company_id' in o">
            <t t-set="company" t-value="o.company_id"></t>
        </t>
        <t t-if="not o or not 'company_id' in o">
            <t t-set="company" t-value="res_company"></t>
        </t>


        <t t-if="o._name == 'sale.order'" t-call="custom_documents.custom_layout_header_sale" />
        <t t-if="o._name == 'stock.picking'" t-call="custom_documents.custom_layout_header_picking" />
        <t t-if="o._name == 'account.invoice'" t-call="custom_documents.custom_layout_header_invoce" />
        <t t-if="o._name == 'purchase.order'" t-call="custom_documents.custom_layout_header_purchase" />
        <t t-raw="0" />
        <t t-call="custom_documents.custom_layout_footer" />
    </template>

    <!-- cabecera para pedidos y proforma que se tratan como un pedidos, mira si esta marcado el campo neutro y logo se imprime proforma o pedido -->
    <template id="custom_layout_header_sale">
        <div class="header">
            <div class="row">
                <div class="col-xs-6 sombreado" style="margin-bottom: 15px;" t-if=" not o.neutral_document">
                    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>

                    <span t-field="company.partner_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
                    <p><strong>CIF/NIF:</strong> <span t-field="company.vat"/></p>
                    <p><strong>Telf.:</strong> <span t-field="company.phone"/> <strong>FAX:</strong> <span t-field="company.fax"/></p>
                </div>
                <div class="col-xs-5 col-xs-offset-1">

                     <t t-if="not noproforma">
                        <h1 t-if="o.state in ('draft', 'sent')">QUOTATION</h1>
                        <h1 t-if="o.state not in ('proforma', 'draft', 'sent')">ORDER</h1>
                        <h1 t-if="o.state == 'proforma'">PROFORMA</h1>
                    </t>
                     <t t-if="noproforma">
                        <h1 t-if="o.state in ('draft', 'sent')">QUOTATION</h1>
                        <h1 t-if="o.state not in ('draft', 'sent')">ORDER</h1>
                    </t>


                </div>
            </div>
            <div class="row">
                <t t-if="o.partner_shipping_id != o.partner_id">
                    <div class="col-xs-6">
                        <strong>Shipping address:</strong>
                        <div t-field="o.partner_shipping_id"
                            t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True, "min_name": True}'/>
                    </div>
                    <div class="col-xs-6">
                         <strong>Billing address:</strong>
                        <div t-field="o.partner_id"
                                t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "min_name": True}' />
                    </div>
                </t>
                <t t-if="o.partner_shipping_id == o.partner_id">
                    <div class="col-xs-6 col-xs-offset-6">
                         <strong>Shipping and Billing address:</strong>
                        <div t-field="o.partner_id"
                                t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "min_name": True}' />
                    </div>
                </t>
            </div>
            <div class="row" style="margin-top: 15px;">
                <div class="col-xs-12">
                    <table class="custom_table">
                        <thead>
                            <tr>
                                <th>Customer Nª</th>
                                <th>CIF/NIF</th>
                                <th>Page nº</th>
                                <th>Date</th>
                                <th>Order Nº</th>
                                <th>Agent</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><span t-field="o.partner_id.ref"/></td>
                                <td><span t-field="o.partner_id.vat"/></td>
                                <td>
                                    Page: <span class="page"/> of <span class="topage"/>
                                </td>
                                <td><span t-field="o.date_order"/></td>
                                <td><span t-field="o.name"/></td>
                                <td><span t-field="o.user_id.name"/> </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </template>


    <!-- cabecera para albarán, mira si está marcado o campo neutro -->
    <template id="custom_layout_header_picking">
        <div class="header">
            <div class="row">
                <div class="col-xs-6 sombreado" style="margin-bottom: 15px;" t-if=" not o.neutral_document">
                    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>

                    <span t-field="company.partner_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
                    <p><strong>CIF/NIF:</strong> <span t-field="company.vat"/></p>
                    <p><strong>Telf.:</strong> <span t-field="company.phone"/> <strong>FAX:</strong> <span t-field="company.fax"/></p>
                </div>
                <div class="col-xs-6" t-if="o.neutral_document">

                    <span t-field="o.sale_id.partner_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
                </div>
                <div class="col-xs-5 col-xs-offset-1">
                    <h1>PICKING</h1>
                </div>
            </div>
            <!--dirección e envío-->
            <div class="row">
                <t>
                    <div class="col-xs-6 col-xs-offset-6">
                        <strong>Shipping address:</strong>
                        <t t-if="o.location_id.usage == 'supplier'">
                            <div t-field="o.sale_id.partner_shipping_id"
                                    t-field-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": true, "phone_icons": True, "min_name": True}' />
                        </t>
                        <t t-if="o.location_id.usage != 'supplier'">
                            <div t-field="o.partner_id"
                                    t-field-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": true, "phone_icons": True, "min_name": True}' />
                        </t>

                    </div>
                </t>

            </div>

            <div class="row" style="margin-top: 15px;">
                <div class="col-xs-12">
                    <table class="custom_table">
                        <thead>
                            <tr>
                                <th>Customer Nº</th>
                                <th>CIF/NIF</th>
                                <th>Page nº</th>
                                <th>Date</th>
                                <th>Order Nº</th>
                                <th>Agent</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><span t-field="o.sale_id.partner_id.ref"/></td>
                                <td><span t-field="o.sale_id.partner_id.vat"/></td>
                                <td>
                                    Page: <span class="page"/> of <span class="topage"/>
                                </td>
                                <td><span t-field="o.min_date"/></td>
                                <td><span t-field="o.sale_id.name"/></td>
                                <td><span/> </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </template>


{'fraction_non_alphanumeric': 0.160188457008245, 'fraction_numerical': 0.005633225789931889, 'mean_word_length': 1.0583956993780963, 'pattern_counts': {'":': 64, '<': 517, '<?xml version=': 2, '>': 517, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '813722', 'n_tokens_mistral': 5772, 'n_tokens_neox': 5385, 'n_words': 978}