تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6143 أدوات العرض

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,



الصورة الرمزية
إهمال
أفضل إجابة
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',
});
},
});});
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يوليو 24
1919
3
مايو 24
2547
0
مايو 24
1458
0
نوفمبر 18
10170
0
مارس 25
307