| 1 |
from odoo import http |
| 2 |
from odoo.http import request |
| 3 |
from odoo.addons.web.controllers.binary import Binary |
| 4 |
|
| 5 |
|
| 6 |
class PointOfSaleBinary(Binary): |
| 7 |
@http.route([ |
| 8 |
'/web/image/pos.config/<id>/<string:field>', |
| 9 |
'/web/image/pos.config/<id>/<string:field>/<int:width>x<int:height>'], type='http', auth="public") |
| 10 |
def point_of_sale_content_image(self, field='raw', **kwargs): |
| 11 |
if request.env.user._is_public() and field == 'customer_display_bg_img': |
| 12 |
request.env = request.env(su=True) |
| 13 |
return super().content_image(field=field, model='pos.config', **kwargs) |