I am trying to apply a group by on customers in the opportunities section of the CRM module.
I want to group the customers/opportunities on industry
.
I have used similar code in res.partner
and I cannot work this one out!.
models.py
x_industry_id = fields.Many2one(string="Industry", comodel_name="res.partner")
views.xml
<record id="view_crm_case_opportunities_filter_inherit" model="ir.ui.view">
<field name="name">crm.lead.search.opportunity</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
<field name="arch" type="xml">
<xpath expr="//search" position="inside">
<filter name="x_industry_id" string="Industry" context="{'group_by':'x_industry_id'}" domain="[('industry_id','!=', False)]"/>
</xpath>
</field>
</record>
I am also having the same issue with filters and other groups using the same method.
They just do not appear like normal!
How can I apply Groups and Filters to different models