1
votes

Is it possible to make draggable event False with condition in kanban view crm module?

I want to drag leads from any stage except stage won (probability=100)

I tried this but in vain:

<kanban position="attributes">
<attribute name="attrs">{'edit': [('probability', '&lt;', 100)]}</attribute>
</kanban>
<field name="stage_id" position="attributes">
<attribute name="attrs">{'readonly': [('probability', '&lt;', 100)]}</attribute>
</field>

I tried also to modify kanban_column.js and kanban_record.js (in web_kanban/static/js) but in vain.

1

1 Answers

1
votes

I find it... You must edit the init function in: /opt/odoo/odoo/addons/web_kanban/static/src/kanban_column.js and add something like this:

var bool = group_data.title != 'Won';
this.draggable = record_options.draggable && bool;

Thanks