| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <odoo> |
| 3 | <template id="report_ddt_view"> |
| 4 | <t t-call="web.external_layout"> |
| 5 | <t t-set="o" t-value="o.with_context(lang=lang)"/> |
| 6 | <t t-if="o.move_ids and o.move_ids[0].partner_id and o.location_dest_id.usage == 'customer' and o.location_id.usage == 'supplier'"> |
| 7 | <t t-set="delivery_from" t-value="o.partner_id"/> |
| 8 | <t t-set="delivery_to" t-value="o.move_ids[0].partner_id"/> |
| 9 | </t> |
| 10 | <t t-elif="o.picking_type_id.warehouse_id.partner_id"> |
| 11 | <t t-set="delivery_from" t-value="o.picking_type_id.warehouse_id.partner_id"/> |
| 12 | <t t-set="delivery_to" t-value="o.partner_id"/> |
| 13 | </t> |
| 14 | <t t-else=""> |
| 15 | <t t-set="delivery_from" t-value="o.company_id.partner_id"/> |
| 16 | <t t-set="delivery_to" t-value="o.partner_id"/> |
| 17 | </t> |
| 18 | <div class="page"> |
| 19 | <div class="row"> |
| 20 | <div class="col-6"> |
| 21 | <strong>Warehouse Address</strong> |
| 22 | <div t-esc="delivery_from" |
| 23 | t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
| 24 | <p t-if="delivery_from.vat">VAT: <span t-field="delivery_from.vat"/></p> |
| 25 | </div> |
| 26 | <div class="col-5 offset-1"> |
| 27 | <div> |
| 28 | <strong>Customer Address</strong> |
| 29 | <div t-esc="delivery_to" |
| 30 | t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
| 31 | </div> |
| 32 | </div> |
| 33 | </div> |
| 34 | <div class="mt16"/> |
| 35 | <div class="mt64"/> |
| 36 | <div> |
| 37 | <h1>Documento di Trasporto <span t-esc="o.l10n_it_ddt_number"/></h1> |
| 38 | </div> |
| 39 | <div class="clearfix"/> |
| 40 | <div class="mb32"/> |
| 41 | <div class="row"> |
| 42 | <div class="col-6"> |
| 43 | <table class="table table-borderless"> |
| 44 | <tbody> |
| 45 | <tr> |
| 46 | <td>Transportation Reason</td> |
| 47 | <td><span t-field="o.l10n_it_transport_reason"/></td> |
| 48 | </tr> |
| 49 | <tr> |
| 50 | <td>Transportation Method</td> |
| 51 | <td><span t-field="o.l10n_it_transport_method"/></td> |
| 52 | </tr> |
| 53 | <tr> |
| 54 | <td>Carrier Condition</td> |
| 55 | <td><span t-field="o.sale_id.incoterm.name"/></td> |
| 56 | </tr> |
| 57 | <tr> |
| 58 | <td>Carrier</td> |
| 59 | <td><span t-field="o.carrier_id"/></td> |
| 60 | </tr> |
| 61 | </tbody> |
| 62 | </table> |
| 63 | <div t-if="o.l10n_it_transport_method_details"> |
| 64 | <b>Transportation Method Details: </b> |
| 65 | <span t-field="o.l10n_it_transport_method_details"/> |
| 66 | </div> |
| 67 | </div> |
| 68 | <div class="col-5 offset-1"> |
| 69 | <table class="table table-borderless"> |
| 70 | <tbody> |
| 71 | <tr> |
| 72 | <td>Order</td> |
| 73 | <td><span t-field="o.origin"/></td> |
| 74 | </tr> |
| 75 | <tr> |
| 76 | <td>Picking Number</td> |
| 77 | <td><span t-field="o.name"/></td> |
| 78 | </tr> |
| 79 | <tr> |
| 80 | <td>Shipping Date</td> |
| 81 | <td><span t-field="o.date_done"/></td> |
| 82 | </tr> |
| 83 | <tr> |
| 84 | <td>Gross Weight (kg)</td> |
| 85 | <td><span t-field="o.shipping_weight"/></td> |
| 86 | </tr> |
| 87 | <tr> |
| 88 | <td>Parcels</td> |
| 89 | <td><span t-field="o.l10n_it_parcels"/></td> |
| 90 | </tr> |
| 91 | </tbody> |
| 92 | </table> |
| 93 | </div> |
| 94 | </div> |
| 95 | |
| 96 | <div class="mt64"/> |
| 97 | <div t-if="o.note"><b>Note:</b> <span t-field="o.note"/></div> |
| 98 | |
| 99 | <div class="mt64"/> |
| 100 | <div class="mt64"/> |
| 101 | |
| 102 | <table class="table table-borderless" name="document_details"> |
| 103 | <t t-set="display_discount" t-value="any(m.sale_line_id.discount for m in o.move_ids)"/> |
| 104 | <thead> |
| 105 | <tr> |
| 106 | <th><strong>Product</strong></th> |
| 107 | <th><strong>Quantity</strong></th> |
| 108 | <t t-if="display_discount"> |
| 109 | <th><strong>Disc.%</strong></th> |
| 110 | </t> |
| 111 | <th><strong>Total Value</strong></th> |
| 112 | </tr> |
| 113 | </thead> |
| 114 | <tbody> |
| 115 | <t t-set="total_value" t-value="0"/> |
| 116 | <t t-foreach="o.move_ids" t-as="move"> |
| 117 | <t t-if="move.quantity"> |
| 118 | <tr> |
| 119 | <td> |
| 120 | <span t-field="move.product_id"/> |
| 121 | </td> |
| 122 | <td class="o_td_quantity"> |
| 123 | <span t-field="move.quantity" class="text-nowrap"/> |
| 124 | <span t-field="move.product_uom" groups="uom.group_uom"/> |
| 125 | </td> |
| 126 | <td t-if="display_discount"> |
| 127 | <span t-field="move.sale_line_id.discount"/> |
| 128 | </td> |
| 129 | <td> |
| 130 | <t t-if="move.sale_line_id"> |
| 131 | <t t-set="lst_price" t-value="move.sale_line_id.price_reduce_taxinc * move.product_id.uom_id._compute_quantity(move.quantity, move.sale_line_id.product_uom_id)"/> |
| 132 | </t> |
| 133 | <t t-else=""> |
| 134 | <t t-set="lst_price" t-value="move.product_id.lst_price * move.product_uom._compute_quantity(move.quantity, move.product_id.uom_id)"/> |
| 135 | </t> |
| 136 | <span t-esc="lst_price" t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> |
| 137 | <t t-set="total_value" t-value="total_value + lst_price"/> |
| 138 | </td> |
| 139 | </tr> |
| 140 | </t> |
| 141 | </t> |
| 142 | <tr> |
| 143 | <td t-if="display_discount"> |
| 144 | </td> |
| 145 | <td> |
| 146 | </td> |
| 147 | <td style="text-align:right"> |
| 148 | <b>Total:</b> |
| 149 | </td> |
| 150 | <td> |
| 151 | <span t-esc="total_value" t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> |
| 152 | </td> |
| 153 | </tr> |
| 154 | </tbody> |
| 155 | </table> |
| 156 | <div class="mt64"/> |
| 157 | <div class="mt64"/> |
| 158 | <table class="table table-borderless"> |
| 159 | <thead> |
| 160 | <tr> |
| 161 | <th><span class="fa fa-pencil mt4"/><div class="ml4 d-inline-block"/><strong>Company Signature</strong></th> |
| 162 | <th><span class="fa fa-pencil mt4"/><div class="ml4 d-inline-block"/><strong>Carrier Signature</strong></th> |
| 163 | <th><span class="fa fa-pencil mt4"/><div class="ml4 d-inline-block"/><strong>Customer Signature</strong></th> |
| 164 | </tr> |
| 165 | </thead> |
| 166 | <tbody> |
| 167 | <tr> |
| 168 | <td> |
| 169 | <div class="col"> |
| 170 | </div> |
| 171 | </td> |
| 172 | <td> |
| 173 | <div class="col"> |
| 174 | </div> |
| 175 | </td> |
| 176 | <td> |
| 177 | <div class="col"> |
| 178 | </div> |
| 179 | </td> |
| 180 | </tr> |
| 181 | </tbody> |
| 182 | </table> |
| 183 | </div> |
| 184 | </t> |
| 185 | </template> |
| 186 | |
| 187 | <template id="report_ddt"> |
| 188 | <t t-call="web.html_container"> |
| 189 | <t t-foreach="docs" t-as="o"> |
| 190 | <t t-set="lang" t-value="o._get_report_lang()"/> |
| 191 | <t t-call="l10n_it_stock_ddt.report_ddt_view" t-lang="lang"/> |
| 192 | </t> |
| 193 | </t> |
| 194 | </template> |
| 195 | |
| 196 | <record id="action_report_ddt" model="ir.actions.report"> |
| 197 | <field name="name">DDT report</field> |
| 198 | <field name="model">stock.picking</field> |
| 199 | <field name="report_type">qweb-pdf</field> |
| 200 | <field name="report_name">l10n_it_stock_ddt.report_ddt</field> |
| 201 | <field name="report_file">report_ddt</field> |
| 202 | <field name="print_report_name">'DDT - %s - %s' % (object.partner_id.name or '', object.l10n_it_ddt_number)</field> |
| 203 | </record> |
| 204 | </odoo> |