[FIX] stock: delivery address for entire packages
The delivery slip of a picking with an operation type where 'Move Entire Packages' is enabled doesn't print the delivery address Steps to reproduce: 1. Go to Settings > Inventory > Operations and enable 'Packages' 2. Go to Inventory > Configuration > Warehouse Management > Operations Type 3. Open operation type 'Delivery Orders' and enable 'Move Entire Packages' 4. Create a new transfer with operation type 'Delivery Orders', add a delivery address and a move and save 5. Mark as todo, put in pack and validate Solution: Always use the partner of the `move_lines` in the delivery address Apply the same logic to the address used in the picking operations report Problem: The delivery slip always uses the partner of `move_ids_without_package` but there might not be any if the picking uses packages opw-3091139 closes odoo/odoo#108465 X-original-commit: d113e0d7a5aa1c1f6bb933771cda4a3365361ba0 Signed-off-by: Tiffany Chang <tic@odoo.com> Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
This commit is contained in:
@@ -823,7 +823,7 @@ class Picking(models.Model):
|
||||
|
||||
def should_print_delivery_address(self):
|
||||
self.ensure_one()
|
||||
return self.move_ids_without_package and self.move_ids_without_package[0].partner_id and self._is_to_external_location()
|
||||
return self.move_ids and self.move_ids[0].partner_id and self._is_to_external_location()
|
||||
|
||||
def _is_to_external_location(self):
|
||||
self.ensure_one()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div name="outgoing_delivery_address"
|
||||
t-if="o.should_print_delivery_address()">
|
||||
<span><strong>Delivery Address:</strong></span>
|
||||
<div t-field="o.move_ids_without_package[0].partner_id"
|
||||
<div t-field="o.move_ids[0].partner_id"
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
|
||||
</div>
|
||||
<div name="outgoing_warehouse_address"
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6" name="div_outgoing_address">
|
||||
<div t-if="o.move_ids_without_package and o.move_ids_without_package[0].partner_id and o.move_ids_without_package[0].partner_id.id != o.partner_id.id">
|
||||
<div t-if="o.should_print_delivery_address()">
|
||||
<span><strong>Delivery Address:</strong></span>
|
||||
<div t-field="o.move_ids_without_package[0].partner_id"
|
||||
<div t-field="o.move_ids[0].partner_id"
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
|
||||
</div>
|
||||
<div t-if="o.picking_type_id.code != 'internal' and (not o.move_ids_without_package or not o.move_ids_without_package[0].partner_id) and o.picking_type_id.warehouse_id.partner_id">
|
||||
<div t-elif="o.picking_type_id.code != 'internal' and o.picking_type_id.warehouse_id.partner_id">
|
||||
<span><strong>Warehouse Address:</strong></span>
|
||||
<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}'/>
|
||||
|
||||
Reference in New Issue
Block a user