diff --git a/purchase_packaging_default/models/purchase_order_line.py b/purchase_packaging_default/models/purchase_order_line.py index 55a1d4c3953..d1c81933a96 100644 --- a/purchase_packaging_default/models/purchase_order_line.py +++ b/purchase_packaging_default/models/purchase_order_line.py @@ -12,7 +12,10 @@ class PurchaseOrderLine(models.Model): def _get_default_packaging(self): """From product get 1st packaging found ordered by sequence""" product_template = self.product_id.product_tmpl_id - return fields.first(product_template.packaging_ids) + breakpoint() + return fields.first( + product_template.packaging_ids.filtered(lambda p: p.purchase) + ) @api.onchange("product_id") def _onchange_product_id(self):