Skip to content

Commit

Permalink
fix: using db.exists and get_value instead of get_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesis189 committed Sep 29, 2021
1 parent 4536ab2 commit 3337afe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def on_update(self):

custom_fields = []
for dt in ['Item', 'Sales Invoice Item']:
doc = frappe.get_doc('Custom Field', {'dt': dt, 'fieldname':'product_tax_category'})
doc = frappe.db.exists('Custom Field', {'dt': dt, 'fieldname':'product_tax_category'})
custom_fields.append(doc)
fields_hidden = doc.get('hidden') if doc else 0
fields_hidden = frappe.db.get_value('Custom Field', {'dt': dt, 'fieldname':'product_tax_category'},'hidden')
fields_already_exist = True if custom_fields else False


Expand Down

0 comments on commit 3337afe

Please sign in to comment.