From 5ac9d8e57f13b90fb7e5df7d493e5cb8c017041e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 27 Apr 2018 15:21:39 +0200 Subject: [PATCH] [FIX] product: variant in partner_ref - Create a product with 2 variants (e.g. black and white) - Create an invoice with one of the variant The description doesn't contain the attribute name, as it would be in a SO. This is because the invoice uses `partner_ref`, which doesn't include the attribute name. opw-1839598 --- addons/product/models/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/models/product.py b/addons/product/models/product.py index 2dce8e9fa36..77b17e5d17c 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -230,9 +230,9 @@ class ProductProduct(models.Model): 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 + self.partner_ref = '%s%s' % (self.code and '[%s] ' % self.code or '', product_name) else: - product_name = self.name - self.partner_ref = '%s%s' % (self.code and '[%s] ' % self.code or '', product_name) + self.partner_ref = self.name_get()[0][1] @api.one @api.depends('image_variant', 'product_tmpl_id.image')