mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-16 21:35:09 +00:00
fix: ewaybill mandatory conditions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)')
|
||||
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)
|
||||
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user