跳至内容
菜单
此问题已终结
2 回复
5689 查看

Hi does anyone know what i have to modify to group my contacts by Tag?

I tried to edit the search view. But get an Error. The tag field is call category_id.
but when i add a line in the search view like:

<group expand="0" name="group_by" string="Group By">

                       <filter name="salesperson" string="Salesperson" domain="[]" context="{'group_by' : 'user_id'}"/>

                       <filter string="Company" context="{'group_by': 'parent_id'}"/>

                       <filter string="Country" context="{'group_by': 'country_id'}"/>

  <filter string="Tag" context="{'group_by': 'category_id'}"/>

                   </group>


I get the error

AssertionError: Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True
形象
丢弃
最佳答案

A tag field is supposed to contain more than one value at a time. So it's impossible (and might make little sense) to group contacts by tags. Maybe you need a many2one field like the "industry" field available on res.partner (in Odoo 11)?

形象
丢弃
最佳答案

I think category_id is compute field

形象
丢弃
相关帖文 回复 查看 活动
3
2月 25
4797
1
10月 23
3787
2
12月 21
7692
1
8月 21
2812
4
12月 18
8716