Skip to Content
Menu
This question has been flagged
1 Reply
10686 Views

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?

Avatar
Discard
Best Answer
  • 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.

Avatar
Discard
Author

thanks, its working.

Author

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?

Related Posts Replies Views Activity
0
Dec 17
3209
2
Jul 17
3597
1
Jun 24
314
0
May 24
492
1
Aug 23
10147