mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
fix(patch): enable discount account in buying and selling if exist in accounts settings
This commit is contained in:
14
erpnext/patches/v14_0/discount_accounting_separation.py
Normal file
14
erpnext/patches/v14_0/discount_accounting_separation.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
doc = frappe.get_doc("Accounts Settings")
|
||||||
|
discount_account = doc.enable_discount_accounting
|
||||||
|
if discount_account:
|
||||||
|
buying_settings = frappe.get_doc("Buying Settings")
|
||||||
|
selling_settings = frappe.get_doc("Selling Settings")
|
||||||
|
|
||||||
|
buying_settings.enable_discount_accounting = 1
|
||||||
|
selling_settings.enable_discount_accounting = 1
|
||||||
|
|
||||||
|
buying_settings.save()
|
||||||
|
selling_settings.save()
|
||||||
Reference in New Issue
Block a user