Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
624 Vistas

In CRM Kanban View, I am wanting the order of my cards to be specific to my needs or at least in a logical way (such as alphabetical or date order). Is there a way to change it at all? I can't figure out how it sorts it - seems to be random!

Avatar
Descartar
Mejor respuesta

Hi Emma:

The records in views are not aligned randomly,  it depends on how you set its order, otherwise they aligned as per ids in the database. 

Solutions below for your reference:

1、set attribute ‘default_order’ in root node(i.e.<Kanban ...>)


<record id="crm_lead_partner_kanban_view_inherit" model="ir.ui.view">
    <field name="name">crm.res.partner.kanban.inherit</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.res_partner_kanban_view"/>
    <field name="arch" type="xml">
​<xpath expr="//Kanban" position="attributes">
​​<attribute name="default_order">display_name desc, country_id desc</attribute>
​ </xpath>
​ </field>
</record>​

2、define " _order='display_name desc, country_id desc' " in model (this setting will affect not only the Kanban view but all views):

class ResPartner(models.Model):
_inherit = 'res.partner'
​ _order = 'display_name desc, country_id desc'

You can customize the alignment fields,  seperate multiple with ‘ , ’ , and ‘desc ’ means ordering sequence descending.


Avatar
Descartar
Mejor respuesta

Cards in the CRM Pipeline Kanban are sorted within columns by:

a) Priority - Highest priority at the top

b) Creation Date - Most recently created at the top (after taking into account Priority)


Avatar
Descartar
Mejor respuesta

You can add a 'default_order' attribute in the Kanban view definition to set the default sorting order. For example: default_order="date"


Avatar
Descartar