diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index 47c7f6b2f6..aae568a394 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -81,7 +81,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.add_custom_button(__('Opportunity Lost'), cur_frm.cscript['Declare Opportunity Lost'], "icon-remove", "btn-default"); - + } } @@ -94,7 +94,7 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; if (d.item_code) { return frappe.call({ - method: "erpnext.selling.doctype.opportunity.opportunity.get_item_details", + method: "erpnext.crm.doctype.opportunity.opportunity.get_item_details", args: {"item_code":d.item_code}, callback: function(r, rt) { if(r.message) { diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 30139c2855..f368998dad 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -58,7 +58,10 @@ class Opportunity(TransactionBase): where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s and q.status = 'Ordered'""", self.name) def validate_cust_name(self): - self.customer_name = self.customer or self.lead + if self.customer: + self.customer_name = frappe.db.get_value("Customer", self.customer, "customer_name") + elif self.lead: + self.customer_name = frappe.db.get_value("Lead", self.lead, "lead_name") def get_cust_address(self,name): details = frappe.db.sql("""select customer_name, address, territory, customer_group diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json index d2e547a656..718a6b1d7d 100644 --- a/erpnext/hr/doctype/employee/employee.json +++ b/erpnext/hr/doctype/employee/employee.json @@ -20,14 +20,6 @@ "permlevel": 0, "width": "50%" }, - { - "fieldname": "image_view", - "fieldtype": "Image", - "in_list_view": 0, - "label": "Image View", - "options": "image", - "permlevel": 0 - }, { "fieldname": "employee", "fieldtype": "Data", @@ -71,9 +63,17 @@ }, { "fieldname": "image", - "fieldtype": "Select", + "fieldtype": "Attach", "label": "Image", - "options": "attach_files:", + "options": "", + "permlevel": 0 + }, + { + "fieldname": "image_view", + "fieldtype": "Image", + "in_list_view": 0, + "label": "Image View", + "options": "image", "permlevel": 0 }, { @@ -674,7 +674,7 @@ ], "icon": "icon-user", "idx": 1, - "modified": "2015-02-05 05:11:38.234802", + "modified": "2015-02-19 09:28:40.628101", "modified_by": "Administrator", "module": "HR", "name": "Employee", diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json index f820aa819e..1c6245bd10 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.json +++ b/erpnext/manufacturing/doctype/production_order/production_order.json @@ -53,7 +53,7 @@ }, { "depends_on": "", - "description": "Bill of Material to be considered for manufacturing", + "description": "", "fieldname": "bom_no", "fieldtype": "Link", "in_list_view": 0, @@ -94,7 +94,7 @@ "reqd": 1 }, { - "description": "Automatically updated via Stock Entry", + "description": "", "fieldname": "material_transferred_for_qty", "fieldtype": "Int", "label": "Material Transferred for Qty", @@ -105,7 +105,7 @@ { "default": "0", "depends_on": "eval:doc.docstatus==1", - "description": "Automatically updated via Stock Entry of type Manufacture or Repack", + "description": "", "fieldname": "produced_qty", "fieldtype": "Float", "label": "Manufactured Qty", @@ -360,7 +360,7 @@ "idx": 1, "in_create": 0, "is_submittable": 1, - "modified": "2015-02-19 03:58:23.460022", + "modified": "2015-02-19 06:00:33.277637", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order", diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 5a5896c179..15b0e39740 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -12,10 +12,10 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( if(doc.docstatus==1) { if(doc.status != 'Stopped') { - cur_frm.dashboard.add_progress(cint(doc.per_delivered) + __("% Delivered"), - doc.per_delivered); - cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"), - doc.per_billed); + // cur_frm.dashboard.add_progress(cint(doc.per_delivered) + __("% Delivered"), + // doc.per_delivered); + // cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"), + // doc.per_billed); // delivery note if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1) diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.json b/erpnext/setup/doctype/sales_partner/sales_partner.json index aed0c5047d..9f20cb0a15 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.json +++ b/erpnext/setup/doctype/sales_partner/sales_partner.json @@ -147,9 +147,9 @@ }, { "fieldname": "logo", - "fieldtype": "Select", + "fieldtype": "Attach", "label": "Logo", - "options": "attach_files:", + "options": "", "permlevel": 0 }, { @@ -200,7 +200,7 @@ "icon": "icon-user", "idx": 1, "in_create": 0, - "modified": "2015-02-05 05:11:46.087123", + "modified": "2015-02-19 09:26:41.397649", "modified_by": "Administrator", "module": "Setup", "name": "Sales Partner", diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index 1fb1e2d167..8f68554311 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -37,7 +37,8 @@ class Bin(Document): "item_code": self.item_code, "warehouse": self.warehouse, "posting_date": args.get("posting_date"), - "posting_time": args.get("posting_time") + "posting_time": args.get("posting_time"), + "voucher_no": args.get("voucher_no") }, allow_negative_stock=allow_negative_stock) def update_qty(self, args): diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 6f197a82b3..33b1720f06 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -72,8 +72,17 @@ frappe.ui.form.on("Item", "onload", function(frm) { response($.map(r.message, function(d) { return d.attribute_value; })); } }); - } - }) + }, + select: function(event, ui) { + field.$input.val(ui.item.value); + field.$input.trigger("change"); + }, + focus: function( event, ui ) { + if(ui.item.action) { + return false; + } + }, + }); } }); diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 81d6fd094e..66f0ee2d84 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1,962 +1,956 @@ { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:item_code", - "creation": "2013-05-03 10:45:46", - "default_print_format": "Standard", - "description": "A Product or a Service that is bought, sold or kept in stock.", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Master", + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:item_code", + "creation": "2013-05-03 10:45:46", + "default_print_format": "Standard", + "description": "A Product or a Service that is bought, sold or kept in stock.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", "fields": [ { - "fieldname": "name_and_description_section", - "fieldtype": "Section Break", - "label": "Name and Description", - "no_copy": 0, - "oldfieldtype": "Section Break", - "options": "icon-flag", - "permlevel": 0, + "fieldname": "name_and_description_section", + "fieldtype": "Section Break", + "label": "Name and Description", + "no_copy": 0, + "oldfieldtype": "Section Break", + "options": "icon-flag", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "options": "ITEM-", - "permlevel": 0, + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "options": "ITEM-", + "permlevel": 0, "read_only": 0 - }, + }, { - "description": "Item will be saved by this name in the data base.", - "fieldname": "item_code", - "fieldtype": "Data", - "in_filter": 0, - "label": "Item Code", - "no_copy": 1, - "oldfieldname": "item_code", - "oldfieldtype": "Data", - "permlevel": 0, - "read_only": 0, - "reqd": 0, + "description": "Item will be saved by this name in the data base.", + "fieldname": "item_code", + "fieldtype": "Data", + "in_filter": 0, + "label": "Item Code", + "no_copy": 1, + "oldfieldname": "item_code", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 0, "search_index": 0 - }, + }, { - "depends_on": "variant_of", - "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified", - "fieldname": "variant_of", - "fieldtype": "Link", - "label": "Variant Of", - "options": "Item", - "permlevel": 0, - "precision": "", + "depends_on": "variant_of", + "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified", + "fieldname": "variant_of", + "fieldtype": "Link", + "label": "Variant Of", + "options": "Item", + "permlevel": 0, + "precision": "", "read_only": 1 - }, + }, { - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "permlevel": 0, - "read_only": 0, - "reqd": 1, + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1, "search_index": 1 - }, + }, { - "description": "", - "fieldname": "item_group", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "permlevel": 0, - "read_only": 0, + "description": "", + "fieldname": "item_group", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "fieldname": "column_break0", - "fieldtype": "Column Break", - "permlevel": 0, - "read_only": 0 - }, - { - "description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).", - "fieldname": "stock_uom", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Unit of Measure", - "oldfieldname": "stock_uom", - "oldfieldtype": "Link", - "options": "UOM", - "permlevel": 0, - "read_only": 0, + "description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).", + "fieldname": "stock_uom", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Unit of Measure", + "oldfieldname": "stock_uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 0, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 0, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "reqd": 0 - }, + }, { - "fieldname": "barcode", - "fieldtype": "Data", - "label": "Barcode", - "permlevel": 0, + "fieldname": "barcode", + "fieldtype": "Data", + "label": "Barcode", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "section_break_11", - "fieldtype": "Section Break", - "permlevel": 0, + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "image", + "fieldtype": "Attach", + "label": "Image", + "options": "", + "permlevel": 0, "precision": "" - }, + }, { - "fieldname": "description", - "fieldtype": "Text Editor", - "in_filter": 0, - "in_list_view": 0, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "permlevel": 0, - "read_only": 0, - "reqd": 1, + "fieldname": "image_view", + "fieldtype": "Image", + "in_list_view": 1, + "label": "Image View", + "options": "image", + "permlevel": 0, + "precision": "" + }, + { + "fieldname": "section_break_11", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, + { + "fieldname": "description", + "fieldtype": "Text Editor", + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "read_only": 0, + "reqd": 1, "search_index": 0 - }, + }, { - "fieldname": "column_break_13", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "variants_section", + "fieldtype": "Section Break", + "label": "Variants", + "permlevel": 0, "precision": "" - }, + }, { - "fieldname": "image", - "fieldtype": "Attach", - "label": "Image", - "options": "", - "permlevel": 0, - "precision": "" - }, - { - "fieldname": "image_view", - "fieldtype": "Image", - "in_list_view": 1, - "label": "Image View", - "options": "image", - "permlevel": 0, - "precision": "" - }, - { - "fieldname": "variants_section", - "fieldtype": "Section Break", - "label": "Variants", - "permlevel": 0, - "precision": "" - }, - { - "description": "Automatically set. If this item has variants, then it cannot be selected in sales orders etc.", - "fieldname": "has_variants", - "fieldtype": "Check", - "label": "Has Variants", - "options": "", - "permlevel": 0, - "precision": "", + "description": "Automatically set. If this item has variants, then it cannot be selected in sales orders etc.", + "fieldname": "has_variants", + "fieldtype": "Check", + "label": "Has Variants", + "options": "", + "permlevel": 0, + "precision": "", "read_only": 0 - }, + }, { - "depends_on": "has_variants", - "description": "A new variant (Item) will be created for each attribute value combination", - "fieldname": "variants", - "fieldtype": "Table", - "label": "Variants", - "options": "Item Variant", - "permlevel": 0, + "depends_on": "has_variants", + "description": "A new variant (Item) will be created for each attribute value combination", + "fieldname": "variants", + "fieldtype": "Table", + "label": "Variants", + "options": "Item Variant", + "permlevel": 0, "precision": "" - }, + }, { - "fieldname": "inventory", - "fieldtype": "Section Break", - "label": "Inventory", - "oldfieldtype": "Section Break", - "options": "icon-truck", - "permlevel": 0, + "fieldname": "inventory", + "fieldtype": "Section Break", + "label": "Inventory", + "oldfieldtype": "Section Break", + "options": "icon-truck", + "permlevel": 0, "read_only": 0 - }, + }, { - "default": "Yes", - "description": "Select \"Yes\" if you are maintaining stock of this item in your Inventory.", - "fieldname": "is_stock_item", - "fieldtype": "Select", - "label": "Is Stock Item", - "oldfieldname": "is_stock_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "Yes", + "description": "Select \"Yes\" if you are maintaining stock of this item in your Inventory.", + "fieldname": "is_stock_item", + "fieldtype": "Select", + "label": "Is Stock Item", + "oldfieldname": "is_stock_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "depends_on": "", - "description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.", - "fieldname": "default_warehouse", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Warehouse", - "oldfieldname": "default_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, + "depends_on": "", + "description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.", + "fieldname": "default_warehouse", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Warehouse", + "oldfieldname": "default_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Percentage variation in quantity to be allowed while receiving or delivering this item.", - "fieldname": "tolerance", - "fieldtype": "Float", - "label": "Allowance Percent", - "oldfieldname": "tolerance", - "oldfieldtype": "Currency", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Percentage variation in quantity to be allowed while receiving or delivering this item.", + "fieldname": "tolerance", + "fieldtype": "Float", + "label": "Allowance Percent", + "oldfieldname": "tolerance", + "oldfieldtype": "Currency", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "fieldname": "valuation_method", - "fieldtype": "Select", - "label": "Valuation Method", - "options": "\nFIFO\nMoving Average", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "valuation_method", + "fieldtype": "Select", + "label": "Valuation Method", + "options": "\nFIFO\nMoving Average", + "permlevel": 0, "read_only": 0 - }, + }, { - "default": "0.00", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "You can enter the minimum quantity of this item to be ordered.", - "fieldname": "min_order_qty", - "fieldtype": "Float", - "hidden": 0, - "label": "Minimum Order Qty", - "oldfieldname": "min_order_qty", - "oldfieldtype": "Currency", - "permlevel": 0, + "default": "0.00", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "You can enter the minimum quantity of this item to be ordered.", + "fieldname": "min_order_qty", + "fieldtype": "Float", + "hidden": 0, + "label": "Minimum Order Qty", + "oldfieldname": "min_order_qty", + "oldfieldtype": "Currency", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, "width": "50%" - }, + }, { - "default": "No", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Select \"Yes\" if this item is used for some internal purpose in your company.", - "fieldname": "is_asset_item", - "fieldtype": "Select", - "label": "Is Fixed Asset Item", - "oldfieldname": "is_asset_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "No", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Select \"Yes\" if this item is used for some internal purpose in your company.", + "fieldname": "is_asset_item", + "fieldtype": "Select", + "label": "Is Fixed Asset Item", + "oldfieldname": "is_asset_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "default": "No", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "fieldname": "has_batch_no", - "fieldtype": "Select", - "label": "Has Batch No", - "oldfieldname": "has_batch_no", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "No", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "has_batch_no", + "fieldtype": "Select", + "label": "Has Batch No", + "oldfieldname": "has_batch_no", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "default": "No", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Selecting \"Yes\" will give a unique identity to each entity of this item which can be viewed in the Serial No master.", - "fieldname": "has_serial_no", - "fieldtype": "Select", - "in_filter": 1, - "label": "Has Serial No", - "oldfieldname": "has_serial_no", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "No", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Selecting \"Yes\" will give a unique identity to each entity of this item which can be viewed in the Serial No master.", + "fieldname": "has_serial_no", + "fieldtype": "Select", + "in_filter": 1, + "label": "Has Serial No", + "oldfieldname": "has_serial_no", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "depends_on": "eval: doc.has_serial_no===\"Yes\"", - "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.", - "fieldname": "serial_no_series", - "fieldtype": "Data", - "label": "Serial Number Series", - "no_copy": 0, + "depends_on": "eval: doc.has_serial_no===\"Yes\"", + "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.", + "fieldname": "serial_no_series", + "fieldtype": "Data", + "label": "Serial Number Series", + "no_copy": 0, "permlevel": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "fieldname": "warranty_period", - "fieldtype": "Data", - "label": "Warranty Period (in days)", - "oldfieldname": "warranty_period", - "oldfieldtype": "Data", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "warranty_period", + "fieldtype": "Data", + "label": "Warranty Period (in days)", + "oldfieldname": "warranty_period", + "oldfieldtype": "Data", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "fieldname": "end_of_life", - "fieldtype": "Date", - "label": "End of Life", - "oldfieldname": "end_of_life", - "oldfieldtype": "Date", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "end_of_life", + "fieldtype": "Date", + "label": "End of Life", + "oldfieldname": "end_of_life", + "oldfieldtype": "Date", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Net Weight of each Item", - "fieldname": "net_weight", - "fieldtype": "Float", - "label": "Net Weight", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Net Weight of each Item", + "fieldname": "net_weight", + "fieldtype": "Float", + "label": "Net Weight", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "fieldname": "weight_uom", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Weight UOM", - "options": "UOM", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "weight_uom", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Weight UOM", + "options": "UOM", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Auto-raise Material Request if quantity goes below re-order level in default warehouse", - "fieldname": "reorder_section", - "fieldtype": "Section Break", - "label": "Re-order", - "options": "icon-rss", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Auto-raise Material Request if quantity goes below re-order level in default warehouse", + "fieldname": "reorder_section", + "fieldtype": "Section Break", + "label": "Re-order", + "options": "icon-rss", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:(doc.is_stock_item==\"Yes\" && !doc.apply_warehouse_wise_reorder_level)", - "fieldname": "re_order_level", - "fieldtype": "Float", - "label": "Re-Order Level", - "oldfieldname": "re_order_level", - "oldfieldtype": "Currency", - "permlevel": 0, + "depends_on": "eval:(doc.is_stock_item==\"Yes\" && !doc.apply_warehouse_wise_reorder_level)", + "fieldname": "re_order_level", + "fieldtype": "Float", + "label": "Re-Order Level", + "oldfieldname": "re_order_level", + "oldfieldtype": "Currency", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:(doc.is_stock_item==\"Yes\" && !doc.apply_warehouse_wise_reorder_level)", - "fieldname": "re_order_qty", - "fieldtype": "Float", - "label": "Re-Order Qty", - "permlevel": 0, + "depends_on": "eval:(doc.is_stock_item==\"Yes\" && !doc.apply_warehouse_wise_reorder_level)", + "fieldname": "re_order_qty", + "fieldtype": "Float", + "label": "Re-Order Qty", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "fieldname": "apply_warehouse_wise_reorder_level", - "fieldtype": "Check", - "label": "Apply Warehouse-wise Reorder Level", - "permlevel": 0, + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "apply_warehouse_wise_reorder_level", + "fieldtype": "Check", + "label": "Apply Warehouse-wise Reorder Level", + "permlevel": 0, "precision": "" - }, + }, { - "depends_on": "eval:(doc.is_stock_item==\"Yes\" && doc.apply_warehouse_wise_reorder_level)", - "fieldname": "section_break_31", - "fieldtype": "Section Break", - "permlevel": 0, + "depends_on": "eval:(doc.is_stock_item==\"Yes\" && doc.apply_warehouse_wise_reorder_level)", + "fieldname": "section_break_31", + "fieldtype": "Section Break", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:(doc.is_stock_item==\"Yes\" && doc.apply_warehouse_wise_reorder_level)", - "description": "Will also apply for variants unless overrridden", - "fieldname": "reorder_levels", - "fieldtype": "Table", - "label": "Warehouse-wise Reorder Levels", - "options": "Item Reorder", - "permlevel": 0, + "depends_on": "eval:(doc.is_stock_item==\"Yes\" && doc.apply_warehouse_wise_reorder_level)", + "description": "Will also apply for variants unless overrridden", + "fieldname": "reorder_levels", + "fieldtype": "Table", + "label": "Warehouse-wise Reorder Levels", + "options": "Item Reorder", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "purchase_details", - "fieldtype": "Section Break", - "label": "Purchase Details", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "permlevel": 0, + "fieldname": "purchase_details", + "fieldtype": "Section Break", + "label": "Purchase Details", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, "read_only": 0 - }, + }, { - "default": "Yes", - "description": "Selecting \"Yes\" will allow this item to appear in Purchase Order , Purchase Receipt.", - "fieldname": "is_purchase_item", - "fieldtype": "Select", - "label": "Is Purchase Item", - "oldfieldname": "is_purchase_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "Yes", + "description": "Selecting \"Yes\" will allow this item to appear in Purchase Order , Purchase Receipt.", + "fieldname": "is_purchase_item", + "fieldtype": "Select", + "label": "Is Purchase Item", + "oldfieldname": "is_purchase_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "fieldname": "default_supplier", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Supplier", - "options": "Supplier", + "fieldname": "default_supplier", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Supplier", + "options": "Supplier", "permlevel": 0 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "description": "Lead Time days is number of days by which this item is expected in your warehouse. This days is fetched in Material Request when you select this item.", - "fieldname": "lead_time_days", - "fieldtype": "Int", - "label": "Lead Time Days", - "no_copy": 0, - "oldfieldname": "lead_time_days", - "oldfieldtype": "Int", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "description": "Lead Time days is number of days by which this item is expected in your warehouse. This days is fetched in Material Request when you select this item.", + "fieldname": "lead_time_days", + "fieldtype": "Int", + "label": "Lead Time Days", + "no_copy": 0, + "oldfieldname": "lead_time_days", + "oldfieldtype": "Int", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "description": "Default Purchase Account in which cost of the item will be debited.", - "fieldname": "expense_account", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Expense Account", - "oldfieldname": "purchase_account", - "oldfieldtype": "Link", - "options": "Account", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "description": "Default Purchase Account in which cost of the item will be debited.", + "fieldname": "expense_account", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Expense Account", + "oldfieldname": "purchase_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "description": "", - "fieldname": "buying_cost_center", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Buying Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "description": "", + "fieldname": "buying_cost_center", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Buying Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "fieldname": "last_purchase_rate", - "fieldtype": "Float", - "label": "Last Purchase Rate", - "no_copy": 1, - "oldfieldname": "last_purchase_rate", - "oldfieldtype": "Currency", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "last_purchase_rate", + "fieldtype": "Float", + "label": "Last Purchase Rate", + "no_copy": 1, + "oldfieldname": "last_purchase_rate", + "oldfieldtype": "Currency", + "permlevel": 0, "read_only": 1 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, "width": "50%" - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "description": "Will also apply for variants", - "fieldname": "uoms", - "fieldtype": "Table", - "label": "UOMs", - "no_copy": 1, - "oldfieldname": "uom_conversion_details", - "oldfieldtype": "Table", - "options": "UOM Conversion Detail", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "description": "Will also apply for variants", + "fieldname": "uoms", + "fieldtype": "Table", + "label": "UOMs", + "no_copy": 1, + "oldfieldname": "uom_conversion_details", + "oldfieldtype": "Table", + "options": "UOM Conversion Detail", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "fieldname": "manufacturer", - "fieldtype": "Data", - "label": "Manufacturer", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "manufacturer", + "fieldtype": "Data", + "label": "Manufacturer", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "fieldname": "manufacturer_part_no", - "fieldtype": "Data", - "label": "Manufacturer Part Number", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "manufacturer_part_no", + "fieldtype": "Data", + "label": "Manufacturer Part Number", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "fieldname": "supplier_items", - "fieldtype": "Table", - "label": "Supplier Items", - "options": "Item Supplier", - "permlevel": 0, + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "supplier_items", + "fieldtype": "Table", + "label": "Supplier Items", + "options": "Item Supplier", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "sales_details", - "fieldtype": "Section Break", - "label": "Sales Details", - "oldfieldtype": "Section Break", - "options": "icon-tag", - "permlevel": 0, + "fieldname": "sales_details", + "fieldtype": "Section Break", + "label": "Sales Details", + "oldfieldtype": "Section Break", + "options": "icon-tag", + "permlevel": 0, "read_only": 0 - }, + }, { - "default": "Yes", - "description": "Selecting \"Yes\" will allow this item to figure in Sales Order, Delivery Note", - "fieldname": "is_sales_item", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Sales Item", - "oldfieldname": "is_sales_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "Yes", + "description": "Selecting \"Yes\" will allow this item to figure in Sales Order, Delivery Note", + "fieldname": "is_sales_item", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Sales Item", + "oldfieldname": "is_sales_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "default": "No", - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "description": "Select \"Yes\" if this item represents some work like training, designing, consulting etc.", - "fieldname": "is_service_item", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Service Item", - "oldfieldname": "is_service_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "No", + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "description": "Select \"Yes\" if this item represents some work like training, designing, consulting etc.", + "fieldname": "is_service_item", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Service Item", + "oldfieldname": "is_service_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "default": "0", - "description": "Publish Item to hub.erpnext.com", - "fieldname": "publish_in_hub", - "fieldtype": "Check", - "label": "Publish in Hub", - "permlevel": 0, + "default": "0", + "description": "Publish Item to hub.erpnext.com", + "fieldname": "publish_in_hub", + "fieldtype": "Check", + "label": "Publish in Hub", + "permlevel": 0, "precision": "" - }, + }, { - "default": "0", - "fieldname": "synced_with_hub", - "fieldtype": "Check", - "hidden": 1, - "label": "Synced With Hub", - "permlevel": 0, + "default": "0", + "fieldname": "synced_with_hub", + "fieldtype": "Check", + "hidden": 1, + "label": "Synced With Hub", + "permlevel": 0, "precision": "" - }, + }, { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "fieldname": "max_discount", - "fieldtype": "Float", - "label": "Max Discount (%)", - "oldfieldname": "max_discount", - "oldfieldtype": "Currency", - "permlevel": 0, + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "max_discount", + "fieldtype": "Float", + "label": "Max Discount (%)", + "oldfieldname": "max_discount", + "oldfieldtype": "Currency", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "fieldname": "income_account", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Income Account", - "options": "Account", - "permlevel": 0, + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "income_account", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Income Account", + "options": "Account", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "fieldname": "selling_cost_center", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Selling Cost Center", - "options": "Cost Center", - "permlevel": 0, + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "selling_cost_center", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Selling Cost Center", + "options": "Cost Center", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, "width": "50%" - }, + }, { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", - "fieldname": "customer_items", - "fieldtype": "Table", - "label": "Customer Items", - "options": "Item Customer Detail", - "permlevel": 0, + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", + "fieldname": "customer_items", + "fieldtype": "Table", + "label": "Customer Items", + "options": "Item Customer Detail", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "item_tax_section_break", - "fieldtype": "Section Break", - "label": "Item Tax", - "oldfieldtype": "Section Break", - "options": "icon-money", - "permlevel": 0, + "fieldname": "item_tax_section_break", + "fieldtype": "Section Break", + "label": "Item Tax", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, "read_only": 0 - }, + }, { - "description": "Will also apply for variants", - "fieldname": "taxes", - "fieldtype": "Table", - "label": "Taxes", - "oldfieldname": "item_tax", - "oldfieldtype": "Table", - "options": "Item Tax", - "permlevel": 0, + "description": "Will also apply for variants", + "fieldname": "taxes", + "fieldtype": "Table", + "label": "Taxes", + "oldfieldname": "item_tax", + "oldfieldtype": "Table", + "options": "Item Tax", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "inspection_criteria", - "fieldtype": "Section Break", - "label": "Inspection Criteria", - "oldfieldtype": "Section Break", - "options": "icon-search", - "permlevel": 0, + "fieldname": "inspection_criteria", + "fieldtype": "Section Break", + "label": "Inspection Criteria", + "oldfieldtype": "Section Break", + "options": "icon-search", + "permlevel": 0, "read_only": 0 - }, + }, { - "default": "No", - "fieldname": "inspection_required", - "fieldtype": "Select", - "label": "Inspection Required", - "no_copy": 0, - "oldfieldname": "inspection_required", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "No", + "fieldname": "inspection_required", + "fieldtype": "Select", + "label": "Inspection Required", + "no_copy": 0, + "oldfieldname": "inspection_required", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "depends_on": "eval:doc.inspection_required==\"Yes\"", - "description": "Will also apply to variants", - "fieldname": "quality_parameters", - "fieldtype": "Table", - "label": "Quality Parameters", - "oldfieldname": "item_specification_details", - "oldfieldtype": "Table", - "options": "Item Quality Inspection Parameter", - "permlevel": 0, + "depends_on": "eval:doc.inspection_required==\"Yes\"", + "description": "Will also apply to variants", + "fieldname": "quality_parameters", + "fieldtype": "Table", + "label": "Quality Parameters", + "oldfieldname": "item_specification_details", + "oldfieldtype": "Table", + "options": "Item Quality Inspection Parameter", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "manufacturing", - "fieldtype": "Section Break", - "label": "Manufacturing", - "oldfieldtype": "Section Break", - "options": "icon-cogs", - "permlevel": 0, + "fieldname": "manufacturing", + "fieldtype": "Section Break", + "label": "Manufacturing", + "oldfieldtype": "Section Break", + "options": "icon-cogs", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "", - "fieldname": "default_bom", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default BOM", - "no_copy": 1, - "oldfieldname": "default_bom", - "oldfieldtype": "Link", - "options": "BOM", - "permlevel": 0, + "depends_on": "", + "fieldname": "default_bom", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default BOM", + "no_copy": 1, + "oldfieldname": "default_bom", + "oldfieldtype": "Link", + "options": "BOM", + "permlevel": 0, "read_only": 1 - }, + }, { - "default": "No", - "depends_on": "", - "description": "Selecting \"Yes\" will allow you to make a Production Order for this item.", - "fieldname": "is_pro_applicable", - "fieldtype": "Select", - "label": "Allow Production Order", - "oldfieldname": "is_pro_applicable", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "No", + "depends_on": "", + "description": "Selecting \"Yes\" will allow you to make a Production Order for this item.", + "fieldname": "is_pro_applicable", + "fieldtype": "Select", + "label": "Allow Production Order", + "oldfieldname": "is_pro_applicable", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "default": "No", - "description": "Select \"Yes\" if you supply raw materials to your supplier to manufacture this item.", - "fieldname": "is_sub_contracted_item", - "fieldtype": "Select", - "label": "Is Sub Contracted Item", - "oldfieldname": "is_sub_contracted_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "permlevel": 0, - "read_only": 0, + "default": "No", + "description": "Select \"Yes\" if you supply raw materials to your supplier to manufacture this item.", + "fieldname": "is_sub_contracted_item", + "fieldtype": "Select", + "label": "Is Sub Contracted Item", + "oldfieldname": "is_sub_contracted_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "fieldname": "customer_code", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Customer Code", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, + "fieldname": "customer_code", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Customer Code", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, "read_only": 0 - }, + }, { - "fieldname": "website_section", - "fieldtype": "Section Break", - "label": "Website", - "options": "icon-globe", - "permlevel": 0, + "fieldname": "website_section", + "fieldtype": "Section Break", + "label": "Website", + "options": "icon-globe", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "show_in_website", - "fieldtype": "Check", - "label": "Show in Website", - "permlevel": 0, + "fieldname": "show_in_website", + "fieldtype": "Check", + "label": "Show in Website", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "description": "website page link", - "fieldname": "page_name", - "fieldtype": "Data", - "label": "Page Name", - "no_copy": 1, - "permlevel": 0, + "depends_on": "show_in_website", + "description": "website page link", + "fieldname": "page_name", + "fieldtype": "Data", + "label": "Page Name", + "no_copy": 1, + "permlevel": 0, "read_only": 1 - }, + }, { - "depends_on": "show_in_website", - "description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.", - "fieldname": "weightage", - "fieldtype": "Int", - "label": "Weightage", - "permlevel": 0, - "read_only": 0, + "depends_on": "show_in_website", + "description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.", + "fieldname": "weightage", + "fieldtype": "Int", + "label": "Weightage", + "permlevel": 0, + "read_only": 0, "search_index": 1 - }, + }, { - "depends_on": "show_in_website", - "description": "Show a slideshow at the top of the page", - "fieldname": "slideshow", - "fieldtype": "Link", - "label": "Slideshow", - "options": "Website Slideshow", - "permlevel": 0, + "depends_on": "show_in_website", + "description": "Show a slideshow at the top of the page", + "fieldname": "slideshow", + "fieldtype": "Link", + "label": "Slideshow", + "options": "Website Slideshow", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "description": "Item Image (if not slideshow)", - "fieldname": "website_image", - "fieldtype": "Select", - "label": "Image", - "options": "attach_files:", - "permlevel": 0, + "depends_on": "show_in_website", + "description": "Item Image (if not slideshow)", + "fieldname": "website_image", + "fieldtype": "Attach", + "label": "Image", + "options": "", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "cb72", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "cb72", + "fieldtype": "Column Break", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.", - "fieldname": "website_warehouse", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Website Warehouse", - "options": "Warehouse", - "permlevel": 0, + "depends_on": "show_in_website", + "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.", + "fieldname": "website_warehouse", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Website Warehouse", + "options": "Warehouse", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "description": "List this Item in multiple groups on the website.", - "fieldname": "website_item_groups", - "fieldtype": "Table", - "label": "Website Item Groups", - "options": "Website Item Group", - "permlevel": 0, + "depends_on": "show_in_website", + "description": "List this Item in multiple groups on the website.", + "fieldname": "website_item_groups", + "fieldtype": "Table", + "label": "Website Item Groups", + "options": "Website Item Group", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "fieldname": "sb72", - "fieldtype": "Section Break", - "permlevel": 0, + "depends_on": "show_in_website", + "fieldname": "sb72", + "fieldtype": "Section Break", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "fieldname": "copy_from_item_group", - "fieldtype": "Button", - "label": "Copy From Item Group", - "permlevel": 0, + "depends_on": "show_in_website", + "fieldname": "copy_from_item_group", + "fieldtype": "Button", + "label": "Copy From Item Group", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "fieldname": "website_specifications", - "fieldtype": "Table", - "label": "Website Specifications", - "options": "Item Website Specification", - "permlevel": 0, + "depends_on": "show_in_website", + "fieldname": "website_specifications", + "fieldtype": "Table", + "label": "Website Specifications", + "options": "Item Website Specification", + "permlevel": 0, "read_only": 0 - }, + }, { - "depends_on": "show_in_website", - "fieldname": "web_long_description", - "fieldtype": "Text Editor", - "label": "Website Description", - "permlevel": 0, + "depends_on": "show_in_website", + "fieldname": "web_long_description", + "fieldtype": "Text Editor", + "label": "Website Description", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "parent_website_route", - "fieldtype": "Read Only", - "ignore_user_permissions": 1, - "label": "Parent Website Route", - "no_copy": 1, - "options": "", + "fieldname": "parent_website_route", + "fieldtype": "Read Only", + "ignore_user_permissions": 1, + "label": "Parent Website Route", + "no_copy": 1, + "options": "", "permlevel": 0 } - ], - "icon": "icon-tag", - "idx": 1, - "max_attachments": 1, - "modified": "2015-02-18 04:38:59.061328", - "modified_by": "Administrator", - "module": "Stock", - "name": "Item", - "owner": "Administrator", + ], + "icon": "icon-tag", + "idx": 1, + "max_attachments": 1, + "modified": "2015-02-19 09:24:59.397525", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item", + "owner": "Administrator", "permissions": [ { - "create": 1, - "delete": 1, - "email": 1, - "import": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Material Master Manager", - "share": 1, - "submit": 0, + "create": 1, + "delete": 1, + "email": 1, + "import": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "share": 1, + "submit": 0, "write": 1 - }, + }, { - "amend": 0, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Material Manager", - "submit": 0, + "amend": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 0, "write": 0 - }, + }, { - "amend": 0, - "apply_user_permissions": 1, - "create": 0, - "delete": 0, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Material User", - "submit": 0, + "amend": 0, + "apply_user_permissions": 1, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, "write": 0 - }, + }, { - "apply_user_permissions": 1, - "permlevel": 0, - "read": 1, + "apply_user_permissions": 1, + "permlevel": 0, + "read": 1, "role": "Sales User" - }, + }, { - "apply_user_permissions": 1, - "permlevel": 0, - "read": 1, + "apply_user_permissions": 1, + "permlevel": 0, + "read": 1, "role": "Purchase User" - }, + }, { - "apply_user_permissions": 1, - "permlevel": 0, - "read": 1, + "apply_user_permissions": 1, + "permlevel": 0, + "read": 1, "role": "Maintenance User" - }, + }, { - "apply_user_permissions": 1, - "permlevel": 0, - "read": 1, + "apply_user_permissions": 1, + "permlevel": 0, + "read": 1, "role": "Accounts User" - }, + }, { - "apply_user_permissions": 1, - "permlevel": 0, - "read": 1, + "apply_user_permissions": 1, + "permlevel": 0, + "read": 1, "role": "Manufacturing User" } - ], - "search_fields": "item_name,description,item_group,customer_code", + ], + "search_fields": "item_name,description,item_group,customer_code", "title_field": "item_name" -} +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 789cbbfca4..8988ca32b9 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -246,8 +246,6 @@ class Item(WebsiteGenerator): for attr in template.variant_attributes[variant.item_code]: variant.description += "\n" + attr[0] + ": " + attr[1] - if variant.description_html: - variant.description_html += "
" + attr[0] + ": " + attr[1] + "
" variant.variant_of = template.name variant.has_variants = 0 variant.show_in_website = 0 diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js index 7f4cf16972..04367218dc 100644 --- a/erpnext/stock/doctype/item/item_list.js +++ b/erpnext/stock/doctype/item/item_list.js @@ -1,3 +1,10 @@ frappe.listview_settings['Item'] = { - add_fields: ["item_name", "stock_uom", "item_group", "image"] + add_fields: ["item_name", "stock_uom", "item_group", "image", "variant_of", "has_variants"], + get_indicator: function(doc) { + if(doc.has_variants) { + return [__("Template"), "blue", "has_variant,=,1"] + } else if(doc.variant_of) { + return [__("Variant"), "green", "variant_of,=," + doc.variant_of] + } + } }; diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 8d9f405be1..98f9faed9e 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -63,6 +63,7 @@ class StockEntry(StockController): self.validate_return_reference_doc() self.validate_with_material_request() #self.validate_valuation_rate() + self.set_total_incoming_outgoing_value() self.set_total_amount() def on_submit(self): diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 0f63a643ea..5f70c49ffb 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -106,6 +106,7 @@ class update_entries_after(object): self.build() def build(self): + # includes current entry! entries_to_fix = self.get_sle_after_datetime() for sle in entries_to_fix: @@ -169,7 +170,6 @@ class update_entries_after(object): self.qty_after_transaction += flt(sle.actual_qty) self.stock_value = sum((flt(batch[0]) * flt(batch[1]) for batch in self.stock_queue)) - # rounding as per precision self.stock_value = flt(self.stock_value, self.precision) @@ -179,6 +179,7 @@ class update_entries_after(object): # update current sle sle.qty_after_transaction = self.qty_after_transaction sle.valuation_rate = self.valuation_rate + sle.stock_value = self.stock_value sle.stock_queue = json.dumps(self.stock_queue) sle.stock_value_difference = stock_value_difference sle.doctype="Stock Ledger Entry" @@ -252,14 +253,18 @@ class update_entries_after(object): if not self.stock_queue: self.stock_queue.append([0, 0]) - if self.stock_queue[-1][0] > 0: - self.stock_queue.append([actual_qty, incoming_rate]) + # last row has the same rate, just updated the qty + if self.stock_queue[-1][1]==incoming_rate: + self.stock_queue[-1][0] += actual_qty else: - qty = self.stock_queue[-1][0] + actual_qty - if qty == 0: - self.stock_queue.pop(-1) + if self.stock_queue[-1][0] > 0: + self.stock_queue.append([actual_qty, incoming_rate]) else: - self.stock_queue[-1] = [qty, incoming_rate] + qty = self.stock_queue[-1][0] + actual_qty + if qty == 0: + self.stock_queue.pop(-1) + else: + self.stock_queue[-1] = [qty, incoming_rate] else: qty_to_pop = abs(actual_qty) while qty_to_pop: @@ -299,7 +304,9 @@ class update_entries_after(object): def get_sle_after_datetime(self): """get Stock Ledger Entries after a particular datetime, for reposting""" - return get_stock_ledger_entries(self.previous_sle or self.args, ">", "asc", for_update=True) + return get_stock_ledger_entries(self.previous_sle or frappe._dict({ + "item_code": self.args.get("item_code"), "warehouse": self.args.get("warehouse") }), + ">", "asc", for_update=True) def raise_exceptions(self): deficiency = min(e["diff"] for e in self.exceptions) @@ -329,7 +336,7 @@ def get_previous_sle(args, for_update=False): sle = get_stock_ledger_entries(args, "<=", "desc", "limit 1", for_update=for_update) return sle and sle[0] or {} -def get_stock_ledger_entries(previous_sle, operator=None, order="desc", limit=None, for_update=False): +def get_stock_ledger_entries(previous_sle, operator=None, order="desc", limit=None, for_update=False, debug=False): """get stock ledger entries filtered by specific posting datetime conditions""" conditions = "timestamp(posting_date, posting_time) {0} timestamp(%(posting_date)s, %(posting_time)s)".format(operator) if not previous_sle.get("posting_date"): @@ -351,7 +358,7 @@ def get_stock_ledger_entries(previous_sle, operator=None, order="desc", limit=No "limit": limit or "", "for_update": for_update and "for update" or "", "order": order - }, previous_sle, as_dict=1) + }, previous_sle, as_dict=1, debug=debug) def get_valuation_rate(item_code, warehouse, allow_zero_rate=False): last_valuation_rate = frappe.db.sql("""select valuation_rate diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html index 6bd5d48e8b..2a1a671c63 100644 --- a/erpnext/templates/form_grid/item_grid.html +++ b/erpnext/templates/form_grid/item_grid.html @@ -9,43 +9,57 @@ {% } else { %}
-
{%= doc.item_code %} - {% if(doc.item_name != doc.item_code) { %} -
{%= doc.item_name %}{% } %} - {% if(doc.item_name != doc.description) { %} -

{%= doc.description %}

{% } %} -

- {% if(doc.sales_order || doc.against_sales_order) { %} - - - {%= doc.sales_order || doc.against_sales_order %} - - {% } %} - {% if(doc.warehouse) { - var label_class = "label-default", - title = "Warehouse", - actual_qty = (doc.doctype==="Sales Order" - ? doc.projected_qty : doc.actual_qty); +

+ {% if(doc.warehouse) { + var label_class = "label-default", + title = "Warehouse", + actual_qty = (frm.doc.doctype==="Sales Order" + ? doc.projected_qty : doc.actual_qty); + if(flt(frm.doc.per_delivered) < 100 + && in_list(["Sales Order Item", "Delivery Note Item"], doc.doctype)) { if(actual_qty != undefined) { if(actual_qty > doc.qty) { var label_class = "label-success"; var title = "In Stock" } else { + var label_class = "label-danger"; var title = "Not In Stock" } } - %} - - - {%= doc.warehouse %} - - - {% } %} -

+ } %} + + + {%= doc.warehouse %} + + + {% } %} + + {% if(in_list(["Sales Order Item", "Purchase Order Item"], + doc.doctype) && frm.doc.docstatus===1) { + var delivered = doc.doctype==="Sales Order Item" ? + doc.delivered_qty : doc.received_qty, + pending = flt(doc.qty) - flt(delivered); + %} + {%= doc.item_code %} + {% } else { %} + {%= doc.item_code %} + {% } %} + + {% if(doc.item_name != doc.item_code) { %} +
{%= doc.item_name %}{% } %} + + {% include "templates/form_grid/includes/visible_cols.html" %} - {% if(doc.schedule_date) { %} +
@@ -99,16 +103,6 @@ {%= doc.get_formatted("amount") %} {% } %} - {% if(in_list(["Sales Order Item", "Purchase Order Item"], - doc.doctype) && frm.doc.docstatus===1 && doc.amount) { - var completed = - 100 - cint((flt(doc.amount) - flt(doc.billed_amt)) * 100 / flt(doc.amount)), - title = __("Billed"); - %} -
  - {% include "templates/form_grid/includes/progress.html" %} - {% } %} - {% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %}
{%= doc.get_formatted("qty") %} {%= doc.uom || doc.stock_uom %} diff --git a/erpnext/templates/form_grid/material_request_grid.html b/erpnext/templates/form_grid/material_request_grid.html index 812245a8c1..be7fb29387 100644 --- a/erpnext/templates/form_grid/material_request_grid.html +++ b/erpnext/templates/form_grid/material_request_grid.html @@ -3,43 +3,47 @@ {% if(!doc) { %}
-
{%= __("Item") %}
-
{%= __("Qty") %}
+
{%= __("Item") %}
+
{%= __("Required On") %}
+
{%= __("Warehouse") %}
+
{%= __("Qty") %}
{% } else { %}
-
{%= doc.item_code %} +
+ {%= doc.item_code %} {% if(doc.item_name != doc.item_code) { %}
{%= doc.item_name %}{% } %} - {% if(doc.item_name != doc.description) { %} -

{%= doc.description %}

{% } %} -
+ + {% include "templates/form_grid/includes/visible_cols.html" %} +
+ + +
+ {% if(doc.schedule_date) { %} + + {%= doc.get_formatted("schedule_date") %} + {% } %} +
+ + +
{% if(doc.warehouse) { %} {%= doc.warehouse %} {% } %} - {% if(doc.schedule_date) { %} - - {%= doc.get_formatted("schedule_date") %} - {% } %} -
- {% include "templates/form_grid/includes/visible_cols.html" %} -
+
-
+
{%= doc.get_formatted("qty") %} -
{%= doc.uom || doc.stock_uom %}
- {% if(doc.qty == doc.ordered_qty) { %} -
{%= __("Ordered") %}
- {% } else { %} -
{%= __("{0} Ordered", doc.ordered_qty) %}
- {% } %} + {%= doc.uom || doc.stock_uom %}
{% } %} diff --git a/erpnext/templates/form_grid/stock_entry_grid.html b/erpnext/templates/form_grid/stock_entry_grid.html index 089a6e84e2..2527ef3b2f 100644 --- a/erpnext/templates/form_grid/stock_entry_grid.html +++ b/erpnext/templates/form_grid/stock_entry_grid.html @@ -15,8 +15,8 @@
{%= doc.item_code %} {% if(doc.item_name != doc.item_code) { %}
{%= doc.item_name %}{% } %} - {% if(doc.item_name != doc.description) { %} -

{%= doc.description %}

{% } %} + {% include "templates/form_grid/includes/visible_cols.html" %} {% if(frm.doc.docstatus==0 && doc.s_warehouse && doc.actual_qty < doc.qty) { %} @@ -28,10 +28,10 @@
{% if(doc.s_warehouse) { %} - + {%= doc.s_warehouse || "" %} {% } %} - {% if(doc.t_warehouse) { %} + {% if(doc.t_warehouse) { %} {%= doc.t_warehouse || "" %}{% } %}
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index e8015bd3d1..020455f171 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -49,7 +49,7 @@ class TransactionBase(StatusUpdater): }) if frappe.db.exists("User", self.contact_by): - frappe.share("Event", event.name, self.contact_by) + frappe.share.add("Event", event.name, self.contact_by) event.insert(ignore_permissions=True)