summaryrefslogtreecommitdiff
path: root/addons/web/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/controllers')
-rw-r--r--addons/web/controllers/main.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 3b0e2e27f28..b450663cd46 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1991,7 +1991,7 @@ class ReportController(http.Controller):
# Misc. route utils
#------------------------------------------------------
@http.route(['/report/barcode', '/report/barcode/<type>/<path:value>'], type='http', auth="public")
- def report_barcode(self, type, value, width=600, height=100, humanreadable=0, quiet=1):
+ def report_barcode(self, type, value, width=600, height=100, humanreadable=0, quiet=1, mask=None):
"""Contoller able to render barcode images thanks to reportlab.
Samples:
<img t-att-src="'/report/barcode/QR/%s' % o.name"/>
@@ -2005,10 +2005,13 @@ class ReportController(http.Controller):
at the bottom of the output image
:param quiet: Accepted values: 0 (default) or 1. 1 will display white
margins on left and right.
+ :param mask: The mask code to be used when rendering this QR-code.
+ Masks allow adding elements on top of the generated image,
+ such as the Swiss cross in the center of QR-bill codes.
"""
try:
barcode = request.env['ir.actions.report'].barcode(type, value, width=width,
- height=height, humanreadable=humanreadable, quiet=quiet)
+ height=height, humanreadable=humanreadable, quiet=quiet, mask=mask)
except (ValueError, AttributeError):
raise werkzeug.exceptions.HTTPException(description='Cannot convert into barcode.')