Skip to content

Commit 7db2fb0

Browse files
committed
[FIX] delivery_multii_desination: set dummy product if no products from child_ids
1 parent 47800c9 commit 7db2fb0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

delivery_multi_destination/data/product_product.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<odoo>
33

44
<record model="product.product" id="dummy_shipping_product">
@@ -11,4 +11,4 @@
1111
<field name="invoice_policy">order</field>
1212
</record>
1313

14-
</odoo>
14+
</odoo>

delivery_multi_destination/models/delivery_carrier.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class DeliveryCarrier(models.Model):
3030
def _onchange_destination_type(self):
3131
"""Define the corresponding value to avoid creation error with UX."""
3232
if self.destination_type == "multi" and self.child_ids and not self.product_id:
33-
self.product_id = fields.first(self.child_ids.product_id) or self.env.ref('delivery_multi_destination.dummy_shipping_product')
33+
self.product_id = fields.first(self.child_ids.product_id) or self.env.ref(
34+
"delivery_multi_destination.dummy_shipping_product"
35+
)
3436

3537
def search(self, args, offset=0, limit=None, order=None, count=False):
3638
"""Don't show by default children carriers."""

0 commit comments

Comments
 (0)