mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
fix(minor): discount accounting patch
This commit is contained in:
@@ -2,8 +2,10 @@ import frappe
|
|||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
doc = frappe.get_doc("Accounts Settings")
|
data = frappe.db.sql(
|
||||||
discount_account = doc.enable_discount_accounting
|
'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:
|
if discount_account:
|
||||||
for doctype in ["Buying Settings", "Selling Settings"]:
|
for doctype in ["Buying Settings", "Selling Settings"]:
|
||||||
frappe.db.set_value(doctype, doctype, "enable_discount_accounting", 1, update_modified=False)
|
frappe.db.set_value(doctype, doctype, "enable_discount_accounting", 1, update_modified=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user