diff --git a/erpnext/patches.txt b/erpnext/patches.txt index d08a9283a08..e6066a9fead 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -678,4 +678,4 @@ erpnext.patches.v12_0.update_state_code_for_daman_and_diu erpnext.patches.v12_0.rename_lost_reason_detail erpnext.patches.v12_0.update_leave_application_status erpnext.patches.v12_0.update_payment_entry_status -erpnext.patches.v12_0.setup_einvoice_fields #2020-11-04 +erpnext.patches.v12_0.setup_einvoice_fields #2020-12-02 diff --git a/erpnext/patches/v12_0/setup_einvoice_fields.py b/erpnext/patches/v12_0/setup_einvoice_fields.py index cbad581ab2a..6c7b3e8feb6 100644 --- a/erpnext/patches/v12_0/setup_einvoice_fields.py +++ b/erpnext/patches/v12_0/setup_einvoice_fields.py @@ -31,6 +31,14 @@ def execute(): add_permissions() add_print_formats() - frappe.db.set_value('Custom Field', { 'fieldname': 'mode_of_transport' }, 'default', '') - frappe.db.set_value('Custom Field', { 'fieldname': 'vehicle_no' }, 'depends_on', 'eval:doc.mode_of_transport == "Road"') - frappe.db.set_value('Custom Field', { 'fieldname': 'ewaybill' }, 'depends_on', 'eval:((doc.docstatus === 1 || doc.ewaybill) && doc.eway_bill_cancelled === 0)') \ No newline at end of file + t = { + 'mode_of_transport': [{'default': None}], + 'ewaybill': [ + {'depends_on': 'eval:((doc.docstatus === 1 || doc.ewaybill) && doc.eway_bill_cancelled === 0)'} + ] + } + + for field, conditions in t.items(): + for c in conditions: + [(prop, value)] = c.items() + frappe.db.set_value('Custom Field', { 'fieldname': field }, prop, value) \ No newline at end of file diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index bb0d2ff8013..317a0e242b7 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -303,7 +303,6 @@ def make_custom_fields(update=True): 'label': 'Vehicle No', 'fieldtype': 'Data', 'insert_after': 'lr_no', - 'depends_on': 'eval:(doc.mode_of_transport === "Road")', 'print_hide': 1, 'translatable': 0 },