You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
485 B

import json
from odoo import models, fields, api
class Product(models.Model):
_inherit = 'product.product'
# technical field used in POS frontend
multi_ean_json = fields.Char(
"Multi EAN list", readonly=True,
compute="_compute_multi_ean_json")
@api.multi
def _compute_multi_ean_json(self):
for p in self:
multi_ean_json = [x for x in p.mapped('ean13_ids.name') if x]
p.multi_ean_json = json.dumps(multi_ean_json)