Hi, in the CRM module (crm_lead) in the kanban view I want the different pipelines to be automatically ordered in each stage ('New', 'Qualified', 'Proposition', 'Won') based on the 'date_deadline' field so that those whose expected closing date is closer to the current date are at the top. Any solution that gives me the desired results works for me (odoo studio, python code in odoo.sh, etc.)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
1
Rispondi
2303
Visualizzazioni
Hi,
By default, Odoo doesn't offer the order-by feature in the Kanban view. However, the group-by feature can be used for a similar purpose. The drawback of this approach is that it hides the pipeline stages, as the pipelines are altered to reflect the group-by field name. Nevertheless, this method allows sorting records by dates close to the deadline or those that have already passed. The only downside to this option is that you need to check the stage by opening the record.(Check the screenshot attached below)
For development purposes, this code customization allows sorting records in the Kanban view based on the 'deadline' field in descending order. Please ensure that you thoroughly test these changes in a development environment before implementing them in a production system:
IN XML:
<odoo>
<data>
<record id="view_custom_kanban" model="ir.ui.view">
<field name="name">Your Model Kanban View</field>
<field name="model">your.model</field>
<field name="inherit_id" ref="your_module.your_model_kanban_view"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="default_order">deadline desc</attribute>
</xpath>
</field>
</record>
</data>
</odoo>
IN Py:
from odoo import models, fields
class YourModel(models.Model):
_name = 'your.model'
_description = 'Your Model'
name = fields.Char(string='Name', required=True)
deadline = fields.Datetime(string='Deadline')
# ... other fields ...
Hope it helps
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
2
ago 22
|
307 | ||
|
1
nov 22
|
3333 | ||
|
2
nov 22
|
3760 | ||
|
1
mag 24
|
1493 | ||
|
2
mar 24
|
8190 |