Odoo Help

1
0
Ben Olsen
On 8/25/14, 1:33 PM

Tekse was really close, and helped me find a good solution. Assuming you have a custom web module already up and running (which has to be named correctly, so go through the simple widget tutorial if this next part doesn't work on its own), all you need to do is make the change for both widget classes in "start" before you call super. The trick here is that widgets can extend themselves:

instance.web.DateTimeWidget = instance.web.DateTimeWidget.extend({
    start: function() {
        Date.CultureInfo.firstDayOfWeek = 1;
        this._super();
    },
});
instance.web.DateWidget = instance.web.DateWidget.extend({
    start: function() {
        Date.CultureInfo.firstDayOfWeek = 1;
        this._super();
    },
});

 

For some reason you need to apply this on DateTimeWidget and DateWidget, even though DateWidget inherits from DateTimeWidget. But this is what worked for me.

 

0
Tekse Arpad
On 3/12/14, 9:37 AM

I'm trying to make a module which changes this. I already made this:

openerp.change_firstdow = function(instance){
    var module = instance.web;

    module.Date.CultureInfo.firstDayOfWeek= 1;

};

but I think I'm missing something because it's not changes to Monday. Any help would be great! TArpi

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

5 follower(s)

Stats

Asked: 4/3/13, 11:31 AM
Seen: 6694 times
Last updated: 3/16/15, 8:10 AM