[FIX] product: barcodes can be url encoded
Steps to reproduce: - install sales and barcodes - go to sales > catalog > products > create - give the product a random name and the following barcode: #1N4005-T+A - save > print > product labels Current behavior: the barcode is not generated properly because it is not url encoded everything after the # charachter is ignored Current behavior: barcodes are url encoded and generated properly opw-2203716 closes odoo/odoo#48607 X-original-commit: 5aaacb825d0c408bc11c4fbb386e1d365a68594b Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -18,9 +18,9 @@
|
||||
<tr>
|
||||
<td class="text-center align-middle" style="height: 6rem">
|
||||
<t t-if="product.barcode">
|
||||
<img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height::4rem;"/>
|
||||
<img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height::4rem;"/>
|
||||
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', product.barcode, 600, 150)" style="width:100%;height::4rem;"/>
|
||||
<img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height::4rem;"/>
|
||||
<img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN8', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height::4rem;"/>
|
||||
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height::4rem;"/>
|
||||
<span t-field="product.barcode"/>
|
||||
</t>
|
||||
<t t-else=""><span class="text-muted">No barcode available</span></t>
|
||||
@@ -53,9 +53,9 @@
|
||||
<tr>
|
||||
<td class="text-center align-middle" style="height: 6rem;">
|
||||
<t t-if="product.barcode">
|
||||
<img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:4rem;"/>
|
||||
<img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height:4rem;"/>
|
||||
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', product.barcode, 600, 150)" style="width:100%;height:4rem"/>
|
||||
<img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height:4rem;"/>
|
||||
<img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN8', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height:4rem;"/>
|
||||
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height:4rem"/>
|
||||
<span t-field="product.barcode"/>
|
||||
</t>
|
||||
<t t-else=""><span class="text-muted">No barcode available</span></t>
|
||||
|
||||
Reference in New Issue
Block a user