From ee746b52cd3f05b74b908eda77b5f7356b2ec3e9 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 18 Jul 2018 17:10:19 +0200 Subject: [PATCH] [FIX] product: fallback onto name for product.partner_ref Have a product with a partner A as a seller, without any description whatsoever Do a vendor bill with partner A as the partner. Add the product onto the lines Before this commit, the description on the line was "False" After this commit, we fallback onto the product name if no other reference is set OPW 1865969 closes #25857 --- addons/product/models/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/product.py b/addons/product/models/product.py index 02afaf34810..419bc705c24 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -249,7 +249,7 @@ class ProductProduct(models.Model): def _compute_partner_ref(self): for supplier_info in self.seller_ids: if supplier_info.name.id == self._context.get('partner_id'): - product_name = supplier_info.product_name or self.default_code + product_name = supplier_info.product_name or self.default_code or self.name break else: product_name = self.name