Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

5

Block Drag event in kanban view in openerp7

By
vivek
on 6/3/13, 9:07 AM 3,928 views

Hi ,

Is it possible to block drag event in kanban view. In opportunity i've defined stages and i want the user to only view the opportunities by its stages in kanban view and not to change the stages. i've already made the opportunity statusbar readonly. Kindly clarify me on this.

I would also like to know how to do this.

ClearCorp S.A., Carlos Vasquez
on 6/20/13, 7:46 AM
7
Florent Boucherie
On 7/26/13, 12:58 PM

"Edit KanbanView" (if the link does not appear, click on the Kanban icon)

Set <kanban edit="false" quick_create="false"

edit="false" disable drag&drop

quick_create="false" disable the + icons

Enjoy +1 Like !

Emipro Technologies Pvt. Ltd.
on 7/18/15, 6:28 AM
1
Carlos Vasquez
On 6/20/13, 5:05 PM

I managed to do this with a constraint in the code. We haven't found any other way to do this yet.

The constraint basically checks if the user is in an allowed group to do the change that the drag and drop makes to the record.

Please, can you give me an example how can I block it by constratints? For example for project.task

Juan José Scarafía
on 7/8/13, 5:17 PM

Thanks for your reply Carlos. Could you tell me how you've specified the constraint and where? Again Thanks for your time.

vivek
on 7/23/13, 6:50 AM

carlos, can you explain me how you restricted via the constraints?? i need that

Alby Antony
on 4/16/15, 11:26 PM

@Carlos: I have the same requirements. Can you please help me to achieve it.

dirtyHandsPHP
on 5/17/16, 3:16 PM
0
Raaj Mishra
On 9/8/16, 3:06 PM

To Disable Drag and Drop of Kanban View  records we need to modify at web_kanban module.

Path : web_kanban/static/src/js

File : kanban_view.js

Modification : Search for the below code

var record_options = _.extend(this.record_options, {
            draggable: draggable,

        });

Then add draggable = false above given block of code like,

draggable = false   [Note : This is the newly added line]
var record_options = _.extend(this.record_options, {
            draggable: draggable,
        });
0
Raphael
On 5/5/16, 6:45 AM

Did anyone find a solution for only allowing users in an allowed group to do the change that the drag and drop makes to the record. We would like to put restrictions on users shifting tasks into the task stage "done". Only certain users should be allowed to do that.

0
Dorin Hongu
On 9/13/15, 4:02 AM

For disable drag&drop on entire kanban use:

<kanban edit="false"  ...


For enable drag&drop on specific card use:

<t t-name="kanban-box"> 
    <t t-if="record.state.raw_value=='draft'">
        <t t-set="dragdrop" t-value="'oe_kanban_draghandle'"/>
    </t>
    <t t-if="record.state.raw_value!='draft'">
        <t t-set="dragdrop" t-value="''"/>
    </t>
    <div t-attf-class="oe_kanban_card oe_kanban_global_click #{dragdrop}">

...


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 6/3/13, 9:07 AM
Seen: 3928 times
Last updated: 9/8/16, 3:08 PM