From 2256155e806e3e37f0e6d6ba3ff85546101d4d27 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Tue, 7 Dec 2021 11:02:28 +0000 Subject: [PATCH] feat(Regional): patch to disable ksa print formats for other countries --- .../v13_0/disable_ksa_print_format_for_others.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 erpnext/patches/v13_0/disable_ksa_print_format_for_others.py diff --git a/erpnext/patches/v13_0/disable_ksa_print_format_for_others.py b/erpnext/patches/v13_0/disable_ksa_print_format_for_others.py new file mode 100644 index 0000000000..c7b184dba5 --- /dev/null +++ b/erpnext/patches/v13_0/disable_ksa_print_format_for_others.py @@ -0,0 +1,14 @@ +# Copyright (c) 2020, Wahni Green Technologies and Contributors +# License: GNU General Public License v3. See license.txt + +import frappe + + +def execute(): + company = frappe.get_all('Company', filters = {'country': 'Saudi Arabia'}) + if company: + return + + if frappe.db.exists('DocType', 'Print Format'): + frappe.db.sql("""UPDATE`tabPrint Format` SET disabled = 1 WHERE + name IN ('KSA VAT Invoice', 'KSA POS Invoice')""")