Fatiluna
Fatiluna

Reputation: 31

How to make draggable false with condition in case_kanban_view odoo

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.

Upvotes: 1

Views: 1174

Answers (1)

Fatiluna
Fatiluna

Reputation: 31

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

Upvotes: 1

Related Questions