当行里出现行的信息时,tree视图无法展示。
即可用下面数据格式来
line_info = fields.Html(u'行信息', compute='compute_get_line_info')
@api.multi
def compute_get_line_info(self):
for order in self:
html_str = ""
index = 0
for line in order.order_line:
if index > 2:
html_str += '%s ' % ('..........')
break
html_str += '%s %s %s ' % (line.product_id.display_name, line.product_qty)
index += 1
html_str += '
'
else:
html_str = ''
order.line_info = html_str
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
当大于2行时,其余的用…代替