|
@@ -0,0 +1,20 @@
|
|
|
+# -*- encoding: utf-8 -*-
|
|
|
+from openerp import models, fields, api
|
|
|
+
|
|
|
+class ProductProduct(models.Model):
|
|
|
+ _inherit = 'product.product'
|
|
|
+
|
|
|
+ @api.multi
|
|
|
+ def name_get(self):
|
|
|
+ res = super(ProductProduct, self).name_get()
|
|
|
+ res2 = []
|
|
|
+ for name_tuple in res:
|
|
|
+ product = self.browse(name_tuple[0])
|
|
|
+ if not product.ean13:
|
|
|
+ res2.append(name_tuple)
|
|
|
+ continue
|
|
|
+ res2.append((
|
|
|
+ name_tuple[0],
|
|
|
+ u'{} [{}]'.format(name_tuple[1], product.ean13)
|
|
|
+ ))
|
|
|
+ return res2
|