From a06a70d1a448a914979629c2a089790805f79cc4 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 3 Sep 2021 12:40:13 +0530 Subject: [PATCH] fix: Patch error and tests --- erpnext/patches/v13_0/create_gst_payment_entry_fields.py | 1 + erpnext/regional/india/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v13_0/create_gst_payment_entry_fields.py b/erpnext/patches/v13_0/create_gst_payment_entry_fields.py index 7b54614f09..334c9d2b81 100644 --- a/erpnext/patches/v13_0/create_gst_payment_entry_fields.py +++ b/erpnext/patches/v13_0/create_gst_payment_entry_fields.py @@ -5,6 +5,7 @@ import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields def execute(): + frappe.reload_doc('accounts', 'doctype', 'advance_taxes_and_charges') frappe.reload_doc('accounts', 'doctype', 'payment_entry') custom_fields = { diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index 4ef4dd9e26..bf06d4a497 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -772,7 +772,7 @@ def update_place_of_supply(doc, method): if country != 'India': return - address = frappe.db.get_value("Address", doc.customer_address, ["gst_state", "gst_state_number"], as_dict=1) + address = frappe.db.get_value("Address", doc.get('customer_address'), ["gst_state", "gst_state_number"], as_dict=1) if address and address.gst_state and address.gst_state_number: doc.place_of_supply = cstr(address.gst_state_number) + "-" + cstr(address.gst_state)