From cba7a11d75e7d9159108cf651a7560a6d337cfb9 Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Wed, 25 Oct 2017 07:27:10 +0100 Subject: [PATCH] Make Variant does not copy UOM properties (#10887) (#11261) * add `uoms` to Item Variant Settings if not already added * add new patch to patch list * change uoms field to no_copy:0 --- erpnext/patches.txt | 1 + erpnext/patches/v9_0/set_uoms_in_variant_field.py | 14 ++++++++++++++ erpnext/stock/doctype/item/item.json | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v9_0/set_uoms_in_variant_field.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index e7c0614b7a..8a4d3a5b97 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -451,3 +451,4 @@ erpnext.patches.v8_9.update_billing_gstin_for_indian_account erpnext.patches.v9_0.fix_subscription_next_date erpnext.patches.v9_0.add_healthcare_domain erpnext.patches.v9_0.set_variant_item_description +erpnext.patches.v9_0.set_uoms_in_variant_field diff --git a/erpnext/patches/v9_0/set_uoms_in_variant_field.py b/erpnext/patches/v9_0/set_uoms_in_variant_field.py new file mode 100644 index 0000000000..9e783d99be --- /dev/null +++ b/erpnext/patches/v9_0/set_uoms_in_variant_field.py @@ -0,0 +1,14 @@ +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() diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 525321c5a9..105cdf5c57 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1072,7 +1072,7 @@ "in_standard_filter": 0, "label": "UOMs", "length": 0, - "no_copy": 1, + "no_copy": 0, "oldfieldname": "uom_conversion_details", "oldfieldtype": "Table", "options": "UOM Conversion Detail",