From a0aeacee8e03702bc2fdebed61184c91e78dfee9 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Tue, 7 Dec 2021 12:39:39 +0000 Subject: [PATCH] fix: reload doc --- .../v13_0/disable_ksa_print_format_for_others.py | 7 +++++-- erpnext/regional/saudi_arabia/setup.py | 10 +++++----- 2 files changed, 10 insertions(+), 7 deletions(-) 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 index c7b184dba5..b4080c5577 100644 --- a/erpnext/patches/v13_0/disable_ksa_print_format_for_others.py +++ b/erpnext/patches/v13_0/disable_ksa_print_format_for_others.py @@ -10,5 +10,8 @@ def execute(): 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')""") + frappe.reload_doc("regional", "print_format", "ksa_vat_invoice", force=True) + frappe.reload_doc("regional", "print_format", "ksa_pos_invoice", force=True) + frappe.db.sql("""UPDATE`tabPrint Format` SET disabled = 1 + WHERE name IN ('KSA VAT Invoice', 'KSA POS Invoice') + """) diff --git a/erpnext/regional/saudi_arabia/setup.py b/erpnext/regional/saudi_arabia/setup.py index 803c79883f..2131edad96 100644 --- a/erpnext/regional/saudi_arabia/setup.py +++ b/erpnext/regional/saudi_arabia/setup.py @@ -14,11 +14,11 @@ def setup(company=None, patch=True): make_custom_fields() def add_print_formats(): - frappe.reload_doc("regional", "print_format", "detailed_tax_invoice") - frappe.reload_doc("regional", "print_format", "simplified_tax_invoice") - frappe.reload_doc("regional", "print_format", "tax_invoice") - frappe.reload_doc("regional", "print_format", "ksa_vat_invoice") - frappe.reload_doc("regional", "print_format", "ksa_pos_invoice") + frappe.reload_doc("regional", "print_format", "detailed_tax_invoice", force=True) + frappe.reload_doc("regional", "print_format", "simplified_tax_invoice", force=True) + frappe.reload_doc("regional", "print_format", "tax_invoice", force=True) + frappe.reload_doc("regional", "print_format", "ksa_vat_invoice", force=True) + frappe.reload_doc("regional", "print_format", "ksa_pos_invoice", force=True) frappe.db.sql("""UPDATE`tabPrint Format` SET disabled = 0 WHERE name IN ('Simplified Tax Invoice', 'Detailed Tax Invoice',