fix: replace frappe.get_all

This commit is contained in:
Dany Robert 2021-12-08 08:03:30 +05:30 committed by GitHub
parent 5b20746311
commit 3e97492da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,10 +141,9 @@ def delete_qr_code_file(doc, method=None):
if len(file_doc):
frappe.delete_doc('File', file_doc[0].name)
def delete_vat_settings_for_company(doc, method):
def delete_vat_settings_for_company(doc, method=None):
if doc.country != 'Saudi Arabia':
return
settings_doc = frappe.get_all('KSA VAT Setting', filters={'company': doc.name}, pluck='name')
for settings in settings_doc:
frappe.delete_doc('KSA VAT Setting', settings)
if frappe.db.exists('KSA VAT Setting', doc.name):
frappe.delete_doc('KSA VAT Setting', doc.name)