chore: patch property setters for JE with new entry type
This commit is contained in:
parent
525f054c45
commit
789e448f0e
@ -319,4 +319,5 @@ erpnext.patches.v14_0.create_accounting_dimensions_for_asset_capitalization
|
|||||||
erpnext.patches.v14_0.update_partial_tds_fields
|
erpnext.patches.v14_0.update_partial_tds_fields
|
||||||
erpnext.patches.v14_0.create_incoterms_and_migrate_shipment
|
erpnext.patches.v14_0.create_incoterms_and_migrate_shipment
|
||||||
erpnext.patches.v14_0.setup_clear_repost_logs
|
erpnext.patches.v14_0.setup_clear_repost_logs
|
||||||
erpnext.patches.v14_0.create_accounting_dimensions_for_payment_request
|
erpnext.patches.v14_0.create_accounting_dimensions_for_payment_request
|
||||||
|
erpnext.patches.v14_0.update_entry_type_for_journal_entry
|
||||||
|
|||||||
18
erpnext/patches/v14_0/update_entry_type_for_journal_entry.py
Normal file
18
erpnext/patches/v14_0/update_entry_type_for_journal_entry.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
"""
|
||||||
|
Update Propery Setters for Journal Entry with new 'Entry Type'
|
||||||
|
"""
|
||||||
|
new_voucher_type = "Exchange Gain Or Loss"
|
||||||
|
prop_setter = frappe.db.get_list(
|
||||||
|
"Property Setter",
|
||||||
|
filters={"doc_type": "Journal Entry", "field_name": "voucher_type", "property": "options"},
|
||||||
|
)
|
||||||
|
if prop_setter:
|
||||||
|
property_setter_doc = frappe.get_doc("Property Setter", prop_setter[0].get("name"))
|
||||||
|
|
||||||
|
if new_voucher_type not in property_setter_doc.value.split("\n"):
|
||||||
|
property_setter_doc.value += "\n" + new_voucher_type
|
||||||
|
property_setter_doc.save()
|
||||||
Loading…
x
Reference in New Issue
Block a user