Merge pull request #9305 from rohitwaghchaure/fixed_barcode_not_working_with_special_characters_new

fix: barcode issue
This commit is contained in:
mergify[bot] 2020-01-22 12:32:38 +00:00 committed by GitHub
commit 53ac59ddc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,11 @@ frappe.ui.form.ControlBarcode = frappe.ui.form.ControlData.extend({
set_formatted_input(value) {
// Set values to display
let svg = value;
const barcode_value = $(svg).attr('data-barcode-value');
let barcode_value = '';
if (value && value.startsWith('<svg')) {
barcode_value = $(svg).attr('data-barcode-value');
}
if (!barcode_value && this.doc) {
svg = this.get_barcode_html(value);