Multiple Fixes

This commit is contained in:
Neil Trini Lasrado 2015-08-10 15:51:13 +05:30
parent cdc060cb7c
commit 62dba50e9b
35 changed files with 2425 additions and 1078 deletions

View File

@ -1,4 +1,3 @@
- Item variants is now manageable via dedicated tool **Manage Variants**. To learn about it, check [Manual Page for Item variants](https://manual.erpnext.com/contents/stock/item/item-variants)
- Against account in General Ledger will show Party instead of Account (which is not useful) - Against account in General Ledger will show Party instead of Account (which is not useful)
- Print format for recurring documents can be set by the users - Print format for recurring documents can be set by the users
- Recurring documents won't be created for Stopped Sales / Purchase Orders. - Recurring documents won't be created for Stopped Sales / Purchase Orders.

View File

@ -1,3 +1,2 @@
- Hide zero balance rows in batch-wise balance history report - Hide zero balance rows in batch-wise balance history report
- Autocomplete issue fixed in Manage Variants
- Remove user permission (Employee role) if user id is unset from Employee record - Remove user permission (Employee role) if user id is unset from Employee record

View File

@ -82,12 +82,7 @@ def get_data():
"type": "doctype", "type": "doctype",
"name": "Stock UOM Replace Utility", "name": "Stock UOM Replace Utility",
"description": _("Change UOM for an Item."), "description": _("Change UOM for an Item."),
}, }
{
"type": "doctype",
"name": "Manage Variants",
"description": _("Manage Item Variants."),
},
] ]
}, },
{ {

View File

@ -3,50 +3,112 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 0, "allow_rename": 0,
"creation": "2013-01-22 15:11:38", "creation": "2013-01-22 15:11:38",
"custom": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"description": "Item to be manufactured or repacked", "description": "Item to be manufactured or repacked",
"fieldname": "item", "fieldname": "item",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Item", "label": "Item",
"no_copy": 0,
"oldfieldname": "item", "oldfieldname": "item",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "item_name", "fieldname": "item_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Name", "label": "Item Name",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "rm_cost_as_per", "fieldname": "rm_cost_as_per",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Rate Of Materials Based On", "label": "Rate Of Materials Based On",
"no_copy": 0,
"options": "Valuation Rate\nLast Purchase Rate\nPrice List", "options": "Valuation Rate\nLast Purchase Rate\nPrice List",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "eval:doc.rm_cost_as_per===\"Price List\"", "depends_on": "eval:doc.rm_cost_as_per===\"Price List\"",
"fieldname": "buying_price_list", "fieldname": "buying_price_list",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Price List", "label": "Price List",
"no_copy": 0,
"options": "Price List", "options": "Price List",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "cb0", "fieldname": "cb0",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
@ -54,213 +116,517 @@
"fieldname": "is_active", "fieldname": "is_active",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Is Active", "label": "Is Active",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "is_active", "oldfieldname": "is_active",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"permlevel": 0, "permlevel": 0,
"reqd": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"default": "1", "default": "1",
"fieldname": "is_default", "fieldname": "is_default",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Is Default", "label": "Is Default",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "is_default", "oldfieldname": "is_default",
"oldfieldtype": "Check", "oldfieldtype": "Check",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "Manage cost of operations", "description": "Manage cost of operations",
"fieldname": "with_operations", "fieldname": "with_operations",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "With Operations", "label": "With Operations",
"permlevel": 0 "no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"description": "Specify the operations, operating cost and give a unique Operation no to your operations.", "description": "Specify the operations, operating cost and give a unique Operation no to your operations.",
"fieldname": "operations_section", "fieldname": "operations_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Operations", "hidden": 0,
"oldfieldtype": "Section Break", "ignore_user_permissions": 0,
"permlevel": 0 "in_filter": 0,
},
{
"fieldname": "operations",
"fieldtype": "Table",
"in_list_view": 0, "in_list_view": 0,
"label": "Operations", "label": "Operations",
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "operations",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Operations",
"no_copy": 0,
"oldfieldname": "bom_operations", "oldfieldname": "bom_operations",
"oldfieldtype": "Table", "oldfieldtype": "Table",
"options": "BOM Operation", "options": "BOM Operation",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "materials_section", "fieldname": "materials_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Materials", "label": "Materials",
"no_copy": 0,
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "items", "fieldname": "items",
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items", "label": "Items",
"no_copy": 0,
"oldfieldname": "bom_materials", "oldfieldname": "bom_materials",
"oldfieldtype": "Table", "oldfieldtype": "Table",
"options": "BOM Item", "options": "BOM Item",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "1", "default": "1",
"description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials", "description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials",
"fieldname": "quantity", "fieldname": "quantity",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Quantity", "label": "Quantity",
"no_copy": 0,
"oldfieldname": "quantity", "oldfieldname": "quantity",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "costing", "fieldname": "costing",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Costing", "label": "Costing",
"no_copy": 0,
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "operating_cost", "fieldname": "operating_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Operating Cost", "label": "Operating Cost",
"no_copy": 0,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "raw_material_cost", "fieldname": "raw_material_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Raw Material Cost", "label": "Raw Material Cost",
"no_copy": 0,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "cb1", "fieldname": "cb1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "total_cost", "fieldname": "total_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Total Cost", "label": "Total Cost",
"no_copy": 0,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "more_info_section", "fieldname": "more_info_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "", "label": "",
"permlevel": 0 "no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "project_name", "fieldname": "project_name",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0,
"label": "Project Name", "label": "Project Name",
"no_copy": 0,
"oldfieldname": "project_name", "oldfieldname": "project_name",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Project", "options": "Project",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company", "label": "Company",
"no_copy": 0,
"options": "Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"options": "BOM", "options": "BOM",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "col_break23", "fieldname": "col_break23",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "uom", "fieldname": "uom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item UOM", "label": "Item UOM",
"no_copy": 0,
"options": "UOM", "options": "UOM",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break_25", "fieldname": "section_break_25",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Item Desription", "label": "Item Desription",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_27", "fieldname": "column_break_27",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "image", "fieldname": "image",
"fieldtype": "Attach", "fieldtype": "Attach",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image", "label": "Image",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"fieldname": "Image_view", "allow_on_submit": 0,
"fieldname": "image_view",
"fieldtype": "Image", "fieldtype": "Image",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image View", "label": "Image View",
"no_copy": 0,
"options": "image", "options": "image",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
"fieldname": "section_break0", "fieldname": "section_break0",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Materials Required (Exploded)", "label": "Materials Required (Exploded)",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "exploded_items", "fieldname": "exploded_items",
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Exploded_items", "label": "Exploded_items",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "flat_bom_details", "oldfieldname": "flat_bom_details",
@ -268,7 +634,12 @@
"options": "BOM Explosion Item", "options": "BOM Explosion Item",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0, "hide_heading": 0,
@ -276,46 +647,59 @@
"icon": "icon-sitemap", "icon": "icon-sitemap",
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"in_dialog": 0,
"is_submittable": 1, "is_submittable": 1,
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"modified": "2015-06-26 02:02:30.705279", "modified": "2015-08-12 08:52:36.656865",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM", "name": "BOM",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"apply_user_permissions": 0,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Manufacturing Manager", "role": "Manufacturing Manager",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 1, "submit": 1,
"write": 1 "write": 1
}, },
{ {
"amend": 0,
"apply_user_permissions": 1, "apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Manufacturing User", "role": "Manufacturing User",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 1, "submit": 1,
"write": 1 "write": 1
} }
], ],
"read_only": 0, "read_only": 0,
"read_only_onload": 0,
"search_fields": "item", "search_fields": "item",
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC" "sort_order": "DESC"

View File

@ -1,150 +1,336 @@
{ {
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "hash", "autoname": "hash",
"creation": "2013-03-07 11:42:57", "creation": "2013-03-07 11:42:57",
"custom": 0,
"default_print_format": "Standard", "default_print_format": "Standard",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Item Code", "label": "Item Code",
"no_copy": 0,
"oldfieldname": "item_code", "oldfieldname": "item_code",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "cb", "fieldname": "cb",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0, "hidden": 0,
"precision": "" "ignore_user_permissions": 0,
}, "in_filter": 0,
{ "in_list_view": 0,
"fieldname": "item_name", "no_copy": 0,
"fieldtype": "Data",
"in_list_view": 1,
"label": "Item Name",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "item_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Name",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "section_break_3", "fieldname": "section_break_3",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text", "fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Description", "label": "Description",
"no_copy": 0,
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Text", "oldfieldtype": "Text",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"print_width": "300px", "print_width": "300px",
"read_only": 1, "read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "300px" "width": "300px"
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_2", "fieldname": "column_break_2",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "image", "fieldname": "image",
"fieldtype": "Attach", "fieldtype": "Attach",
"hidden": 1, "hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image", "label": "Image",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"print_hide": 1 "print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "image_view", "fieldname": "image_view",
"fieldtype": "Image", "fieldtype": "Image",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image View", "label": "Image View",
"no_copy": 0,
"options": "image", "options": "image",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break_4", "fieldname": "section_break_4",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "qty", "fieldname": "qty",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Qty", "label": "Qty",
"no_copy": 0,
"oldfieldname": "qty", "oldfieldname": "qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "rate", "fieldname": "rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Rate", "label": "Rate",
"no_copy": 0,
"oldfieldname": "standard_rate", "oldfieldname": "standard_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "qty_consumed_per_unit", "fieldname": "qty_consumed_per_unit",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Qty Consumed Per Unit", "label": "Qty Consumed Per Unit",
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_8", "fieldname": "column_break_8",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "stock_uom", "fieldname": "stock_uom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Stock UOM", "label": "Stock UOM",
"no_copy": 0,
"oldfieldname": "stock_uom", "oldfieldname": "stock_uom",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "UOM", "options": "UOM",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "amount", "fieldname": "amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Amount", "label": "Amount",
"no_copy": 0,
"oldfieldname": "amount_as_per_sr", "oldfieldname": "amount_as_per_sr",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1, "idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1, "istable": 1,
"modified": "2015-02-19 01:06:59.399382", "modified": "2015-08-12 08:52:39.190103",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM Explosion Item", "name": "BOM Explosion Item",
"owner": "Administrator", "owner": "Administrator",
"permissions": [], "permissions": [],
"read_only": 0 "read_only": 0,
"read_only_onload": 0
} }

View File

@ -1,174 +1,382 @@
{ {
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2013-02-22 01:27:49", "creation": "2013-02-22 01:27:49",
"custom": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Item Code", "label": "Item Code",
"no_copy": 0,
"oldfieldname": "item_code", "oldfieldname": "item_code",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "item_name", "fieldname": "item_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Item Name", "label": "Item Name",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_3", "fieldname": "column_break_3",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "bom_no", "fieldname": "bom_no",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0, "in_list_view": 0,
"label": "BOM No", "label": "BOM No",
"no_copy": 0,
"oldfieldname": "bom_no", "oldfieldname": "bom_no",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "BOM", "options": "BOM",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"print_width": "150px", "print_width": "150px",
"read_only": 0,
"report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 1, "search_index": 1,
"set_only_once": 0,
"unique": 0,
"width": "150px" "width": "150px"
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break_5", "fieldname": "section_break_5",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text", "fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Description", "label": "Item Description",
"no_copy": 0,
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Text", "oldfieldtype": "Text",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"print_width": "250px", "print_width": "250px",
"read_only": 0,
"report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "250px" "width": "250px"
}, },
{ {
"allow_on_submit": 0,
"fieldname": "col_break1", "fieldname": "col_break1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "image", "fieldname": "image",
"fieldtype": "Attach", "fieldtype": "Attach",
"hidden": 1, "hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image", "label": "Image",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"print_hide": 1 "print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "image_view", "fieldname": "image_view",
"fieldtype": "Image", "fieldtype": "Image",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image View", "label": "Image View",
"no_copy": 0,
"options": "image", "options": "image",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "quantity_and_rate", "fieldname": "quantity_and_rate",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Quantity and Rate", "label": "Quantity and Rate",
"permlevel": 0 "no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "qty", "fieldname": "qty",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Qty", "label": "Qty",
"no_copy": 0,
"oldfieldname": "qty", "oldfieldname": "qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "See \"Rate Of Materials Based On\" in Costing Section", "description": "See \"Rate Of Materials Based On\" in Costing Section",
"fieldname": "rate", "fieldname": "rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Rate", "label": "Rate",
"no_copy": 0,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "col_break2", "fieldname": "col_break2",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "stock_uom", "fieldname": "stock_uom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Stock UOM", "label": "Stock UOM",
"no_copy": 0,
"oldfieldname": "stock_uom", "oldfieldname": "stock_uom",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "UOM", "options": "UOM",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 1, "read_only": 1,
"reqd": 1 "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "amount", "fieldname": "amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Amount", "label": "Amount",
"no_copy": 0,
"oldfieldname": "amount_as_per_mar", "oldfieldname": "amount_as_per_mar",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"print_width": "150px", "print_width": "150px",
"read_only": 1, "read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "150px" "width": "150px"
}, },
{ {
"allow_on_submit": 0,
"fieldname": "scrap", "fieldname": "scrap",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Scrap %", "label": "Scrap %",
"no_copy": 0,
"oldfieldname": "scrap", "oldfieldname": "scrap",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"print_hide": 1 "print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "qty_consumed_per_unit", "fieldname": "qty_consumed_per_unit",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 1, "hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Qty Consumed Per Unit", "label": "Qty Consumed Per Unit",
"no_copy": 0,
"oldfieldname": "qty_consumed_per_unit", "oldfieldname": "qty_consumed_per_unit",
"oldfieldtype": "Float", "oldfieldtype": "Float",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1, "idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1, "istable": 1,
"modified": "2015-02-12 15:17:18.324810", "modified": "2015-08-12 08:52:41.512788",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM Item", "name": "BOM Item",
"owner": "Administrator", "owner": "Administrator",
"permissions": [], "permissions": [],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC" "sort_order": "DESC"
} }

View File

@ -1,86 +1,175 @@
{ {
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2013-02-22 01:27:49", "creation": "2013-02-22 01:27:49",
"custom": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"fieldname": "operation", "fieldname": "operation",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Operation", "label": "Operation",
"no_copy": 0,
"oldfieldname": "operation_no", "oldfieldname": "operation_no",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "Operation", "options": "Operation",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "workstation", "fieldname": "workstation",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Workstation", "label": "Workstation",
"no_copy": 0,
"oldfieldname": "workstation", "oldfieldname": "workstation",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Workstation", "options": "Workstation",
"permlevel": 0, "permlevel": 0,
"reqd": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text", "fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Operation Description", "label": "Operation Description",
"no_copy": 0,
"oldfieldname": "opn_description", "oldfieldname": "opn_description",
"oldfieldtype": "Text", "oldfieldtype": "Text",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "col_break1", "fieldname": "col_break1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "hour_rate", "fieldname": "hour_rate",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Hour Rate", "label": "Hour Rate",
"no_copy": 0,
"oldfieldname": "hour_rate", "oldfieldname": "hour_rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"reqd": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "In minutes", "description": "In minutes",
"fieldname": "time_in_mins", "fieldname": "time_in_mins",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Operation Time ", "label": "Operation Time ",
"no_copy": 0,
"oldfieldname": "time_in_mins", "oldfieldname": "time_in_mins",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "", "options": "",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"fieldname": "operating_cost", "fieldname": "operating_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Operating Cost", "label": "Operating Cost",
"no_copy": 0,
"oldfieldname": "operating_cost", "oldfieldname": "operating_cost",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 1, "read_only": 1,
"reqd": 0 "report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1, "idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1, "istable": 1,
"modified": "2015-04-22 03:24:47.809532", "modified": "2015-08-12 08:52:43.922881",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM Operation", "name": "BOM Operation",
"owner": "Administrator", "owner": "Administrator",
"permissions": [] "permissions": [],
"read_only": 0,
"read_only_onload": 0
} }

View File

@ -1,40 +1,77 @@
{ {
"allow_copy": 1, "allow_copy": 1,
"allow_email": 1, "allow_email": 1,
"allow_import": 0,
"allow_print": 1, "allow_print": 1,
"allow_rename": 0,
"creation": "2012-12-06 12:10:10", "creation": "2012-12-06 12:10:10",
"custom": 0,
"description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM", "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Other", "document_type": "Other",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"description": "The BOM which will be replaced", "description": "The BOM which will be replaced",
"fieldname": "current_bom", "fieldname": "current_bom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Current BOM", "label": "Current BOM",
"no_copy": 0,
"options": "BOM", "options": "BOM",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "The new BOM after replacement", "description": "The new BOM after replacement",
"fieldname": "new_bom", "fieldname": "new_bom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "New BOM", "label": "New BOM",
"no_copy": 0,
"options": "BOM", "options": "BOM",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "replace", "fieldname": "replace",
"fieldtype": "Button", "fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Replace", "label": "Replace",
"no_copy": 0,
"options": "replace_bom", "options": "replace_bom",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 1, "hide_heading": 1,
@ -42,23 +79,37 @@
"icon": "icon-magic", "icon": "icon-magic",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1, "issingle": 1,
"modified": "2015-02-05 05:11:35.233845", "istable": 0,
"modified": "2015-08-12 08:52:46.035343",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM Replace Tool", "name": "BOM Replace Tool",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 0,
"read": 1, "read": 1,
"report": 0, "report": 0,
"role": "Manufacturing Manager", "role": "Manufacturing Manager",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0, "submit": 0,
"write": 1 "write": 1
} }
], ],
"read_only": 1 "read_only": 1,
"read_only_onload": 0
} }

View File

@ -1,31 +1,62 @@
{ {
"allow_copy": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-01-10 16:34:16", "creation": "2013-01-10 16:34:16",
"custom": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"fieldname": "item", "fieldname": "item",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "", "label": "",
"no_copy": 0,
"options": "icon-gift", "options": "icon-gift",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "PRO-", "default": "PRO-",
"fieldname": "naming_series", "fieldname": "naming_series",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series", "label": "Series",
"no_copy": 0,
"options": "PRO-", "options": "PRO-",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "Draft", "default": "Draft",
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
"fieldname": "status", "fieldname": "status",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0, "in_list_view": 0,
"label": "Status", "label": "Status",
@ -34,333 +65,739 @@
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "\nDraft\nSubmitted\nStopped\nIn Process\nCompleted\nCancelled", "options": "\nDraft\nSubmitted\nStopped\nIn Process\nCompleted\nCancelled",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 1, "read_only": 1,
"report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "production_item", "fieldname": "production_item",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Item To Manufacture", "label": "Item To Manufacture",
"no_copy": 0,
"oldfieldname": "production_item", "oldfieldname": "production_item",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Item", "options": "Item",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"description": "", "description": "",
"fieldname": "bom_no", "fieldname": "bom_no",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "BOM No", "label": "BOM No",
"no_copy": 0,
"oldfieldname": "bom_no", "oldfieldname": "bom_no",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "BOM", "options": "BOM",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "1", "default": "1",
"description": "Plan material for sub-assemblies", "description": "Plan material for sub-assemblies",
"fieldname": "use_multi_level_bom", "fieldname": "use_multi_level_bom",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Use Multi-Level BOM", "label": "Use Multi-Level BOM",
"permlevel": 0 "no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break1", "fieldname": "column_break1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"oldfieldtype": "Column Break", "oldfieldtype": "Column Break",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "50%" "width": "50%"
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"fieldname": "qty", "fieldname": "qty",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Qty To Manufacture", "label": "Qty To Manufacture",
"no_copy": 0,
"oldfieldname": "qty", "oldfieldname": "qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "0", "default": "0",
"depends_on": "eval:doc.docstatus==1", "depends_on": "eval:doc.docstatus==1",
"description": "", "description": "",
"fieldname": "material_transferred_for_manufacturing", "fieldname": "material_transferred_for_manufacturing",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Material Transferred for Manufacturing", "label": "Material Transferred for Manufacturing",
"no_copy": 1, "no_copy": 1,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "0", "default": "0",
"depends_on": "eval:doc.docstatus==1", "depends_on": "eval:doc.docstatus==1",
"description": "", "description": "",
"fieldname": "produced_qty", "fieldname": "produced_qty",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Manufactured Qty", "label": "Manufactured Qty",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "produced_qty", "oldfieldname": "produced_qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "warehouses", "fieldname": "warehouses",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouses", "label": "Warehouses",
"no_copy": 0,
"options": "icon-building", "options": "icon-building",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "wip_warehouse", "fieldname": "wip_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Work-in-Progress Warehouse", "label": "Work-in-Progress Warehouse",
"no_copy": 0,
"options": "Warehouse", "options": "Warehouse",
"permlevel": 0, "permlevel": 0,
"reqd": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_12", "fieldname": "column_break_12",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"description": "", "description": "",
"fieldname": "fg_warehouse", "fieldname": "fg_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Target Warehouse", "label": "Target Warehouse",
"no_copy": 0,
"options": "Warehouse", "options": "Warehouse",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"reqd": 0 "report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "time", "fieldname": "time",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Time", "label": "Time",
"no_copy": 0,
"options": "icon-time", "options": "icon-time",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"fieldname": "expected_delivery_date", "fieldname": "expected_delivery_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Expected Delivery Date", "label": "Expected Delivery Date",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"read_only": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "now", "default": "now",
"fieldname": "planned_start_date", "fieldname": "planned_start_date",
"fieldtype": "Datetime", "fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Planned Start Date", "label": "Planned Start Date",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "planned_end_date", "fieldname": "planned_end_date",
"fieldtype": "Datetime", "fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Planned End Date", "label": "Planned End Date",
"no_copy": 1, "no_copy": 1,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_13", "fieldname": "column_break_13",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "actual_start_date", "fieldname": "actual_start_date",
"fieldtype": "Datetime", "fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual Start Date", "label": "Actual Start Date",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "actual_end_date", "fieldname": "actual_end_date",
"fieldtype": "Datetime", "fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual End Date", "label": "Actual End Date",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"fieldname": "operations_section", "fieldname": "operations_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Operations", "label": "Operations",
"no_copy": 0,
"options": "icon-wrench", "options": "icon-wrench",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"fieldname": "operations", "fieldname": "operations",
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Operations", "label": "Operations",
"no_copy": 0,
"options": "Production Order Operation", "options": "Production Order Operation",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "operations", "depends_on": "operations",
"fieldname": "section_break_22", "fieldname": "section_break_22",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Operation Cost", "label": "Operation Cost",
"no_copy": 0,
"options": "", "options": "",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "planned_operating_cost", "fieldname": "planned_operating_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Planned Operating Cost", "label": "Planned Operating Cost",
"no_copy": 0, "no_copy": 0,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "actual_operating_cost", "fieldname": "actual_operating_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual Operating Cost", "label": "Actual Operating Cost",
"no_copy": 1, "no_copy": 1,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "additional_operating_cost", "fieldname": "additional_operating_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Additional Operating Cost", "label": "Additional Operating Cost",
"no_copy": 1, "no_copy": 1,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_24", "fieldname": "column_break_24",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "total_operating_cost", "fieldname": "total_operating_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Operating Cost", "label": "Total Operating Cost",
"no_copy": 1, "no_copy": 1,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "more_info", "fieldname": "more_info",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Info", "label": "More Info",
"no_copy": 0,
"options": "icon-file-text", "options": "icon-file-text",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Description", "label": "Item Description",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "", "depends_on": "",
"fieldname": "stock_uom", "fieldname": "stock_uom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Stock UOM", "label": "Stock UOM",
"no_copy": 0,
"oldfieldname": "stock_uom", "oldfieldname": "stock_uom",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "UOM", "options": "UOM",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break2", "fieldname": "column_break2",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "50%" "width": "50%"
}, },
{ {
"allow_on_submit": 0,
"fieldname": "project_name", "fieldname": "project_name",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0,
"label": "Project Name", "label": "Project Name",
"no_copy": 0,
"oldfieldname": "project_name", "oldfieldname": "project_name",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Project", "options": "Project",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "Manufacture against Sales Order", "description": "Manufacture against Sales Order",
"fieldname": "sales_order", "fieldname": "sales_order",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Order", "label": "Sales Order",
"no_copy": 0,
"options": "Sales Order", "options": "Sales Order",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company", "label": "Company",
"no_copy": 0,
"oldfieldname": "company", "oldfieldname": "company",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "Production Order", "options": "Production Order",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-cogs", "icon": "icon-cogs",
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"in_dialog": 0,
"is_submittable": 1, "is_submittable": 1,
"modified": "2015-07-21 07:45:53.206902", "issingle": 0,
"istable": 0,
"modified": "2015-08-12 08:50:32.803526",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Production Order", "name": "Production Order",
@ -373,22 +810,41 @@
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Manufacturing User", "role": "Manufacturing User",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 1, "submit": 1,
"write": 1 "write": 1
}, },
{ {
"amend": 0,
"apply_user_permissions": 1, "apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 0,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Stock User" "role": "Stock User",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
} }
], ],
"read_only": 0,
"read_only_onload": 0,
"title_field": "production_item" "title_field": "production_item"
} }

View File

@ -172,7 +172,6 @@ execute:frappe.delete_doc("Page", "users")
erpnext.patches.v5_0.update_material_transferred_for_manufacturing_again erpnext.patches.v5_0.update_material_transferred_for_manufacturing_again
erpnext.patches.v5_0.index_on_account_and_gl_entry erpnext.patches.v5_0.index_on_account_and_gl_entry
execute:frappe.db.sql("""delete from `tabProject Task`""") execute:frappe.db.sql("""delete from `tabProject Task`""")
erpnext.patches.v5_0.item_variants
erpnext.patches.v5_0.update_item_desc_in_invoice erpnext.patches.v5_0.update_item_desc_in_invoice
erpnext.patches.v5_1.fix_against_account erpnext.patches.v5_1.fix_against_account
erpnext.patches.v5_1.fix_credit_days_based_on erpnext.patches.v5_1.fix_credit_days_based_on

View File

@ -1,19 +0,0 @@
import frappe
def execute():
frappe.reload_doctype("Item")
for dt in ["manage_variants", "manage_variants_item", "variant_attribute"]:
frappe.reload_doc("stock", "doctype", dt)
for d in frappe.get_list("Item", filters={"has_variants":1}):
manage_variant = frappe.new_doc("Manage Variants")
manage_variant.item_code = d.name
manage_variant.attributes = frappe.db.sql("select item_attribute as attribute, item_attribute_value as attribute_value \
from `tabItem Variant` where parent = %s", d.name, as_dict=1)
if manage_variant.attributes:
if not frappe.get_list("Item", filters={"variant_of": d.name}, limit_page_length=1):
frappe.db.sql("delete from `tabItem Variant` where parent=%s", d.name)
else:
manage_variant.generate_combinations()
manage_variant.create_variants()
frappe.delete_doc("DocType", "Item Variant")

View File

@ -12,5 +12,8 @@ def execute():
for item, attributes in item_attribute.items(): for item, attributes in item_attribute.items():
template = frappe.get_doc("Item", item) template = frappe.get_doc("Item", item)
template.set('valid_attributes', attributes) template.set('attributes', attributes)
template.save() template.save()
frappe.delete_doc("DocType", "Manage Variants")
frappe.delete_doc("DocType", "Manage Variants Item")

View File

@ -1,68 +1,129 @@
{ {
"allow_copy": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:project_name", "autoname": "field:project_name",
"creation": "2013-03-07 11:55:07", "creation": "2013-03-07 11:55:07",
"custom": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"description": "", "description": "",
"fieldname": "project_name", "fieldname": "project_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Project Name", "label": "Project Name",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "project_name", "oldfieldname": "project_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"default": "Open", "default": "Open",
"fieldname": "status", "fieldname": "status",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0,
"label": "Status", "label": "Status",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "status", "oldfieldname": "status",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "Open\nCompleted\nCancelled", "options": "Open\nCompleted\nCancelled",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "project_type", "fieldname": "project_type",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Project Type", "label": "Project Type",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "project_type", "oldfieldname": "project_type",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "Internal\nExternal\nOther", "options": "Internal\nExternal\nOther",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_5", "fieldname": "column_break_5",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "is_active", "fieldname": "is_active",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Active", "label": "Is Active",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "is_active", "oldfieldname": "is_active",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "Yes\nNo", "options": "Yes\nNo",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "priority", "fieldname": "priority",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Priority", "label": "Priority",
"no_copy": 0, "no_copy": 0,
@ -70,53 +131,123 @@
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "Medium\nLow\nHigh", "options": "Medium\nLow\nHigh",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break_12", "fieldname": "section_break_12",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "expected_start_date", "fieldname": "expected_start_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0,
"label": "Expected Start Date", "label": "Expected Start Date",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "project_start_date", "oldfieldname": "project_start_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_11", "fieldname": "column_break_11",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "expected_end_date", "fieldname": "expected_end_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Expected End Date", "label": "Expected End Date",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "completion_date", "oldfieldname": "completion_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "customer_details", "fieldname": "customer_details",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "", "label": "",
"no_copy": 0,
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"options": "icon-user", "options": "icon-user",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "customer", "fieldname": "customer",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0,
"label": "Customer", "label": "Customer",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "customer", "oldfieldname": "customer",
@ -124,115 +255,281 @@
"options": "Customer", "options": "Customer",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 1 "search_index": 1,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_14", "fieldname": "column_break_14",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "sales_order", "fieldname": "sales_order",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Order", "label": "Sales Order",
"no_copy": 0,
"options": "Sales Order", "options": "Sales Order",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "sb_milestones", "fieldname": "sb_milestones",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Tasks", "label": "Tasks",
"no_copy": 0,
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"options": "icon-flag", "options": "icon-flag",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "tasks", "fieldname": "tasks",
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Tasks", "label": "Tasks",
"no_copy": 0,
"options": "Project Task", "options": "Project Task",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"reqd": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "percent_complete", "fieldname": "percent_complete",
"fieldtype": "Percent", "fieldtype": "Percent",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "% Tasks Completed", "label": "% Tasks Completed",
"no_copy": 1, "no_copy": 1,
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break0", "fieldname": "section_break0",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "", "label": "",
"no_copy": 0,
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"options": "icon-list", "options": "icon-list",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "notes", "fieldname": "notes",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Notes", "label": "Notes",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "notes", "oldfieldname": "notes",
"oldfieldtype": "Text Editor", "oldfieldtype": "Text Editor",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break_18", "fieldname": "section_break_18",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "actual_start_date", "fieldname": "actual_start_date",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual Start Date", "label": "Actual Start Date",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "actual_time", "fieldname": "actual_time",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual Time (in Hours)", "label": "Actual Time (in Hours)",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_20", "fieldname": "column_break_20",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "actual_end_date", "fieldname": "actual_end_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual End Date", "label": "Actual End Date",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "act_completion_date", "oldfieldname": "act_completion_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 1, "read_only": 1,
"search_index": 0 "report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break_26", "fieldname": "section_break_26",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "estimated_costing", "fieldname": "estimated_costing",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Estimated Costing", "label": "Estimated Costing",
"no_copy": 0, "no_copy": 0,
@ -240,124 +537,292 @@
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0 "search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_22", "fieldname": "column_break_22",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company", "label": "Company",
"no_copy": 0,
"options": "Company", "options": "Company",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "cost_center", "fieldname": "cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Default Cost Center", "label": "Default Cost Center",
"no_copy": 0,
"options": "Cost Center", "options": "Cost Center",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "project_details", "fieldname": "project_details",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "", "label": "",
"no_copy": 0,
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"options": "icon-money", "options": "icon-money",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "", "description": "",
"fieldname": "total_costing_amount", "fieldname": "total_costing_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Costing Amount (via Time Logs)", "label": "Total Costing Amount (via Time Logs)",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "", "description": "",
"fieldname": "total_expense_claim", "fieldname": "total_expense_claim",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Expense Claim (via Expense Claims)", "label": "Total Expense Claim (via Expense Claims)",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_28", "fieldname": "column_break_28",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"description": "", "description": "",
"fieldname": "total_billing_amount", "fieldname": "total_billing_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Billing Amount (via Time Logs)", "label": "Total Billing Amount (via Time Logs)",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "total_purchase_cost", "fieldname": "total_purchase_cost",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Purchase Cost (via Purchase Invoice)", "label": "Total Purchase Cost (via Purchase Invoice)",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "margin", "fieldname": "margin",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "", "label": "",
"no_copy": 0,
"oldfieldtype": "Column Break", "oldfieldtype": "Column Break",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "50%" "width": "50%"
}, },
{ {
"allow_on_submit": 0,
"fieldname": "gross_margin", "fieldname": "gross_margin",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Gross Margin", "label": "Gross Margin",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "gross_margin_value", "oldfieldname": "gross_margin_value",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 1, "read_only": 1,
"report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0 "search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_37", "fieldname": "column_break_37",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "per_gross_margin", "fieldname": "per_gross_margin",
"fieldtype": "Percent", "fieldtype": "Percent",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Gross Margin %", "label": "Gross Margin %",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "per_gross_margin", "oldfieldname": "per_gross_margin",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "", "options": "",
"permlevel": 0, "permlevel": 0,
"print_hide": 0,
"read_only": 1, "read_only": 1,
"report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0 "search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-puzzle-piece", "icon": "icon-puzzle-piece",
"idx": 1, "idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 4, "max_attachments": 4,
"modified": "2015-06-12 09:00:54.080220", "modified": "2015-08-12 08:51:43.620261",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Projects", "module": "Projects",
"name": "Project", "name": "Project",
@ -366,29 +831,45 @@
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1, "apply_user_permissions": 1,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Projects User", "role": "Projects User",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0, "submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 0,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 1, "permlevel": 1,
"print": 0,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "All", "role": "All",
"submit": 0 "set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
} }
], ],
"read_only": 0,
"read_only_onload": 0,
"search_fields": "customer, status, priority, is_active" "search_fields": "customer, status, priority, is_active"
} }

View File

@ -25,7 +25,8 @@
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
"set_only_once": 0 "set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
@ -46,21 +47,48 @@
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
"set_only_once": 0 "set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"depends_on": "task_id", "depends_on": "task_id",
"fieldname": "edit_task", "fieldname": "edit_task",
"fieldtype": "Button", "fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "View Task", "label": "View Task",
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "column_break_3", "fieldname": "column_break_3",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
@ -79,7 +107,8 @@
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0 "set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
@ -99,13 +128,27 @@
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0 "set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "section_break_6", "fieldname": "section_break_6",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
@ -124,17 +167,29 @@
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0 "set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "task_id", "fieldname": "task_id",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Task ID", "label": "Task ID",
"no_copy": 1, "no_copy": 1,
"options": "Task", "options": "Task",
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0, "hide_heading": 0,
@ -144,7 +199,7 @@
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"modified": "2015-04-23 05:48:00.504508", "modified": "2015-08-12 08:51:46.609018",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Projects", "module": "Projects",
"name": "Project Task", "name": "Project Task",

View File

@ -6,6 +6,10 @@ frappe.provide("erpnext.item");
frappe.ui.form.on("Item", { frappe.ui.form.on("Item", {
onload: function(frm) { onload: function(frm) {
erpnext.item.setup_queries(frm); erpnext.item.setup_queries(frm);
if (frm.doc.variant_of){
frm.fields_dict["attributes"].grid.set_column_disp("attribute_value", true);
}
}, },
refresh: function(frm) { refresh: function(frm) {
@ -31,8 +35,8 @@ frappe.ui.form.on("Item", {
frappe.set_route("List", "Item", {"variant_of": frm.doc.name}); frappe.set_route("List", "Item", {"variant_of": frm.doc.name});
}, "icon-list", "btn-default"); }, "icon-list", "btn-default");
frm.add_custom_button(__("Search Variant"), function() { frm.add_custom_button(__("Make Variant"), function() {
erpnext.item.search_variant() erpnext.item.make_variant()
}, "icon-list", "btn-default"); }, "icon-list", "btn-default");
} }
if (frm.doc.variant_of) { if (frm.doc.variant_of) {
@ -53,6 +57,8 @@ frappe.ui.form.on("Item", {
} }
erpnext.item.toggle_reqd(frm); erpnext.item.toggle_reqd(frm);
erpnext.item.toggle_attributes(frm);
}, },
validate: function(frm){ validate: function(frm){
@ -86,6 +92,10 @@ frappe.ui.form.on("Item", {
is_stock_item: function(frm) { is_stock_item: function(frm) {
erpnext.item.toggle_reqd(frm); erpnext.item.toggle_reqd(frm);
},
has_variants: function(frm) {
erpnext.item.toggle_attributes(frm);
} }
}); });
@ -184,12 +194,12 @@ $.extend(erpnext.item, {
} }
}, },
search_variant: function(doc) { make_variant: function(doc) {
var fields = [] var fields = []
for(var i=0;i< cur_frm.doc.valid_attributes.length;i++){ for(var i=0;i< cur_frm.doc.attributes.length;i++){
var fieldtype, desc; var fieldtype, desc;
var row = cur_frm.doc.valid_attributes[i]; var row = cur_frm.doc.attributes[i];
if (row.numeric_values){ if (row.numeric_values){
fieldtype = "Float"; fieldtype = "Float";
desc = "Min Value: "+ row.from_range +" , Max Value: "+ row.to_range +", in Increments of: "+ row.increment desc = "Min Value: "+ row.from_range +" , Max Value: "+ row.to_range +", in Increments of: "+ row.increment
@ -206,18 +216,13 @@ $.extend(erpnext.item, {
"description": desc "description": desc
}) })
} }
fields = fields.concat({
"label": "Result",
"fieldname": "result",
"fieldtype": "HTML"
})
var d = new frappe.ui.Dialog({ var d = new frappe.ui.Dialog({
title: __("Search Variant"), title: __("Make Variant"),
fields: fields fields: fields
}); });
d.set_primary_action(__("Search"), function() { d.set_primary_action(__("Make"), function() {
args = d.get_values(); args = d.get_values();
if(!args) return; if(!args) return;
frappe.call({ frappe.call({
@ -227,28 +232,32 @@ $.extend(erpnext.item, {
"args": d.get_values() "args": d.get_values()
}, },
callback: function(r) { callback: function(r) {
// returns variant item
if (r.message) { if (r.message) {
d.get_field("result").set_value($('<a class="btn btn-default btn-sm">'+__("View {0}", [r.message[0]])+'</a>') var variant = r.message[0];
.on("click", function() { var msgprint_dialog = frappe.msgprint(__("Item Variant {0} already exists with same attributes",
d.hide(); [repl('<a href="#Form/Item/%(item_encoded)s" class="strong variant-click">%(item)s</a>', {
frappe.set_route("Form", "Item", r.message[0]); item_encoded: encodeURIComponent(variant),
})); item: variant
})]
));
msgprint_dialog.hide_on_page_refresh = true;
msgprint_dialog.$wrapper.find(".variant-click").on("click", function() {
d.hide();
});
} else { } else {
d.get_field("result").set_value($('<a class="btn btn-default btn-sm">' d.hide();
+__("Variant Not Found - Create New"+'</a>')).on("click", function() { frappe.call({
d.hide(); method:"erpnext.stock.doctype.item.item.create_variant",
frappe.call({ args: {
method:"erpnext.stock.doctype.item.item.create_variant", "item": cur_frm.doc.name,
args: { "param": d.get_values()
"item": cur_frm.doc.name, },
"param": d.get_values() callback: function(r) {
}, var doclist = frappe.model.sync(r.message);
callback: function(r) { frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
var doclist = frappe.model.sync(r.message); }
frappe.set_route("Form", doclist[0].doctype, doclist[0].name); });
}
});
}));
} }
} }
}); });
@ -280,7 +289,6 @@ $.extend(erpnext.item, {
fields: ["attribute_value"] fields: ["attribute_value"]
}, },
callback: function(r) { callback: function(r) {
d.get_field("result").set_value("")
if (r.message) { if (r.message) {
response($.map(r.message, function(d) { return d.attribute_value; })); response($.map(r.message, function(d) { return d.attribute_value; }));
} }
@ -299,6 +307,10 @@ $.extend(erpnext.item, {
}, 500); }, 500);
}); });
}); });
},
toggle_attributes: function(frm) {
frm.toggle_display("attributes", frm.doc.has_variants || frm.doc.variant_of);
frm.fields_dict.attributes.grid.toggle_reqd("attribute_value", frm.doc.variant_of ? 1 : 0);
} }
}); });

View File

@ -819,32 +819,10 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"depends_on": "has_variants", "depends_on": "",
"fieldname": "valid_attributes",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid Attributes",
"no_copy": 0,
"options": "Item Template Attribute",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "variant_of",
"fieldname": "attributes", "fieldname": "attributes",
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0, "hidden": 1,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
@ -854,7 +832,7 @@
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"print_hide": 0, "print_hide": 0,
"read_only": 1, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
@ -1951,7 +1929,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 1, "max_attachments": 1,
"modified": "2015-08-04 07:04:46.573200", "modified": "2015-08-12 10:28:54.242793",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Item", "name": "Item",

View File

@ -10,7 +10,6 @@ from frappe.website.website_generator import WebsiteGenerator
from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for, get_parent_item_groups from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for, get_parent_item_groups
from frappe.website.render import clear_cache from frappe.website.render import clear_cache
from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow
from erpnext.stock.doctype.manage_variants.manage_variants import update_variant
class WarehouseNotSet(frappe.ValidationError): pass class WarehouseNotSet(frappe.ValidationError): pass
class ItemTemplateCannotHaveStock(frappe.ValidationError): pass class ItemTemplateCannotHaveStock(frappe.ValidationError): pass
@ -301,7 +300,9 @@ class Item(WebsiteGenerator):
updated = [] updated = []
variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name }) variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name })
for d in variants: for d in variants:
update_variant(self.name, d) variant = frappe.get_doc("Item", d)
copy_attributes_to_variant(self, variant)
variant.save()
updated.append(d.item_code) updated.append(d.item_code)
if updated: if updated:
frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated))) frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
@ -333,7 +334,9 @@ class Item(WebsiteGenerator):
def validate_template_attributes(self): def validate_template_attributes(self):
if self.has_variants: if self.has_variants:
attributes = [] attributes = []
for d in self.valid_attributes: if not self.attributes:
frappe.throw(_("Attribute is mandatory for Item Template"))
for d in self.attributes:
if d.attribute in attributes: if d.attribute in attributes:
frappe.throw(_("Attribute {0} selected multiple times in Attributes Table".format(d.attribute))) frappe.throw(_("Attribute {0} selected multiple times in Attributes Table".format(d.attribute)))
else: else:
@ -343,6 +346,8 @@ class Item(WebsiteGenerator):
if self.variant_of: if self.variant_of:
args = {} args = {}
for d in self.attributes: for d in self.attributes:
if not d.attribute_value:
frappe.throw(_("Please specify Attribute Value for attribute {0}").format(d.attribute))
args[d.attribute] = d.attribute_value args[d.attribute] = d.attribute_value
variant = get_variant(self.variant_of, args) variant = get_variant(self.variant_of, args)
@ -495,7 +500,7 @@ def get_variant(item, args):
for d in args: for d in args:
if d in numeric_attributes: if d in numeric_attributes:
values = frappe.db.sql("""select from_range, to_range, increment from `tabItem Template Attribute` \ values = frappe.db.sql("""select from_range, to_range, increment from `tabVariant Attribute` \
where parent = %s and attribute = %s""", (item, d), as_dict=1)[0] where parent = %s and attribute = %s""", (item, d), as_dict=1)[0]
if (not values.from_range < cint(args[d]) < values.to_range) or ((cint(args[d]) - values.from_range) % values.increment != 0): if (not values.from_range < cint(args[d]) < values.to_range) or ((cint(args[d]) - values.from_range) % values.increment != 0):
@ -525,10 +530,8 @@ def get_variant(item, args):
@frappe.whitelist() @frappe.whitelist()
def create_variant(item, param): def create_variant(item, param):
from erpnext.stock.doctype.manage_variants.manage_variants import copy_attributes_to_variant
args = json.loads(param) args = json.loads(param)
variant = frappe.new_doc("Item") variant = frappe.new_doc("Item")
variant.item_code = item
variant_attributes = [] variant_attributes = []
for d in args: for d in args:
variant_attributes.append({ variant_attributes.append({
@ -538,3 +541,18 @@ def create_variant(item, param):
variant.set("attributes", variant_attributes) variant.set("attributes", variant_attributes)
copy_attributes_to_variant(item, variant) copy_attributes_to_variant(item, variant)
return variant return variant
def copy_attributes_to_variant(item, variant):
from frappe.model import no_value_fields
for field in item.meta.fields:
if field.fieldtype not in no_value_fields and (not field.no_copy)\
and field.fieldname not in ("item_code", "item_name"):
if variant.get(field.fieldname) != item.get(field.fieldname):
variant.set(field.fieldname, item.get(field.fieldname))
variant.variant_of = item.name
variant.has_variants = 0
variant.show_in_website = 0
if variant.attributes:
variant.description += "\n"
for d in variant.attributes:
variant.description += "<p>" + d.attribute + ": " + cstr(d.attribute_value) + "</p>"

View File

@ -29,48 +29,6 @@
"set_only_once": 0, "set_only_once": 0,
"unique": 0 "unique": 0
}, },
{
"allow_on_submit": 0,
"default": "1",
"depends_on": "eval: doc.numeric_values==0",
"description": "Lower the number, higher the priority in the Item Code suffix that will be created for this Item Attribute for the Item Variant",
"fieldname": "priority",
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Priority",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"default": "0", "default": "0",
@ -95,7 +53,7 @@
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"depends_on": "numeric_values", "depends_on": "numeric_values",
"fieldname": "section_break_5", "fieldname": "section_break_4",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
@ -114,6 +72,7 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"depends_on": "",
"fieldname": "from_range", "fieldname": "from_range",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
@ -134,6 +93,7 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"depends_on": "",
"fieldname": "increment", "fieldname": "increment",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
@ -173,6 +133,7 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"depends_on": "",
"fieldname": "to_range", "fieldname": "to_range",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
@ -193,8 +154,8 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"depends_on": "eval: doc.numeric_values==0", "depends_on": "eval: !doc.numeric_values",
"fieldname": "section_break_10", "fieldname": "section_break_5",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
@ -213,6 +174,7 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"depends_on": "",
"fieldname": "item_attribute_values", "fieldname": "item_attribute_values",
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0, "hidden": 0,
@ -241,7 +203,7 @@
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"modified": "2015-08-05 05:27:55.912105", "modified": "2015-08-11 08:43:10.240847",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Item Attribute", "name": "Item Attribute",

View File

@ -1,192 +0,0 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "",
"creation": "2015-07-31 02:14:41.660844",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Other",
"fields": [
{
"allow_on_submit": 0,
"fieldname": "attribute",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Attribute",
"no_copy": 0,
"options": "Item Attribute",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "numeric_values",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Numeric Values",
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "numeric_values",
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "from_range",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "From Range",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "increment",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Increment",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "to_range",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "To Range",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-05 07:50:03.836731",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Template Attribute",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemTemplateAttribute(Document):
pass

View File

@ -1,60 +0,0 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Manage Variants", {
onload: function(frm) {
var df = frappe.meta.get_docfield("Variant Attribute", "attribute_value", "Manage Variants");
df.on_make = function(field) {
$(field.input_area).addClass("ui-front");
field.$input.autocomplete({
minLength: 0,
minChars: 0,
source: function(request, response) {
frappe.call({
method:"frappe.client.get_list",
args:{
doctype:"Item Attribute Value",
filters: [
["parent","=", field.doc.attribute],
["attribute_value", "like", request.term + "%"]
],
fields: ["attribute_value"]
},
callback: function(r) {
response($.map(r.message, function(d) { return d.attribute_value; }));
}
});
},
select: function(event, ui) {
field.$input.val(ui.item.value);
field.$input.trigger("change");
}
});
}
},
refresh: function(frm) {
frm.disable_save();
frm.page.set_primary_action(__("Create Variants"), function() {
frappe.call({
method: "create_variants",
doc:frm.doc
})
});
},
onload_post_render: function(frm) {
frm.get_field("variants").grid.cannot_add_rows = true;
},
item_code:function(frm) {
return frappe.call({
method: "get_item_details",
doc:frm.doc,
callback: function(r) {
refresh_field('attributes');
refresh_field('variants');
}
})
}
});

View File

@ -1,103 +0,0 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2015-05-19 05:39:59.345901",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"fields": [
{
"fieldname": "item_code",
"fieldtype": "Link",
"label": "Item Code",
"options": "Item",
"permlevel": 0,
"precision": "",
"reqd": 1
},
{
"fieldname": "section_break_2",
"fieldtype": "Section Break",
"label": "Item Variant Attributes",
"permlevel": 0,
"precision": ""
},
{
"allow_on_submit": 0,
"fieldname": "attributes",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Attributes",
"no_copy": 0,
"options": "Variant Attribute",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "generate_combinations",
"fieldtype": "Button",
"label": "Generate Combinations",
"options": "generate_combinations",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"label": "Item Variants",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "variants",
"fieldtype": "Table",
"label": "Variants",
"options": "Manage Variants Item",
"permlevel": 0,
"precision": ""
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"in_create": 1,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"modified": "2015-07-13 05:28:29.057918",
"modified_by": "Administrator",
"module": "Stock",
"name": "Manage Variants",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 0,
"role": "Item Manager",
"share": 1,
"write": 1
}
],
"read_only": 1,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@ -1,222 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr, flt
import copy
import json
class DuplicateAttribute(frappe.ValidationError): pass
class ManageVariants(Document):
def get_item_details(self):
self.clear_tables()
if self.item_code:
self.get_attributes()
self.get_variants()
def generate_combinations(self):
self.validate_attributes()
self.validate_template_item()
self.validate_attribute_values()
self.validate_attributes_are_unique()
self.get_variant_item_codes()
def create_variants(self):
self.sync_variants()
def clear_tables(self):
self.set('attributes', [])
self.set('variants', [])
def get_attributes(self):
attributes = {}
self.set('attributes', [])
for d in frappe.db.sql("""select attr.attribute, attr.attribute_value from `tabVariant Attribute` as attr,
`tabItem` as item where attr.parent = item.name and item.variant_of = %s""", self.item_code, as_dict=1):
attributes.setdefault(d.attribute, []).append(d.attribute_value)
for d in attributes:
attribute_values = set(attributes[d])
for value in attribute_values:
self.append('attributes',{"attribute": d, "attribute_value": value})
def get_variants(self):
variants = [d.name for d in frappe.get_all("Item",
filters={"variant_of":self.item_code})]
data = frappe.db.sql("""select parent, attribute, attribute_value from `tabVariant Attribute`""", as_dict=1)
for d in variants:
variant_attributes, attributes = "", []
for attribute in data:
if attribute.parent == d:
variant_attributes += attribute.attribute_value + " | "
attributes.append([attribute.attribute, attribute.attribute_value])
self.append('variants',{"variant": d, "variant_attributes": variant_attributes[: -3], "attributes": json.dumps(attributes)})
def validate_attributes(self):
if not self.attributes:
frappe.throw(_("Enter atleast one Attribute & its Value in Attribute table."))
def validate_template_item(self):
if not frappe.db.get_value("Item", self.item_code, "has_variants"):
frappe.throw(_("Selected Item cannot have Variants."))
if frappe.db.get_value("Item", self.item_code, "variant_of"):
frappe.throw(_("Item cannot be a variant of a variant"))
def validate_attribute_values(self):
attributes = {}
numeric_attributes = []
for t in frappe.db.get_all("Item Attribute Value", fields=["parent", "attribute_value"]):
attributes.setdefault(t.parent, []).append(t.attribute_value)
for t in frappe.get_list("Item Attribute", filters={"numeric_values":1}):
numeric_attributes.append(t.name)
for d in self.attributes:
if d.attribute in numeric_attributes:
values = frappe.db.sql("""select from_range, to_range, increment from `tabItem Template Attribute` \
where parent = %s and attribute = %s""", (self.item_code, d.attribute), as_dict=1)[0]
if (not values.from_range < flt(d.attribute_value) < values.to_range) \
or ((flt(d.attribute_value) - values.from_range) % values.increment != 0):
frappe.throw(_("Attribute value {0} for attribute {1} must be within range of {2} to {3} and in increments of {4}")
.format(d.attribute_value, d.attribute, values.from_range, values.to_range, values.increment))
else:
if d.attribute_value not in attributes.get(d.attribute):
frappe.throw(_("Attribute value {0} for attribute {1} does not exist \
in Item Attribute Master.").format(d.attribute_value, d.attribute))
def validate_attributes_are_unique(self):
attributes = []
for d in self.attributes:
key = (d.attribute, d.attribute_value)
if key in attributes:
frappe.throw(_("{0} {1} is entered more than once in Attributes table")
.format(d.attribute, d.attribute_value), DuplicateAttribute)
attributes.append(key)
def get_variant_item_codes(self):
"""Get all possible suffixes for variants"""
variant_dict = {}
self.set('variants', [])
for d in self.attributes:
variant_dict.setdefault(d.attribute, []).append(d.attribute_value)
all_attributes = [d.name for d in frappe.get_all("Item Attribute", order_by = "priority asc")]
# sort attributes by their priority
attributes = filter(None, map(lambda d: d if d in variant_dict else None, all_attributes))
def add_attribute_suffixes(item_code, my_attributes, attributes):
attr = frappe.get_doc("Item Attribute", attributes[0])
for value in attr.item_attribute_values:
if value.attribute_value in variant_dict[attr.name]:
_my_attributes = copy.deepcopy(my_attributes)
_my_attributes.append([attr.name, value.attribute_value])
if len(attributes) > 1:
add_attribute_suffixes(item_code + "-" + value.abbr, _my_attributes, attributes[1:])
else:
variant_attributes = ""
for d in _my_attributes:
variant_attributes += d[1] + " | "
self.append('variants', {"variant": item_code + "-" + value.abbr,
"attributes": json.dumps(_my_attributes), "variant_attributes": variant_attributes[: -3]})
add_attribute_suffixes(self.item_code, [], attributes)
def sync_variants(self):
variant_item_codes = []
item_variants_attributes = {}
inserted, updated, old_variant_name, new_variant_name, deleted = [], [], [], [], []
for v in self.variants:
variant_item_codes.append(v.variant)
existing_variants = [d.name for d in frappe.get_all("Item",
filters={"variant_of":self.item_code})]
for d in existing_variants:
attributes = []
for attribute in frappe.db.sql("""select attribute, attribute_value from `tabVariant Attribute` where parent = %s""", d):
attributes.append([attribute[0], attribute[1]])
item_variants_attributes.setdefault(d, []).append(attributes)
for existing_variant in existing_variants:
if existing_variant not in variant_item_codes:
att = item_variants_attributes[existing_variant][0]
for variant in self.variants:
if sorted(json.loads(variant.attributes) ,key=lambda x: x[0]) == \
sorted(att ,key=lambda x: x[0]):
rename_variant(existing_variant, variant.variant)
old_variant_name.append(existing_variant)
new_variant_name.append(variant.variant)
if existing_variant not in old_variant_name:
delete_variant(existing_variant)
deleted.append(existing_variant)
for item_code in variant_item_codes:
if item_code not in existing_variants:
if item_code not in new_variant_name:
make_variant(self.item_code, item_code, self.variants)
inserted.append(item_code)
else:
update_variant(self.item_code, item_code, self.variants)
updated.append(item_code)
if inserted:
frappe.msgprint(_("Item Variants {0} created").format(", ".join(inserted)))
if updated:
frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
if old_variant_name:
frappe.msgprint(_("Item Variants {0} renamed").format(", ".join(old_variant_name)))
if deleted:
frappe.msgprint(_("Item Variants {0} deleted").format(", ".join(deleted)))
def make_variant(item, variant_code, variant_attribute):
variant = frappe.new_doc("Item")
variant.item_code = variant_code
copy_attributes_to_variant(item, variant, variant_attribute, insert=True)
variant.insert()
def update_variant(item, variant_code, variant_attribute=None):
variant = frappe.get_doc("Item", variant_code)
copy_attributes_to_variant(item, variant, variant_attribute, insert=True)
variant.save()
def rename_variant(old_variant_code, new_variant_code):
frappe.rename_doc("Item", old_variant_code, new_variant_code)
def delete_variant(variant_code):
frappe.delete_doc("Item", variant_code)
def copy_attributes_to_variant(item, variant, variant_attribute=None, insert=False):
template = frappe.get_doc("Item", item)
from frappe.model import no_value_fields
for field in template.meta.fields:
if field.fieldtype not in no_value_fields and (insert or not field.no_copy)\
and field.fieldname not in ("item_code", "item_name"):
if variant.get(field.fieldname) != template.get(field.fieldname):
variant.set(field.fieldname, template.get(field.fieldname))
variant.item_name = template.item_name + variant.item_code[len(template.name):]
variant.variant_of = template.name
variant.has_variants = 0
variant.show_in_website = 0
if variant_attribute:
for d in variant_attribute:
if d.variant == variant.item_code:
variant.attributes= []
for a in json.loads(d.attributes):
variant.append('attributes', {"attribute": a[0], "attribute_value": a[1]})
if variant.attributes:
variant.description += "\n"
for d in variant.attributes:
variant.description += "<p>" + d.attribute + ": " + cstr(d.attribute_value) + "</p>"

View File

@ -1,49 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.stock.doctype.manage_variants.manage_variants import DuplicateAttribute
class TestManageVariants(unittest.TestCase):
def test_variant_item_codes(self):
manage_variant = frappe.new_doc("Manage Variants")
manage_variant.update({
"item_code": "_Test Variant Item",
"attributes": [
{
"attribute": "Test Size",
"attribute_value": "Small"
},
{
"attribute": "Test Size",
"attribute_value": "Large"
}
]
})
manage_variant.generate_combinations()
self.assertEqual(manage_variant.variants[0].variant, "_Test Variant Item-S")
self.assertEqual(manage_variant.variants[1].variant, "_Test Variant Item-L")
self.assertEqual(manage_variant.variants[0].variant_attributes, "Small")
self.assertEqual(manage_variant.variants[1].variant_attributes, "Large")
manage_variant.create_variants()
def test_attributes_are_unique(self):
manage_variant = frappe.new_doc("Manage Variants")
manage_variant.update({
"item_code": "_Test Variant Item",
"attributes": [
{
"attribute": "Test Size",
"attribute_value": "Small"
},
{
"attribute": "Test Size",
"attribute_value": "Small"
}
]
})
self.assertRaises(DuplicateAttribute, manage_variant.generate_combinations)

View File

@ -1,76 +0,0 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "",
"creation": "2015-05-19 05:55:31.155672",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Other",
"fields": [
{
"allow_on_submit": 0,
"fieldname": "variant",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Variant",
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "variant_attributes",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Variant Attributes",
"permlevel": 0,
"precision": "",
"read_only": 1
},
{
"fieldname": "attributes",
"fieldtype": "Text",
"hidden": 1,
"label": "attributes",
"permlevel": 0,
"precision": "",
"read_only": 1
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-06-30 03:19:07.548196",
"modified_by": "Administrator",
"module": "Stock",
"name": "Manage Variants Item",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ManageVariantsItem(Document):
pass

View File

@ -1178,7 +1178,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"modified": "2015-08-07 12:28:35.832492", "modified": "2015-08-12 08:51:07.002600",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Entry", "name": "Stock Entry",

View File

@ -68,22 +68,6 @@ class TestStockEntry(unittest.TestCase):
def test_auto_material_request(self): def test_auto_material_request(self):
self._test_auto_material_request("_Test Item") self._test_auto_material_request("_Test Item")
def test_auto_material_request_for_variant(self):
manage_variant = frappe.new_doc("Manage Variants")
manage_variant.update({
"item_code": "_Test Variant Item",
"attributes": [
{
"attribute": "Test Size",
"attribute_value": "Small"
}
]
})
manage_variant.generate_combinations()
manage_variant.create_variants()
self._test_auto_material_request("_Test Variant Item-S")
def _test_auto_material_request(self, item_code): def _test_auto_material_request(self, item_code):
item = frappe.get_doc("Item", item_code) item = frappe.get_doc("Item", item_code)

View File

@ -828,7 +828,7 @@
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"modified": "2015-08-07 13:21:23.840052", "modified": "2015-08-12 08:51:15.789056",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Entry Detail", "name": "Stock Entry Detail",

View File

@ -311,7 +311,7 @@
"is_submittable": 0, "is_submittable": 0,
"issingle": 1, "issingle": 1,
"istable": 0, "istable": 0,
"modified": "2015-08-03 13:00:36.082986", "modified": "2015-08-12 08:51:24.798096",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Settings", "name": "Stock Settings",

View File

@ -1,78 +1,168 @@
{ {
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2013-01-10 16:34:30", "creation": "2013-01-10 16:34:30",
"custom": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"allow_on_submit": 0,
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item", "label": "Item",
"no_copy": 0,
"options": "Item", "options": "Item",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "current_stock_uom", "fieldname": "current_stock_uom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Current Stock UOM", "label": "Current Stock UOM",
"no_copy": 0,
"options": "UOM", "options": "UOM",
"permlevel": 0, "permlevel": 0,
"read_only": 1 "print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "new_stock_uom", "fieldname": "new_stock_uom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "New Stock UOM", "label": "New Stock UOM",
"no_copy": 0,
"options": "UOM", "options": "UOM",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "conversion_factor", "fieldname": "conversion_factor",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Conversion Factor", "label": "Conversion Factor",
"permlevel": 0 "no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}, },
{ {
"allow_on_submit": 0,
"fieldname": "update", "fieldname": "update",
"fieldtype": "Button", "fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Update", "label": "Update",
"no_copy": 0,
"options": "update_stock_uom", "options": "update_stock_uom",
"permlevel": 0 "permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-magic", "icon": "icon-magic",
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1, "issingle": 1,
"modified": "2015-07-13 05:28:25.689187", "istable": 0,
"modified": "2015-08-12 08:52:09.322664",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock UOM Replace Utility", "name": "Stock UOM Replace Utility",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 0,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 0, "report": 0,
"role": "Item Manager", "role": "Item Manager",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0, "submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 0,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 0, "report": 0,
"role": "Stock Manager", "role": "Stock Manager",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0, "submit": 0,
"write": 1 "write": 1
} }
], ],
"read_only": 0 "read_only": 0,
"read_only_onload": 0
} }

View File

@ -27,19 +27,34 @@
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
"set_only_once": 0 "set_only_once": 0,
}, "unique": 0
{
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"permlevel": 0,
"precision": ""
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "",
"fieldname": "attribute_value", "fieldname": "attribute_value",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 1,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
@ -51,9 +66,133 @@
"print_hide": 0, "print_hide": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0 "set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "has_variants",
"fieldname": "numeric_values",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Numeric Values",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "numeric_values",
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "",
"fieldname": "from_range",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "From Range",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "",
"fieldname": "increment",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Increment",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"fieldname": "column_break_8",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"depends_on": "",
"fieldname": "to_range",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "To Range",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"hide_heading": 0, "hide_heading": 0,
@ -64,7 +203,7 @@
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"modified": "2015-05-20 06:16:16.803578", "modified": "2015-08-12 02:47:07.959104",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Variant Attribute", "name": "Variant Attribute",