brotherton-erpnext/erpnext/patches/v13_0/update_vehicle_no_reqd_condition.py
Dany Robert 7acdcc70ad
fix: v12 migrate error - unknown column ‘mandatory_depends_on’ (#27897)
* fix: v12 doesn't have mandatory_depends_on field

* fix: move update_vehicle_no_reqd_condition to v13

* fix: move update_vehicle_no_reqd_condition to v13

* fix: file name missing .py

* refactor!: add back empty line

* fix: linters issue
2021-10-11 15:05:55 +05:30

12 lines
349 B
Python

import frappe
def execute():
frappe.reload_doc('custom', 'doctype', 'custom_field')
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
if frappe.db.exists('Custom Field', { 'fieldname': 'vehicle_no' }):
frappe.db.set_value('Custom Field', { 'fieldname': 'vehicle_no' }, 'mandatory_depends_on', '')