mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-20 03:47:11 +00:00
feat: book Expenses Added To Stock GL entries for stock vouchers (configurable) (#57190)
* feat: book Expenses Added To Stock GL entries for Stock Entry, Stock Reconciliation and LCV Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat: make stock expense GL booking configurable via Accounts Settings Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: skip stock expense booking for unconfigured companies, check flag once per compose --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
has_expense_accounts = frappe.db.exists(
|
||||
"Company", {"purchase_expense_account": ("is", "set")}
|
||||
) or frappe.db.exists("Item Default", {"purchase_expense_account": ("is", "set")})
|
||||
|
||||
if has_expense_accounts:
|
||||
frappe.db.set_single_value("Accounts Settings", "book_stock_expense_gl_entries", 1)
|
||||
Reference in New Issue
Block a user