Odoo Help


Urgent: Islamic Date Widget issue

on 1/21/15, 6:16 AM 3,493 views


I want to add hijri calendar  widget to odoo V8 , I spent a lot of time on developing a module for that but I was unsucessful till now .

I used the following jquery plugin: http://keith-wood.name/calendars.html

and my code is :
$('#defaultPopup').calendarsPicker({ calendar: $.calendars.instance('Islamic') });
I get  an error in this plugin jquery.calendars.js line 630

if (this._validateLevel === 0 && this.name !== year.calendar().name) {


This is the error:

uncaught typeerror undefined is not a function

if (year.year) {
                if (this._validateLevel === 0 && this.name !== year.calendar().name) {
                    throw ($.calendars.local.differentCalendars || $.calendars.regionalOptions[''].differentCalendars).
                        replace(/\{0\}/, this.local.name).replace(/\{1\}/, year.calendar().local.name);
                return year;

Could you please advice me how to resolve this issue or if there is any implemenation for islamic date ?

I need it urgently.


Thanks in advance.

Here is the source code 


openerp.islamic_date_widget= function(openerp){


openerp.islamic_date_widget.Date = openerp.web.form.AbstractField.extend({


    set_value: function(value) {
        this.id = value;
        $(document).ready(function() {
            $('#defaultPopup').calendarsPicker({ calendar: $.calendars.instance('ummalqura') });



<?xml version="1.0" encoding="UTF-8"?>
    <t t-name="defaultPopup">

          <input id="defaultPopup" type="text" />



<?xml version="1.0" encoding="UTF-8"?>
        <template id="assets_backend_islamic_date" name="map assets" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <link rel="stylesheet" type="text/css" href="/islamic_date_widget/static/src/css/jquery.calendars.picker.css" /> 
                <script type="text/javascript" src="/islamic_date_widget/static/src/js/jquery.plugin.js"></script>
                <script src="/islamic_date_widget/static/src/js/jquery.calendars.js"></script>
                <script src="/islamic_date_widget/static/src/js/jquery.calendars.plus.js"></script>
                <script src="/islamic_date_widget/static/src/js/jquery.calendars.picker.js"></script>
                <script src="/islamic_date_widget/static/src/js/jquery.calendars.ummalqura.js"></script>
                <script type="text/javascript" src="/islamic_date_widget/static/src/js/defaultPopup.js"></script> 



Could you add the error itself please?

on 1/21/15, 8:10 AM

This error message tells the whole story. On that line, you are trying to execute a function. However, whatever is being executed is not a function! Instead, it's undefined.

on 1/21/15, 9:15 AM

Yes, you are right. so how to resolve this issue ?

on 1/21/15, 9:27 AM

Hmm well I see your code start from an if and ends with a return so I'd assume there is more code. Can you paste the whole function and the code where you call the function with? One of those values is undefined so look for that.

on 1/21/15, 9:39 AM

Thanks, I will paste the source code today

on 1/21/15, 11:05 AM

Yenthe now you can find all the code ,looking forward to hearing from you.

on 1/21/15, 1:29 PM

Yenthe please let me know if there is any update for islamic date

on 1/22/15, 8:16 AM

I'm sorry Salman but I don't see the fault myself, sadly.. I'm not sure what isn't set. Try to debug all values and see if that brings you any further

on 1/22/15, 8:23 AM

Hardikgiri Goswami

--Hardikgiri Goswami--

| 2 1 5
Rajkot, India
--Hardikgiri Goswami--

OpenERP/Odoo Customization/Integration Expert / Python Programmer

Skype ID : hardikgiri.goswami

Hardikgiri Goswami
On 1/21/15, 8:21 AM

I have found some links:




Stephen Mack

--Stephen Mack--

| 8 8 9
Santiago, Chile
--Stephen Mack--

Some people call me a karma whore, I only ask for 10 points if you like my answer and 15 if I happen to get it correct.

Stephen Mack
On 1/21/15, 7:38 AM

I am not a python developer but does triple equals exist "==="?

Hmm Stephen turns out we where both wrong, as Ivan stated. I've deleted my reply since we both had the same anyways.. His code is for JS & jQuery so I guess we where both wrong! :)

on 1/21/15, 8:09 AM

Well I am sticking with my answer. According to what I have read the === and == operators are the same except that no type conversion is done with ===. Maybe he has a mismatch.

Stephen Mack
on 1/21/15, 8:22 AM
On 2/24/15, 6:31 AM

Any advice please

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 1/21/15, 6:16 AM
Seen: 3493 times
Last updated: 3/16/15, 8:10 AM