Skip to content

Commit

Permalink
Merge pull request #30854 from rmehta/fix-discount-accounting-patch
Browse files Browse the repository at this point in the history
fix(minor): discount accounting patch
  • Loading branch information
deepeshgarg007 committed May 1, 2022
2 parents 54d16de + d746db5 commit 15237fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions erpnext/patches/v14_0/discount_accounting_separation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@


def execute():
doc = frappe.get_doc("Accounts Settings")
discount_account = doc.enable_discount_accounting
data = frappe.db.sql(
'select value from tabSingles where doctype="Accounts Settings" and field="enable_discount_accounting"'
)
discount_account = data and data[0][0] or 0
if discount_account:
for doctype in ["Buying Settings", "Selling Settings"]:
frappe.db.set_value(doctype, doctype, "enable_discount_accounting", 1, update_modified=False)

0 comments on commit 15237fd

Please sign in to comment.