From 848b641d7b2e539c0db06c48fc7a2a083e4c3c3e Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Tue, 7 Dec 2021 14:51:05 +0530 Subject: [PATCH] fix: rename KSA QR field to match localisation --- erpnext/patches/v13_0/rename_ksa_qr_field.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 erpnext/patches/v13_0/rename_ksa_qr_field.py diff --git a/erpnext/patches/v13_0/rename_ksa_qr_field.py b/erpnext/patches/v13_0/rename_ksa_qr_field.py new file mode 100644 index 0000000000..4946b0d1db --- /dev/null +++ b/erpnext/patches/v13_0/rename_ksa_qr_field.py @@ -0,0 +1,14 @@ +# Copyright (c) 2020, Wahni Green Technologies and Contributors +# License: GNU General Public License v3. See license.txt + +import frappe +from frappe.model.utils.rename_field import rename_field + + +def execute(): + company = frappe.get_all('Company', filters = {'country': 'Saudi Arabia'}) + if not company: + return + + if frappe.db.exists('DocType', 'Sales Invoice') and frappe.get_meta('Sales Invoice').has_field('qr_code'): + rename_field('Sales Invoice', 'qr_code', 'ksa_einv_qr')