[FIX] {web,point_of_sale}: allow cross-origin access to company logo
This commit is contained in:
parent
6feb5f70e9
commit
edc4b0b9bb
|
@ -276,18 +276,19 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
c.height = height
|
||||
var ctx = c.getContext('2d');
|
||||
ctx.drawImage(self.company_logo,0,0, width, height);
|
||||
|
||||
|
||||
self.company_logo_base64 = c.toDataURL();
|
||||
logo_loaded.resolve();
|
||||
};
|
||||
self.company_logo.onerror = function(){
|
||||
logo_loaded.reject();
|
||||
};
|
||||
self.company_logo.crossOrigin = "anonymous";
|
||||
self.company_logo.src = '/web/binary/company_logo'+'?_'+Math.random();
|
||||
|
||||
return logo_loaded;
|
||||
});
|
||||
|
||||
|
||||
return loaded;
|
||||
},
|
||||
|
||||
|
|
|
@ -1471,7 +1471,7 @@ class Binary(http.Controller):
|
|||
'/web/binary/company_logo',
|
||||
'/logo',
|
||||
'/logo.png',
|
||||
], type='http', auth="none")
|
||||
], type='http', auth="none", cors="*")
|
||||
def company_logo(self, dbname=None, **kw):
|
||||
# TODO add etag, refactor to use /image code for etag
|
||||
uid = None
|
||||
|
|
Loading…
Reference in New Issue