From 5906f02e3acbba07539cf1f6e8c5f191def983ca Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 Jul 2015 17:50:27 +0530 Subject: [PATCH 1/3] update item image in invoice if item exists --- erpnext/patches/v5_0/update_item_desc_in_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v5_0/update_item_desc_in_invoice.py b/erpnext/patches/v5_0/update_item_desc_in_invoice.py index 4e2cd26e9d..1f74184a98 100644 --- a/erpnext/patches/v5_0/update_item_desc_in_invoice.py +++ b/erpnext/patches/v5_0/update_item_desc_in_invoice.py @@ -31,7 +31,9 @@ def execute(): desc, image = extract_image_and_description(cstr(d.description)) if not image: - image = item_details.get(d.item_code).image + item_detail = item_details.get(d.item_code) + if item_detail: + image = item_detail.image frappe.db.sql("""update `tab{0}` set description = %s, image = %s where name = %s """.format(dt), (desc, image, d.name)) From fcee17fd16dc11d1ff00a23aecf0d461550fc1a3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 Jul 2015 17:51:22 +0530 Subject: [PATCH 2/3] Removed purchase item validation --- erpnext/stock/doctype/item/item.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index ccb0fab9a1..a2e0ade50c 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -174,15 +174,6 @@ class Item(WebsiteGenerator): if bom_item not in (self.name, self.variant_of): frappe.throw(_("Default BOM ({0}) must be active for this item or its template").format(bom_item)) - if self.is_purchase_item != "Yes": - bom_mat = frappe.db.sql("""select distinct t1.parent - from `tabBOM Item` t1, `tabBOM` t2 where t2.name = t1.parent - and t1.item_code =%s and ifnull(t1.bom_no, '') = '' and t2.is_active = 1 - and t2.docstatus = 1 and t1.docstatus =1 """, self.name) - - if bom_mat and bom_mat[0][0]: - frappe.throw(_("Item must be a purchase item, as it is present in one or many Active BOMs")) - def fill_customer_code(self): """ Append all the customer codes and insert into "customer_code" field of item table """ cust_code=[] From 37c6ce7b1eed954932adf5a61c8ad4783455e7f2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 Jul 2015 18:28:40 +0600 Subject: [PATCH 3/3] bumped to version 5.1.2 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index a71e77b33c..1d65332e75 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '5.1.1' +__version__ = '5.1.2' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 616184570e..b2ae87b221 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors" app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "5.1.1" +app_version = "5.1.2" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index 774c07b9d4..8820356c6c 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.1.1" +version = "5.1.2" with open("requirements.txt", "r") as f: install_requires = f.readlines()