brotherton-erpnext/erpnext/patches/v9_0/set_uoms_in_variant_field.py
tundebabzy cba7a11d75 Make Variant does not copy UOM properties () ()
* add `uoms` to Item Variant Settings if not already added

* add new patch to patch list

* change uoms field to no_copy:0
2017-10-25 11:57:10 +05:30

15 lines
294 B
Python

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()