selection 字段用function去取所要的内容

来源:互联网 发布:百战天虫知乎 编辑:程序博客网 时间:2024/06/03 19:00
def _get_select_order(self, cr, uid, ids, context=None):
        purchase_order_objs = self.pool.get('purchase.order').browse(
            cr, uid, context.get("active_ids"), context=context)
        return [(purchase_order_obj.id, purchase_order_obj.name) for purchase_order_obj in purchase_order_objs]


  'all_purchase_to_merge': fields.selection('_get_select_order', string='合并到这个询价单中', required=True),
0 0
原创粉丝点击