fix(patch): enable discount account in buying and selling if exist in accounts settings
This commit is contained in:
parent
171c60ff37
commit
35e875c111
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()
|
Loading…
x
Reference in New Issue
Block a user