feat: disable print formats for other countries
This commit is contained in:
16
erpnext/patches/v13_0/disable_ksa_print_format_for_others.py
Normal file
16
erpnext/patches/v13_0/disable_ksa_print_format_for_others.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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.reload_doc("regional", "print_format", "ksa_vat_invoice", force=True)
|
||||
frappe.reload_doc("regional", "print_format", "ksa_pos_invoice", force=True)
|
||||
for d in ('KSA VAT Invoice', 'KSA POS Invoice'):
|
||||
frappe.db.set_value("Print Format", d, "disabled", 1)
|
||||
Reference in New Issue
Block a user