mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 22:19:18 +00:00
refactor: patch old contract with full party name
(cherry picked from commit 8e2221178b)
# Conflicts:
# erpnext/patches.txt
This commit is contained in:
@@ -375,4 +375,13 @@ erpnext.stock.doctype.stock_ledger_entry.patches.ensure_sle_indexes
|
|||||||
erpnext.patches.v14_0.rename_group_by_to_categorize_by
|
erpnext.patches.v14_0.rename_group_by_to_categorize_by
|
||||||
execute:frappe.db.set_single_value("Accounts Settings", "receivable_payable_fetch_method", "Buffered Cursor")
|
execute:frappe.db.set_single_value("Accounts Settings", "receivable_payable_fetch_method", "Buffered Cursor")
|
||||||
erpnext.patches.v14_0.set_update_price_list_based_on
|
erpnext.patches.v14_0.set_update_price_list_based_on
|
||||||
|
<<<<<<< HEAD
|
||||||
erpnext.patches.v14_0.rename_group_by_to_categorize_by_in_custom_reports
|
erpnext.patches.v14_0.rename_group_by_to_categorize_by_in_custom_reports
|
||||||
|
=======
|
||||||
|
erpnext.patches.v15_0.update_journal_entry_type
|
||||||
|
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
|
||||||
|
>>>>>>> 8e2221178b (refactor: patch old contract with full party name)
|
||||||
|
|||||||
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