Allow Item variant Rename (#13161)

* [WIP] Item varient rename

* [wip] Item Variant

* [fix] Item Varient Rename

* [fix] Item Attribution Rename

* removed unwanted code
This commit is contained in:
Vishal Dhayagude 2018-03-07 15:31:08 +05:30 committed by Nabin Hait
parent f0543a9765
commit 668ec25d19
2 changed files with 37 additions and 2 deletions

View File

@ -92,7 +92,10 @@ def validate_is_incremental(numeric_attribute, attribute, value, item):
InvalidItemAttributeValueError, title=_('Invalid Attribute'))
def validate_item_attribute_value(attributes_list, attribute, attribute_value, item):
if attribute_value not in attributes_list:
allow_rename_attribute_value = frappe.db.get_single_value('Item Variant Settings', 'allow_rename_attribute_value')
if allow_rename_attribute_value:
pass
elif attribute_value not in attributes_list:
frappe.throw(_("Value {0} for Attribute {1} does not exist in the list of valid Item Attribute Values for Item {2}").format(
attribute_value, attribute, item), InvalidItemAttributeValueError, title=_('Invalid Attribute'))

View File

@ -72,6 +72,38 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"description": "Rename Attribute Value in Item Attribute.",
"fieldname": "allow_rename_attribute_value",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow Rename Attribute Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@ -144,7 +176,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2017-11-14 15:54:12.190518",
"modified": "2018-02-19 11:39:54.401128",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Variant Settings",