mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-18 02:55:20 +00:00
fix: Add cost center in loan document
(cherry picked from commit 5d66cc4c4a)
# Conflicts:
# erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py
# erpnext/patches.txt
This commit is contained in:
16
erpnext/patches/v13_0/add_cost_center_in_loans.py
Normal file
16
erpnext/patches/v13_0/add_cost_center_in_loans.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc('loan_management', 'doctype', 'loan')
|
||||
loan = frappe.qb.DocType('Loan')
|
||||
|
||||
for company in frappe.get_all('Company', pluck='name'):
|
||||
default_cost_center = frappe.db.get_value('Company', company, 'cost_center')
|
||||
frappe.qb.update(
|
||||
loan
|
||||
).set(
|
||||
loan.cost_center, default_cost_center
|
||||
).where(
|
||||
loan.company == company
|
||||
).run()
|
||||
Reference in New Issue
Block a user