I trying to create a custom widget,
*.js
odoo.define('pos_widget',function (require) {
var PosBaseWidget = require('point_of_sale.BaseWidget');
aleert('Alert One');//It alerts
var NewWidget = PosBaseWidget.extend({
template: 'NewWidget',
init: function(parent,options){
alert('Alert Two inside init function'); // It not alerts
var self = this;
},
});
});
But getting an error on console:
Error: Service pos_widget already defined boot.js:119:27
No type for action Object { context: Object } action_manager.js:631:13
error: Some modules could not be started
Failed modules: Array [ "point_of_sale.chrome" ]
Non loaded modules: Array [ "point_of_sale.main" ]
Debug: Object { point_of_sale.main: Object, point_of_sale.chrome: Object }
Note
I have added these lines in chrome.js
file (point_of_sale module) directly, and works. But not in custom module.
How can i resolve this?