Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
6655 Weergaven

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
Annuleer
Beste antwoord
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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
jul. 24
2440
3
mei 24
3250
0
mei 24
1974
0
nov. 18
10664
0
jul. 25
157