mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-20 23:35:11 +00:00
refactor: patch old contract with full party name
This commit is contained in:
@@ -415,3 +415,4 @@ erpnext.patches.v15_0.set_grand_total_to_default_mop
|
||||
execute:frappe.db.set_single_value("Accounts Settings", "use_new_budget_controller", True)
|
||||
erpnext.patches.v15_0.rename_group_by_to_categorize_by_in_custom_reports
|
||||
erpnext.patches.v15_0.remove_agriculture_roles
|
||||
erpnext.patches.v14_0.update_full_name_in_contract
|
||||
|
||||
15
erpnext/patches/v14_0/update_full_name_in_contract.py
Normal file
15
erpnext/patches/v14_0/update_full_name_in_contract.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import frappe
|
||||
from frappe import qb
|
||||
|
||||
|
||||
def execute():
|
||||
con = qb.DocType("Contract")
|
||||
for c in (
|
||||
qb.from_(con)
|
||||
.select(con.name, con.party_type, con.party_name)
|
||||
.where(con.party_full_name.isnull())
|
||||
.run(as_dict=True)
|
||||
):
|
||||
field = c.party_type.lower() + "_name"
|
||||
if res := frappe.db.get_value(c.party_type, c.party_name, field):
|
||||
frappe.db.set_value("Contract", c.name, "party_full_name", res)
|
||||
Reference in New Issue
Block a user