fix: only render if barcode value is not an svg

This commit is contained in:
Safwan Samsudeen 2026-02-27 19:43:47 +05:30
parent 6e344db222
commit 7e739faea7
2 changed files with 1 additions and 2 deletions

View file

@ -504,7 +504,6 @@ frappe.ui.form.PrintView = class {
const get_options = frappe.ui.form.ControlBarcode.prototype.get_options.bind({
df: { options: el.dataset.options },
});
console.log(get_options(el.dataset.barcodeValue));
JsBarcode(el, el.dataset.barcodeValue, get_options(el.dataset.barcodeValue));
el.setAttribute("width", "100%");
});

View file

@ -157,7 +157,7 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
{% elif df.fieldtype=="Signature" %}
<img src="{{ doc[df.fieldname] }}" class="signature-img img-responsive"
{%- if df.print_width %} style="width: {{ get_width(df) }};"{% endif %}>
{% elif df.fieldtype=="Barcode" %}
{% elif df.fieldtype=="Barcode" and not doc[df.fieldname].startswith("<svg") %}
<svg data-barcode-value="{{ doc[df.fieldname] }}" height="80" data-options='{{ df.options }}'></svg>
{% elif df.fieldtype in ("Attach", "Attach Image") and frappe.utils.is_image(doc[df.fieldname]) %}
<img src="{{ doc[df.fieldname] }}" class="img-responsive"