2016-11-22 37 views

回答

2

在odoo 10 group_by_defaultgroup_expand取代,它会列出所有阶段的列表。 例如您的列是stage,并且您想显示所有空白阶段。

@api.model 
def _read_group_stage_ids(self,stages,domain,order): 
    stage_ids = self.env['stage.stage'].search([]) 
    return stage_ids 

stage = fields.Many2one('stage.stage', group_expand='_read_group_stage_ids') 
+0

如果我的舞台是选择字段,该怎么办?或者我应该总是在舞台上使用Many2one关系? –

+0

由于ATM似乎没有关于group_expand的文档,请查看odoo/models.py并搜索_read_group_fill_results。这是group_expand被解释的地方。 – Jerther

1

_read_group_stage_ids”方法返回阶段的列表,以便在你的情况下,尝试通过所有选择字段以列表的形式反对group_expand方法。