brotherton-erpnext/erpnext/patches/v13_0/update_vehicle_no_reqd_condition.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
361 B
Python
Raw Normal View History

import frappe
def execute():
frappe.reload_doc('custom', 'doctype', 'custom_field', force=True)
2021-02-22 14:33:23 +00:00
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
2021-02-22 14:33:23 +00:00
if frappe.db.exists('Custom Field', { 'fieldname': 'vehicle_no' }):
frappe.db.set_value('Custom Field', { 'fieldname': 'vehicle_no' }, 'mandatory_depends_on', '')