brotherton-erpnext/erpnext/patches/v14_0/discount_accounting_separation.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
302 B
Python
Raw Normal View History

import frappe
2022-04-14 10:12:16 +00:00
def execute():
2022-04-14 10:12:16 +00:00
doc = frappe.get_doc("Accounts Settings")
discount_account = doc.enable_discount_accounting
if discount_account:
for doctype in ["Buying Settings", "Selling Settings"]:
frappe.db.set_value(doctype, doctype, "enable_discount_accounting", 1, update_modified=False)