fix(ksa): qrcode for invoices with special chars (#28715)
This commit is contained in:
parent
a8f283bb20
commit
7511a9ed31
@ -1,7 +1,6 @@
|
||||
import io
|
||||
import os
|
||||
from base64 import b64encode
|
||||
from urllib.parse import quote
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
@ -102,9 +101,10 @@ def create_qr_code(doc, method):
|
||||
url = qr_create(base64_string, error='L')
|
||||
url.png(qr_image, scale=2, quiet_zone=1)
|
||||
|
||||
urlencoded_name = quote(doc.name)
|
||||
name = frappe.generate_hash(doc.name, 5)
|
||||
|
||||
# making file
|
||||
filename = f"QR-CODE-{urlencoded_name}.png".replace(os.path.sep, "__")
|
||||
filename = f"QRCode-{name}.png".replace(os.path.sep, "__")
|
||||
_file = frappe.get_doc({
|
||||
"doctype": "File",
|
||||
"file_name": filename,
|
||||
|
Loading…
x
Reference in New Issue
Block a user