mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
fix: qr code generation
This commit is contained in:
@@ -563,7 +563,7 @@ def update_einvoice_fields(doctype, name, signed_einvoice):
|
|||||||
|
|
||||||
frappe.db.set_value(doctype, name, 'irn', signed_einvoice.get('Irn'))
|
frappe.db.set_value(doctype, name, 'irn', signed_einvoice.get('Irn'))
|
||||||
frappe.db.set_value(doctype, name, 'ewaybill', signed_einvoice.get('EwbNo'))
|
frappe.db.set_value(doctype, name, 'ewaybill', signed_einvoice.get('EwbNo'))
|
||||||
frappe.db.set_value(doctype, name, 'signed_qr_code', '.'.join(signed_einvoice.get('SignedQRCode').split('.')[1:]))
|
frappe.db.set_value(doctype, name, 'signed_qr_code', signed_einvoice.get('SignedQRCode'))
|
||||||
frappe.db.set_value(doctype, name, 'signed_einvoice', decrypted_signed_invoice)
|
frappe.db.set_value(doctype, name, 'signed_einvoice', decrypted_signed_invoice)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@@ -616,14 +616,15 @@ def attach_qrcode_image(doctype, name):
|
|||||||
|
|
||||||
if not qrcode: return
|
if not qrcode: return
|
||||||
|
|
||||||
_file = frappe.get_doc({
|
_file = frappe.new_doc('File')
|
||||||
'doctype': 'File',
|
_file.update({
|
||||||
'file_name': 'Signed_QR_{name}.png'.format(name=name),
|
'file_name': 'Signed_QR_{name}.png'.format(name=name),
|
||||||
'attached_to_doctype': doctype,
|
'attached_to_doctype': doctype,
|
||||||
'attached_to_name': name,
|
'attached_to_name': name,
|
||||||
'content': 'qrcode'
|
'content': 'qrcode',
|
||||||
|
'is_private': 1
|
||||||
})
|
})
|
||||||
_file.save()
|
_file.insert()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
url = qrcreate(qrcode)
|
url = qrcreate(qrcode)
|
||||||
abs_file_path = os.path.abspath(_file.get_full_path())
|
abs_file_path = os.path.abspath(_file.get_full_path())
|
||||||
|
|||||||
Reference in New Issue
Block a user