brotherton-erpnext/erpnext/patches/v7_2/set_party_status.py

10 lines
354 B
Python

import frappe
def execute():
# removing Open status for Customer / Supplier as it is duplicate
options = frappe.get_meta('Customer').get_field('status').options.split('\n')
default_option = 'Active'
if not default_option in options:
default_option = option[0]
frappe.db.sql('update tabCustomer set status=%s where status="Open"', default_option)