Skip to content
Snippets Groups Projects
Commit b0057ea7 authored by Andrea Grazioso (agr-odoo)'s avatar Andrea Grazioso (agr-odoo)
Browse files

[FIX] l10n_it_stock_ddt: support dropshipping in ddt

Have an IT company configured
Activate Dropship
Create a Product P with dropship enabled and vendor configured
Create a quotation to an IT customer, add P to a line, confirm.
Purchase will be created automatically, confirm it.
Go to dropship picking, confirm, print

The DDT report does not show up correctly:
- Warehouse address is the company address
- Customer address is the vendor address

opw-3128812

Part-of: odoo/odoo#110398
parent 9e48950e
No related branches found
No related tags found
No related merge requests found
......@@ -3,29 +3,34 @@
<template id="report_ddt_view">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=lang)"/>
<t t-if="o.move_ids_without_package and o.move_ids_without_package[0].partner_id and o.location_dest_id.usage == 'customer' and o.location_id.usage == 'supplier'">
<t t-set="delivery_from" t-value="o.partner_id"/>
<t t-set="delivery_to" t-value="o.move_ids_without_package[0].partner_id"/>
</t>
<t t-elif="o.picking_type_id.warehouse_id.partner_id">
<t t-set="delivery_from" t-value="o.picking_type_id.warehouse_id.partner_id"/>
<t t-set="delivery_to" t-value="o.partner_id"/>
</t>
<t t-else="">
<t t-set="delivery_from" t-value="o.company_id.partner_id"/>
<t t-set="delivery_to" t-value="o.partner_id"/>
</t>
<div class="page">
<div class="row">
<div class="col-6">
<span><strong>Warehouse Address:</strong></span>
<t t-set="delivery_from" t-value="o.picking_type_id.warehouse_id.partner_id or o.company_id.partner_id"/>
<t t-if="o.picking_type_id.warehouse_id.partner_id">
<div t-field="o.picking_type_id.warehouse_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
</t>
<t t-else="">
<div t-field="o.company_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
</t>
<div t-esc="delivery_from"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
<p t-if="delivery_from.vat">VAT: <span t-field="delivery_from.vat"/></p>
</div>
<div class="col-5 offset-1">
<div>
<span><strong>Customer Address:</strong></span>
<div t-field="o.partner_id"
<div t-esc="delivery_to"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
<p t-if="o.partner_id.vat">
<p t-if="delivery_to.vat">
<t t-set="default_vat_label">VAT</t>
<t t-esc="o.company_id.country_id.vat_label or default_vat_label"/>: <span t-field="o.partner_id.vat"/>
<t t-esc="delivery_to.country_id.vat_label or default_vat_label"/>: <span t-esc="delivery_to.vat"/>
</p>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment