コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
11785 ビュー

i need to some customisation in js function for that i have inherited web.datepicker like this

odoo.define('hr_public_holidays_calendar.datepicker', function(require) {

"use strict";

var DateWidget = require('web.datepicker');

DateWidget.include({

 set_datetime_default: function() {

        alert(88);

    }

});

});

how can i do this?

アバター
破棄
最善の回答
  • In "web.datepicker" returns two objects (DateWidget, DateTimeWidget) so you need to access using those objects that you can find in below example.


Solution
=============

Try this below code, 

odoo.define('hr_public_holidays_calendar.datepicker', function(require) {

"use strict";

var DatePicker = require('web.datepicker');

DatePicker.DateWidget.include({

 set_datetime_default: function() {

        alert(88);

    }

});

});


I hope my answer is helpful.

If any query so comment please.

アバター
破棄
著作者

thanks, its working.

著作者

Hi,

Actually my concept is if holidays declared in public_holidays, those holidays should be visible with red colour in all datepickres.

please give me any idea.

Hello,

i am also trying that and getting error in console 'error: Some modules could not be started'

Can you help me.

odoo.define('module_name.field_utils', function (require) {

"use strict";

var core = require('web.core');

var Widget = require('web.Widget');

var dom = require('web.dom');

var session = require('web.session');

var time = require('web.time');

var utils = require('web.utils');

var fields_utils = require('web.field_utils');

var qweb = core.qweb;

var _t = core._t;

var field = fields_utils.extend({

parseNumber: function(value) {

console.log("CALLLLLLLLLLLLlll")

}

});

return field;

});

Hello Haresh

Can you please tell me that in which Odoo version you are trying?

Hello, I am facing the same error. I follow steps provided by you but the same error occurs. can you please help?

関連投稿 返信 ビュー 活動
0
12月 17
4036
2
7月 17
4578
1
6月 24
1251
0
5月 24
2110
1
8月 23
11222