fix: Add mandatory depends on condition for export type field

This commit is contained in:
Deepesh Garg 2021-08-16 13:18:39 +05:30
parent 82d0cfc68e
commit b58b1127f3
3 changed files with 15 additions and 5 deletions

View File

@ -293,4 +293,4 @@ erpnext.patches.v13_0.update_job_card_details
erpnext.patches.v13_0.update_level_in_bom #1234sswef
erpnext.patches.v13_0.add_missing_fg_item_for_stock_entry
erpnext.patches.v13_0.update_subscription_status_in_memberships
erpnext.patches.v13_0.update_export_type_for_gst
erpnext.patches.v13_0.update_export_type_for_gst #2021-08-16

View File

@ -8,11 +8,19 @@ def execute():
# Update custom fields
fieldname = frappe.db.get_value('Custom Field', {'dt': 'Customer', 'fieldname': 'export_type'})
if fieldname:
frappe.db.set_value('Custom Field', fieldname, 'default', '')
frappe.db.set_value('Custom Field', fieldname,
{
'default': '',
'mandatory_depends_on': 'eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)'
})
fieldname = frappe.db.get_value('Custom Field', {'dt': 'Supplier', 'fieldname': 'export_type'})
if fieldname:
frappe.db.set_value('Custom Field', fieldname, 'default', '')
frappe.db.set_value('Custom Field', fieldname,
{
'default': '',
'mandatory_depends_on': 'eval:in_list(["SEZ", "Overseas"], doc.gst_category)'
})
# Update Customer/Supplier Masters
frappe.db.sql("""

View File

@ -642,7 +642,8 @@ def make_custom_fields(update=True):
'fieldtype': 'Select',
'insert_after': 'gst_category',
'depends_on':'eval:in_list(["SEZ", "Overseas"], doc.gst_category)',
'options': '\nWith Payment of Tax\nWithout Payment of Tax'
'options': '\nWith Payment of Tax\nWithout Payment of Tax',
'mandatory_depends_on': 'eval:in_list(["SEZ", "Overseas"], doc.gst_category)'
}
],
'Customer': [
@ -660,7 +661,8 @@ def make_custom_fields(update=True):
'fieldtype': 'Select',
'insert_after': 'gst_category',
'depends_on':'eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)',
'options': '\nWith Payment of Tax\nWithout Payment of Tax'
'options': '\nWith Payment of Tax\nWithout Payment of Tax',
'mandatory_depends_on': 'eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)'
}
],
'Member': [