diff --git a/delivery_multi_destination/__manifest__.py b/delivery_multi_destination/__manifest__.py index 811e5042a5..8df9e28203 100644 --- a/delivery_multi_destination/__manifest__.py +++ b/delivery_multi_destination/__manifest__.py @@ -13,5 +13,5 @@ "installable": True, "depends": ["delivery"], "demo": ["demo/delivery_carrier_demo.xml"], - "data": ["views/delivery_carrier_view.xml"], + "data": ["data/product_product.xml", "views/delivery_carrier_view.xml"], } diff --git a/delivery_multi_destination/data/product_product.xml b/delivery_multi_destination/data/product_product.xml new file mode 100644 index 0000000000..9f54579f05 --- /dev/null +++ b/delivery_multi_destination/data/product_product.xml @@ -0,0 +1,14 @@ + + + + + DUMMY Shipping Product + service + + + + 0.0 + order + + + diff --git a/delivery_multi_destination/models/delivery_carrier.py b/delivery_multi_destination/models/delivery_carrier.py index b6d424cdee..b34dd65746 100644 --- a/delivery_multi_destination/models/delivery_carrier.py +++ b/delivery_multi_destination/models/delivery_carrier.py @@ -30,7 +30,9 @@ class DeliveryCarrier(models.Model): def _onchange_destination_type(self): """Define the corresponding value to avoid creation error with UX.""" if self.destination_type == "multi" and self.child_ids and not self.product_id: - self.product_id = fields.first(self.child_ids.product_id) + self.product_id = fields.first(self.child_ids.product_id) or self.env.ref( + "delivery_multi_destination.dummy_shipping_product" + ) def search(self, args, offset=0, limit=None, order=None, count=False): """Don't show by default children carriers."""