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

Hello,

I'm working on Odoo10 and I need to inherit javascript code so that when clicking on project kanban I can show form view instead of project tasks view 

This is my JS code on the new module:

odoo.define('new_module_project.update_kanban', function (require) {
'use strict';

var KanbanRecord = require('web_kanban.Record');
var QWeb = core.qweb;
var _t = core._t;


KanbanRecord.include({
    on_card_clicked: function() {
        if (this.view.dataset.model === 'project.project') {
            this.$('.o_kanban_card_manage_section a').first().click();
        } else {
            this._super.apply(this, arguments);
        }
    },

});
});

I called the js file on assets_backend .

but this is not working..


thanks,



Avatar
Discard
Best Answer
odoo.define('your_module.project_kanban', function (require) {
'use strict';

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

KanbanRecord.include({

/**
* @override
* @private
*/
_openRecord: function () {
if (this.$el.hasClass('o_currently_dragged')) {
// this record is currently being dragged and dropped, so we do not
// want to open it.
return;
}
var editMode = this.$el.hasClass('oe_kanban_global_click_edit');
this.trigger_up('open_record', {
id: this.db_id,
mode: editMode ? 'edit' : 'readonly',
});
},
});});
Avatar
Discard
Related Posts Replies Views Activity
2
Jul 24
1918
3
May 24
2541
0
May 24
1453
0
Nov 18
10168
0
Mar 25
307