feat: disable print formats for other countries

This commit is contained in:
Dany Robert
2021-12-08 23:13:50 +05:30
committed by GitHub
parent 73ce03288c
commit 6c1bc27b12

View 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)