0
在CRM模块,我想设置过滤器来GROUP_BY领域many2many,但我已经收到此错误:在树视图Odoo 8中通过many2many字段过滤组?
AssertionError: Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True
领域是“categ_ids” 此代码PY和xml:
'write_date': fields.datetime('Update Date', readonly=True),
'categ_ids': fields.many2many('crm.case.categ', 'crm_lead_category_rel', 'lead_id', 'category_id', 'Tags', \
domain="['|', ('section_id', '=', section_id), ('section_id', '=', False), ('object_id.model', '=', 'crm.lead')]", help="Classify and analyze your lead/opportunity categories like: Training, Service"),
'contact_name': fields.char('Contact Name', size=64),
FOR XML:
谢谢提前
然后无法对此字段执行group_by –
您需要group_by模型中数据库中保存的字段。您可以使用计算字段并使用store = True,但是如果您的数据在您的相关模型上发生变化,您将需要一个函数来保持计算字段的当前值。 –
你举个例子吗 –