fix: only render if barcode value is not an svg
This commit is contained in:
parent
6e344db222
commit
7e739faea7
2 changed files with 1 additions and 2 deletions
|
|
@ -504,7 +504,6 @@ frappe.ui.form.PrintView = class {
|
||||||
const get_options = frappe.ui.form.ControlBarcode.prototype.get_options.bind({
|
const get_options = frappe.ui.form.ControlBarcode.prototype.get_options.bind({
|
||||||
df: { options: el.dataset.options },
|
df: { options: el.dataset.options },
|
||||||
});
|
});
|
||||||
console.log(get_options(el.dataset.barcodeValue));
|
|
||||||
JsBarcode(el, el.dataset.barcodeValue, get_options(el.dataset.barcodeValue));
|
JsBarcode(el, el.dataset.barcodeValue, get_options(el.dataset.barcodeValue));
|
||||||
el.setAttribute("width", "100%");
|
el.setAttribute("width", "100%");
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
|
||||||
{% elif df.fieldtype=="Signature" %}
|
{% elif df.fieldtype=="Signature" %}
|
||||||
<img src="{{ doc[df.fieldname] }}" class="signature-img img-responsive"
|
<img src="{{ doc[df.fieldname] }}" class="signature-img img-responsive"
|
||||||
{%- if df.print_width %} style="width: {{ get_width(df) }};"{% endif %}>
|
{%- 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>
|
<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]) %}
|
{% elif df.fieldtype in ("Attach", "Attach Image") and frappe.utils.is_image(doc[df.fieldname]) %}
|
||||||
<img src="{{ doc[df.fieldname] }}" class="img-responsive"
|
<img src="{{ doc[df.fieldname] }}" class="img-responsive"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue