Skip to Content
Menu
This question has been flagged
1 Reply
5827 Views

When clicking on project kanban card it opens project.task kanban view instead of opening project form view. 

What i want is when clicking the project kanban view it opens related project form view instead of tasks kanban.

I had a look to project.js file :

   

KanbanRecord.include({

    on_card_clicked: function () {

        if (this.model === 'project.project') {

            this.$('.o_project_kanban_boxes a').first().click();

        } else {

            this._super.apply(this, arguments);

        }

    },

What i need to change in this function to achieve my need ?



Avatar
Discard
Best Answer

For this, you will need to either comment this method from the project module.
If you wish to do it on a custom module, override this method in JS and then just call super method.

Ex:

on_card_clicked: function () {
if (this.model === 'project.project') {
//this.$('.o_project_kanban_boxes a').first().click();
        this._super.apply(this, arguments);
} else {
this._super.apply(this, arguments);
}
},

Avatar
Discard

Hello Sudhir sir,

Your code is working well when comment the code.

I also tried to override js but it's not working

Js code:

odoo.define('ankit_project.update_kanban', function(require) {

"use strict";

var core = require('web.core');

var data = require('web.data');

var Dialog = require('web.Dialog');

var Model = require('web.Model');

var session = require('web.session');

var KanbanView = require('web_kanban.KanbanView');

var KanbanRecord = require('web_kanban.Record');

var update_kanban = require('project.update_kanban');

var QWeb = core.qweb;

var _t = core._t;

console.log('Test-----------',arguments)

update_kanban.KanbanRecord.include({

on_card_clicked: function () {

console.log("before-----------")

this._super.apply(this, arguments);

console.log("after-----------")

},

});

});

Related Posts Replies Views Activity
0
Aug 22
893
1
Jul 22
17728
0
Apr 22
1607
3
Sep 21
1907
2
Sep 21
3204