fix: show/hide eway bill fields

This commit is contained in:
Saqib Ansari
2020-11-04 18:50:15 +05:30
parent 6d5a8aea9a
commit ca944316b4
3 changed files with 11 additions and 3 deletions

View File

@@ -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
erpnext.patches.v12_0.setup_einvoice_fields #2020-11-04

View File

@@ -29,4 +29,12 @@ def execute():
}
create_custom_fields(custom_fields, update=True)
add_permissions()
add_print_formats()
add_print_formats()
frappe.db.set_value('Custom Field', { 'fieldname': 'mode_of_transport' }, 'default', '')
frappe.db.set_value('Custom Field', { 'fieldname': 'distance' }, 'mandatory_depends_on', 'transporter')
frappe.db.set_value('Custom Field', { 'fieldname': 'vehicle_no' }, 'mandatory_depends_on', 'eval:doc.mode_of_transport == "Road"')
frappe.db.set_value('Custom Field', { 'fieldname': 'vehicle_no' }, 'depends_on', 'depends_on': 'eval:doc.mode_of_transport == "Road"')
frappe.db.set_value('Custom Field', { 'fieldname': 'gst_vehicle_type' }, 'mandatory_depends_on', 'eval:doc.mode_of_transport == "Road"')
frappe.db.set_value('Custom Field', { 'fieldname': 'lr_date' }, 'mandatory_depends_on', 'eval:in_list(["Air", "Ship", "Rail"], doc.mode_of_transport)')
frappe.db.set_value('Custom Field', { 'fieldname': 'lr_no' }, 'mandatory_depends_on', 'eval:in_list(["Air", "Ship", "Rail"], doc.mode_of_transport)')

View File

@@ -303,6 +303,7 @@ 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
},
@@ -333,7 +334,6 @@ def make_custom_fields(update=True):
'label': 'Mode of Transport',
'fieldtype': 'Select',
'options': '\nRoad\nAir\nRail\nShip',
'default': 'Road',
'insert_after': 'transporter_name',
'print_hide': 1,
'translatable': 0