brotherton-erpnext/erpnext/patches/v9_0/set_uoms_in_variant_field.py

15 lines
294 B
Python
Raw Normal View History

from __future__ import unicode_literals
import frappe
def execute():
doc = frappe.get_doc('Item Variant Settings')
variant_field_names = [vf.field_name for vf in doc.fields]
if 'uoms' not in variant_field_names:
doc.append(
'fields', {
'field_name': 'uoms'
}
)
doc.save()