From 13bf123b24d9285a5ba9ffe10eaec9b03b65739f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Jan 2016 17:50:40 +0530 Subject: [PATCH] [hotfix] item on web --- erpnext/stock/doctype/item/item.py | 2 +- .../stock_reconciliation/stock_reconciliation.py | 12 ++++++------ erpnext/templates/generators/item.html | 4 ++++ erpnext/templates/generators/item_group.html | 4 ++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 6a3cf6fed1..80cba88365 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -35,7 +35,7 @@ class Item(WebsiteGenerator): if not self.item_code: item_code_suffix = "" for attribute in self.attributes: - attribute_abbr = frappe.db.get_value("Item Attribute Value", + attribute_abbr = frappe.db.get_value("Item Attribute Value", {"parent": attribute.attribute, "attribute_value": attribute.attribute_value}, "abbr") item_code_suffix += "-" + str(attribute_abbr or attribute.attribute_value) self.item_code = str(self.variant_of) + item_code_suffix diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index b0aff019f5..0d9be9b5d5 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -125,7 +125,7 @@ class StockReconciliation(StockController): for msg in self.validation_messages: msgprint(msg) - raise frappe.ValidationError + raise frappe.ValidationError(self.validation_messages) def validate_item(self, item_code, row_num): from erpnext.stock.doctype.item.item import validate_end_of_life, \ @@ -250,15 +250,15 @@ class StockReconciliation(StockController): @frappe.whitelist() def get_items(warehouse, posting_date, posting_time): items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1) - - items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0, + + items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0, "has_batch_no": 0, "has_variants": 0, "default_warehouse": warehouse}, as_list=1) - + res = [] for item in set(items): - stock_bal = get_stock_balance(item[0], warehouse, posting_date, posting_time, + stock_bal = get_stock_balance(item[0], warehouse, posting_date, posting_time, with_valuation_rate=True) - + res.append({ "item_code": item[0], "warehouse": warehouse, diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html index 8a2dcf2af3..dc48e0df12 100644 --- a/erpnext/templates/generators/item.html +++ b/erpnext/templates/generators/item.html @@ -8,6 +8,10 @@ {% include 'templates/includes/product_search_box.html' %} {% endblock %} +{% block breadcrumbs %} + {% include "templates/includes/breadcrumbs.html" %} +{% endblock %} + {% block page_content %} {% from "erpnext/templates/includes/macros.html" import product_image %}
diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html index 2cfb934660..eb1278c91d 100644 --- a/erpnext/templates/generators/item_group.html +++ b/erpnext/templates/generators/item_group.html @@ -4,6 +4,10 @@ {% include 'templates/includes/product_search_box.html' %} {% endblock %} +{% block breadcrumbs %} + {% include "templates/includes/breadcrumbs.html" %} +{% endblock %} + {% block page_content %}