origin = fields.Html(string='来源', compute='compute_origin')
@api.multi
def compute_origin(self):
for order in self:
html_str = "<table class='wight=100%'>"
index = 0
for line in order.order_lineref:
if index > 2:
html_str += '<td>%s</td><td></td></tr>' % ('..........')
break
if order.picking_type_id.typebh == 3:
html_str += '<tr><td>%s</td>' % (line.origin)
else:
html_str += '<tr><td>%s</td>' % (line.origin + ';')
index += 1
html_str += '</table>'
order.origin = html_str
- 实现效果