From 204af3ce90aa8409d66267d3797639170f4a53a1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 11 Dec 2015 15:00:32 +0530 Subject: [PATCH 1/4] [fix] Ignore user permission in target warehouse in SO --- .../sales_order_item/sales_order_item.json | 58 ++++++++++++++++++- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json index 693863c809..823b805bf6 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json @@ -26,6 +26,7 @@ "options": "Item", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "150px", "read_only": 0, "report_hide": 0, @@ -50,6 +51,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -71,6 +73,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -95,6 +98,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "150", "read_only": 0, "report_hide": 0, @@ -120,6 +124,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -144,6 +149,7 @@ "oldfieldtype": "Small Text", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "300px", "read_only": 0, "report_hide": 0, @@ -168,6 +174,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -191,6 +198,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -215,6 +223,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -237,6 +246,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -261,6 +271,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 0, "report_hide": 0, @@ -288,6 +299,7 @@ "options": "currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "70px", "read_only": 1, "report_hide": 0, @@ -315,6 +327,7 @@ "oldfieldtype": "Float", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "70px", "read_only": 0, "report_hide": 0, @@ -338,6 +351,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -363,6 +377,7 @@ "options": "UOM", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "70px", "read_only": 1, "report_hide": 0, @@ -390,6 +405,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -413,6 +429,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -438,6 +455,7 @@ "options": "currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 0, "report_hide": 0, @@ -465,6 +483,7 @@ "options": "currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -488,6 +507,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -513,6 +533,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -540,6 +561,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -565,6 +587,7 @@ "options": "Pricing Rule", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -587,6 +610,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -611,6 +635,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -635,6 +660,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -657,6 +683,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -681,6 +708,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -705,6 +733,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -729,6 +758,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -752,6 +782,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -776,6 +807,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -798,6 +830,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -824,6 +857,7 @@ "options": "Warehouse", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "150px", "read_only": 0, "report_hide": 0, @@ -841,7 +875,7 @@ "fieldname": "target_warehouse", "fieldtype": "Link", "hidden": 0, - "ignore_user_permissions": 0, + "ignore_user_permissions": 1, "in_filter": 0, "in_list_view": 0, "label": "Target Warehouse", @@ -851,6 +885,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -876,6 +911,7 @@ "options": "Quotation", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -901,6 +937,7 @@ "options": "Brand", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -927,6 +964,7 @@ "options": "Item Group", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -951,6 +989,7 @@ "oldfieldtype": "Check", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 1, "reqd": 0, @@ -972,6 +1011,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -996,6 +1036,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "70px", "read_only": 1, "report_hide": 0, @@ -1020,6 +1061,7 @@ "no_copy": 1, "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "70px", "read_only": 1, "report_hide": 0, @@ -1045,6 +1087,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1069,6 +1112,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -1095,6 +1139,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1118,6 +1163,7 @@ "options": "currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1143,6 +1189,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "50px", "read_only": 1, "report_hide": 1, @@ -1170,6 +1217,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "50px", "read_only": 1, "report_hide": 1, @@ -1196,6 +1244,7 @@ "oldfieldtype": "Small Text", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 1, "reqd": 0, @@ -1221,6 +1270,7 @@ "oldfieldtype": "Date", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 1, "reqd": 0, @@ -1238,7 +1288,8 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2015-11-16 06:29:56.933782", + "menu_index": 0, + "modified": "2015-12-11 14:53:24.444343", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Item", @@ -1247,5 +1298,6 @@ "read_only": 0, "read_only_onload": 0, "sort_field": "modified", - "sort_order": "DESC" + "sort_order": "DESC", + "version": 0 } \ No newline at end of file From 66c9940d73dbdf0c18833dc3bb8924a12084f91c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 11 Dec 2015 15:02:58 +0530 Subject: [PATCH 2/4] [fix] [validation] website url should be public --- erpnext/stock/doctype/item/item.py | 36 +++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 489b1bda41..c3c9671ca9 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -89,23 +89,29 @@ class Item(WebsiteGenerator): auto_set_website_image = True self.website_image = self.image - if self.website_image: - file = frappe.db.get_value("File", filters={ - "file_url": self.website_image, - "attached_to_doctype": self.doctype, - "attached_to_name": self.name - }, fieldname=["name", "is_private"], as_dict=True) + if not self.website_image: + return - if not file: - if not auto_set_website_image: - frappe.msgprint(_("Website Image {0} attached to Item {1} cannot be found") - .format(self.website_image, self.name)) - self.website_image = None + # find if website image url exists as public + file = frappe.get_all("File", filters={ + "file_url": self.website_image + }, fields=["name", "is_private"], order_by="is_private asc", limit_poge_length=1) - elif file.is_private: - self.website_image = None - if not auto_set_website_image: - frappe.msgprint(_("Website Image should be a public file or website URL")) + if file: + file = file[0] + + if not file: + if not auto_set_website_image: + frappe.msgprint(_("Website Image {0} attached to Item {1} cannot be found") + .format(self.website_image, self.name)) + + self.website_image = None + + elif file.is_private: + if not auto_set_website_image: + frappe.msgprint(_("Website Image should be a public file or website URL")) + + self.website_image = None def make_thumbnail(self): """Make a thumbnail of `website_image`""" From 695d09f9cd22d10232f910312eb0c0ef222142bc Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 11 Dec 2015 15:03:26 +0530 Subject: [PATCH 3/4] [fix] typo --- erpnext/stock/doctype/item/item.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index c3c9671ca9..0fc0faae4e 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -95,7 +95,7 @@ class Item(WebsiteGenerator): # find if website image url exists as public file = frappe.get_all("File", filters={ "file_url": self.website_image - }, fields=["name", "is_private"], order_by="is_private asc", limit_poge_length=1) + }, fields=["name", "is_private"], order_by="is_private asc", limit_page_length=1) if file: file = file[0] From 660f479ec83518099cd3752d881521bfabdaf577 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 11 Dec 2015 15:36:29 +0600 Subject: [PATCH 4/4] bumped to version 6.12.11 --- 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 f658272dbc..3341e10a43 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '6.12.10' +__version__ = '6.12.11' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 503a6a7d5f..1d33388008 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.12.10" +app_version = "6.12.11" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" diff --git a/setup.py b/setup.py index cb5dc39c7b..c98dcfd98a 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages from pip.req import parse_requirements -version = "6.12.10" +version = "6.12.11" requirements = parse_requirements("requirements.txt", session="") setup(