[9.0] Cannot include in instance.web.KanbanView #15014

Closed
idncom opened this Issue Jan 10, 2017 · 2 comments

Projects

None yet

3 participants

@idncom
idncom commented Jan 10, 2017

Impacted versions: 9.0 Community

Steps to reproduce:
For any module add js to assets like so:
openerp.some_module = function(instance, local) { instance.web.KanbanView.include({}); }

Current behavior:
The entire kanban view will not load saying some modules cannot be loaded. The exact same code except changing KanbanView to ListView works as expected.
Expected behavior:
Should allow you to add custom javascript to the kanban view.

Video/Screenshot link (optional):

@qsm-odoo
Contributor

Hello,
It seems like you are using our old javascript system. In 9.0, there is a module system you can find information about here: https://www.odoo.com/documentation/9.0/reference/javascript.html#javascript-module-system-overview

If you want to add some extension to the KanbanView, you should :

  • Create a new JS module
odoo.define("myModule.myExtension", function (require) {
    // ... define your extension here ...
});
  • Inside, you must require the tools you will work with, so for the kanban view:
var KanbanView = require("web_kanban.KanbanView");
  • Then, you can include the kanban view using the require result

Hope this helps.

@Yenthe666
Contributor

Hi @idncom,

Thank you for your report.
As this report is about custom development and it is not a bug in the official code I'm closing this issue.
The answer by @qsm-odoo should fix your issue, you're just using the old JS system.

Regards,
Yenthe

@Yenthe666 Yenthe666 closed this Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment