2022-04-08 11:57:53 +00:00
|
|
|
import frappe
|
|
|
|
|
2022-04-14 10:12:16 +00:00
|
|
|
|
2022-04-08 11:57:53 +00:00
|
|
|
def execute():
|
2022-05-01 06:55:21 +00:00
|
|
|
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
|
2022-04-14 10:12:16 +00:00
|
|
|
if discount_account:
|
|
|
|
for doctype in ["Buying Settings", "Selling Settings"]:
|
|
|
|
frappe.db.set_value(doctype, doctype, "enable_discount_accounting", 1, update_modified=False)
|