[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
This commit is contained in:
Nicolas Martinelli
2018-05-02 12:39:16 +02:00
committed by Nicolas Martinelli
parent 8ee2a0d191
commit 5ac9d8e57f
+2 -2
View File
@@ -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')