Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
我新扩展了制造中的产品模块,在现有的treeview基础上新增了在手总价(即 在手总量*单价)可是这个新增字段不能跟其他原有字段那样可以点击自动排序了。这是怎么回事?新字段是这样定义的:total = fields.Float('在手总价',compute='get_total')更新后,点击treeview的新字段没有反应
computed fields默认不是排序的。加上store=True把该字段存储到数据库中就能排序了。官方文档如下:computed fields are not stored by default, they are computed and returned when requested. Setting store=True will store them in the database and automatically enable searching