OCA/l10n-italy

View on GitHub
l10n_it_ddt/views/report_ddt.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <template id="delivery_data">

            <style type="text/css">
                table.delivery_data td h6 { margin: 0; }
                .signature { min-height: 2em; }
            </style>

            <table class="table table-condensed table-bordered delivery_data">
                <tr>
                    <td>
                        <h6>Transportation Reason</h6>
                        <div class="signature" t-field="ddt.transportation_reason_id"></div>
                    </td>
                    <td>
                        <h6>Carriage Condition</h6>
                        <div class="signature" t-field="ddt.carriage_condition_id"></div>
                    </td>
                    <td>
                        <h6>Goods Description</h6>
                        <div class="signature" t-field="ddt.goods_description_id"></div>
                    </td>
                    <td>
                        <h6>Gross Weight</h6>
                        <div class="signature" t-field="ddt.weight"></div>
                    </td>
                    <td>
                        <h6>Net Weight</h6>
                        <div class="signature" t-field="ddt.net_weight"></div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <h6>Method of Transportation / Carrier</h6>
                        <div class="signature">
                            <span t-field="ddt.transportation_method_id" />
                            <span t-field="ddt.carrier_id.name"/>
                      </div>
                    </td>
                    <td >
                        <h6>Withdrawal Date and time</h6>
                        <div class="signature"> <span t-field="ddt.date_done" /></div>
                    </td>
                    <td>
                        <h6>Parcels</h6>
                        <div class="signature" t-field="ddt.parcels"></div>
                    </td>
                    <td>
                        <h6>Size</h6>
                        <div class="signature" t-field="ddt.volume"></div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <h6>Carrier's Signature</h6>
                        <div class="signature"/>
                    </td>
                    <td colspan="3" rowspan="3"><h6>Notes</h6>
                        <div class="signature" t-field="ddt.note"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <h6>Driver's Signature</h6>
                        <div class="signature"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <h6>Recipient's Signature</h6>
                        <div class="signature"/>
                    </td>
                </tr>
            </table>
        </template>

        <template id="report_ddt">
            <t t-call="report.html_container">
                <t t-foreach="docs" t-as="o">
                    <t t-call="report.external_layout">
                        <div class="page">
                            <div class="row">
                                <div class="col-xs-6">
                                    <h2>Recipient</h2>
                                    <div t-field="o.partner_shipping_id"
                                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />
                                    <div t-if="o.partner_shipping_id">VAT number: <span t-field="o.partner_shipping_id.vat"/></div>
                                </div>
                                <div class="col-xs-6">
                                    <h2>Transferee</h2>
                                    <div t-field="o.partner_invoice_id"
                                        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />
                                    <div t-if="o.partner_invoice_id">VAT number: <span t-field="o.partner_invoice_id.vat"/></div>
                                </div>
                            </div>
                            <h1>DDT number: <span t-field="o.ddt_number"></span></h1>
                            <table class="table table-condensed">
                                <thead>
                                    <tr>
                                        <th><strong>Description</strong></th>
                                        <th class="text-right"><strong>Quantity</strong></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr t-foreach="o.line_ids" t-as="line">
                                        <td><span t-field="line.name"></span></td>
                                        <td class="text-right"><span t-field="line.product_uom_qty"></span></td>
                                    </tr>
                                </tbody>
                            </table>
                            <t t-call="l10n_it_ddt.delivery_data">
                                <t t-set="ddt" t-value="o"/>
                            </t>
                        </div>
                    </t>
                </t>
            </t>
        </template>

        <template id="report_ddt_main">
            <t t-call="report.html_container">
                <t t-foreach="doc_ids" t-as="doc_id">
                    <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'l10n_it_ddt.report_ddt')"/>
                </t>
            </t>
        </template>

        <report
            string="DDT"
            id="action_report_ddt"
            model="stock.picking.package.preparation"
            report_type="qweb-pdf"
            name="l10n_it_ddt.report_ddt_main"
            file="l10n_it_ddt.report_ddt_main"/>

    </data>
</openerp>