How to change Opportunities view sorting and add default filter?

Hi, I have a couple of questions:

  1. how do you modify the default sorting in the Opportunities grid view? e.g. how to implement descending Reference number sorting?

  2. how do you add a default filter to the Opportunities grid view, e.g. to only list opportunities that do not have sales stage = Closed Won or Closed Lost?

Hello @marty

  1. In the grid header, put -opportunitySeq in the orderBy parameter

<grid name="opportunity-grid" title="Opportunities" model="com.axelor.apps.crm.db.Opportunity" orderBy="-opportunitySeq">

  1. In the opportunity-filters view, add the following filter:

     <filter title="My team not closed">
     <domain>self.opportunityStatus not in (5,6)</domain>

Save and refresh only changed views, you can apply the filter as follows:

Warning 1 : It’s a short-term fix.
This modification will persist as long as the production application version is not modified.
In the case of a new version of the software delivered in production, the current modification will be lost.
To integrate this modification in the next release, a developer must integrate it into the relevant xml file of the application sources.

Warning 2 :

Hope this helps you.

2 « J'aime »

Thank you, this worked. How can I get the new filter applied automatically?

You can add the domain into an action-view with a new menu entry similar to crm-root-opportunity

Thank you! This worked.

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.