Skip to Content
Menu
This question has been flagged
2 Replies
1154 Views
hi,   I want to add custom_id: this.customViewID  ? this.customViewID : "", in js file to remove the error
edit_custom() missing 1 required positional argument: 'custom_id' how can i add the code in _saveDashboard function,
here is my code but its not working


odoo.define('module.pos', function (require) {
"use strict";
var BoardController = require('board.BoardView');
var core = require('web.core');
var _t = core._t;
var _lt = core._lt;
var QWeb = core.qweb;
console.log('dff')
//var BoardController = FormController.extend({
//var LineRenderer =FormController.extend({

BoardController.include({

_saveDashboard: function () {
var board = this.renderer.getBoard();
var arch = QWeb.render('DashBoard.xml', _.extend({}, board));
return this._rpc({
route: '/web/view/edit_custom',
params: {
custom_id: this.customViewID ? this.customViewID : "",
arch: arch,
}
}).then(dataManager.invalidate.bind(dataManager));
},
});


});



Thank you very much in advance




Avatar
Discard
Author Best Answer

ar BoardView = require('board.BoardView');
var viewRegistry = require('web.view_registry');
var FormRenderer = require('web.FormRenderer');

var BoardView = BoardView.extend({
config: _.extend({}, BoardView.prototype.config, {

}),

init: function () {
this._super.apply(this, arguments);
this.controllerParams.customViewID = '';
},
});
viewRegistry.add('board', BoardView);


Avatar
Discard
Best Answer

Hello Neethu,

Please find code in comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

I want to changed some condition please you can check this code.

odoo.define('module.pos', function (require) {
"use strict";
var BoardController = require('board.BoardView');
var core = require('web.core');
var _t = core._t;
var _lt = core._lt;
var QWeb = core.qweb;
console.log('dff')
//var BoardController = FormController.extend({
//var LineRenderer =FormController.extend({

BoardController.include({

_saveDashboard: function () {
var board = this.renderer.getBoard();
var arch = QWeb.render('DashBoard.xml', _.extend({}, board));
return this._rpc({
route: '/web/view/edit_custom',
params: {
custom_id: this.customViewID !=null ? this.customViewID : '',
arch: arch,
}
}).then(dataManager.invalidate.bind(dataManager));
},
});

});