fix: patch fixes- force reload doc, check for company
This commit is contained in:
parent
eaa3614155
commit
1b25e69af4
@ -8,14 +8,17 @@ from erpnext.erpnext_integrations.doctype.taxjar_settings.taxjar_settings import
|
||||
|
||||
def execute():
|
||||
|
||||
frappe.reload_doctype("Taxjar Settings")
|
||||
company = frappe.get_all('Company', filters = {'country': 'United States'}, fields=['name'])
|
||||
if not company:
|
||||
return
|
||||
|
||||
frappe.reload_doctype("Taxjar Settings", force=True)
|
||||
|
||||
TAXJAR_CREATE_TRANSACTIONS = frappe.db.get_single_value("TaxJar Settings", "taxjar_create_transactions")
|
||||
TAXJAR_CALCULATE_TAX = frappe.db.get_single_value("TaxJar Settings", "taxjar_calculate_tax")
|
||||
TAXJAR_SANDBOX_MODE = frappe.db.get_single_value("TaxJar Settings", "is_sandbox")
|
||||
company = frappe.get_all('Company', filters = {'country': 'United States'}, fields=['name'])
|
||||
|
||||
if not company or (not TAXJAR_CREATE_TRANSACTIONS and not TAXJAR_CALCULATE_TAX and not TAXJAR_SANDBOX_MODE):
|
||||
if (not TAXJAR_CREATE_TRANSACTIONS and not TAXJAR_CALCULATE_TAX and not TAXJAR_SANDBOX_MODE):
|
||||
return
|
||||
|
||||
frappe.reload_doctype("Product Tax Category")
|
||||
|
Loading…
Reference in New Issue
Block a user