[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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user