Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
6818 Vizualizări

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,



Imagine profil
Abandonează
Cel mai bun răspuns
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',
});
},
});});
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
iul. 24
2593
3
mai 24
3502
0
mai 24
2198
0
nov. 18
10822
0
aug. 25
5