From a6bc583daf96e6bdc4ab00961b29c9b3930bf72a Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 8 May 2017 11:35:40 +0530 Subject: [PATCH 1/6] [minor] item route is item name + code --- erpnext/stock/doctype/item/item.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 6a9fd24900..584541ff08 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -142,7 +142,8 @@ class Item(WebsiteGenerator): def make_route(self): if not self.route: - return cstr(frappe.db.get_value('Item Group', self.item_group, 'route')) + '/' + self.scrub(self.name) + return cstr(frappe.db.get_value('Item Group', self.item_group, + 'route')) + '/' + self.scrub(self.item_code + '-' + self.name) def get_parents(self, context): item_group, route = frappe.db.get_value('Item Group', self.item_group, ['name', 'route']) From 9df45bbc427a5c559abe29edc39a49193d57525c Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 8 May 2017 17:24:23 +0530 Subject: [PATCH 2/6] [fix] Reference Document is required to create Payment Request (#8729) * [fix] Referene Document is required to create Payment Request * Update payment_request.py --- .../payment_request/payment_request.json | 30 +++++++++++++++++-- .../payment_request/payment_request.py | 5 ++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json index c1580f6ef2..738206cdb0 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.json +++ b/erpnext/accounts/doctype/payment_request/payment_request.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "autoname": "naming_series:", @@ -13,6 +14,7 @@ "engine": "InnoDB", "fields": [ { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -43,6 +45,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -72,6 +75,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -103,6 +107,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -132,6 +137,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -161,6 +167,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -189,6 +196,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -219,6 +227,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -249,6 +258,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -280,6 +290,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -311,6 +322,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -341,6 +353,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -369,6 +382,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -398,6 +412,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -428,6 +443,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -457,6 +473,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -486,6 +503,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -516,6 +534,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -546,6 +565,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -576,6 +596,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -605,6 +626,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -635,6 +657,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -665,6 +688,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -694,17 +718,17 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, - "in_create": 0, - "in_dialog": 0, + "in_create": 1, "is_submittable": 1, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-02-23 05:03:37.464863", + "modified": "2017-05-08 12:09:25.759145", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Request", diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index fdb598e55e..4694ef8306 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -14,9 +14,14 @@ from frappe.integrations.utils import get_payment_gateway_controller class PaymentRequest(Document): def validate(self): + self.validate_reference_document() self.validate_payment_request() self.validate_currency() + def validate_reference_document(self): + if not self.reference_doctype or not self.reference_name: + frappe.throw(_("To create a Payment Request reference document is required")) + def validate_payment_request(self): if frappe.db.get_value("Payment Request", {"reference_name": self.reference_name, "name": ("!=", self.name), "status": ("not in", ["Initiated", "Paid"]), "docstatus": 1}, "name"): From 226ea7db8883e9e014f2ade9438de771291eef9a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 8 May 2017 17:34:07 +0530 Subject: [PATCH 3/6] Filter issue on timesheet calendar view (#8730) --- erpnext/projects/doctype/timesheet/timesheet.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 490a70721a..154f0d0f20 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -382,9 +382,13 @@ def get_events(start, end, filters=None): def get_conditions(filters): conditions = [] - abbr = {'employee': 'tabTimesheet', 'project': 'tabTimesheet Detail'} for key in filters: if filters.get(key): - conditions.append("`%s`.%s = '%s'"%(abbr.get(key), key, filters.get(key))) + if frappe.get_meta("Timesheet").has_field(key): + dt = 'tabTimesheet' + elif frappe.get_meta("Timesheet Detail").has_field(key): + dt = 'tabTimesheet Detail' + + conditions.append("`%s`.%s = '%s'"%(dt, key, filters.get(key))) return " and {}".format(" and ".join(conditions)) if conditions else "" From 95233a62d76fd74f82813d9d30845e89b6433dba Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 9 May 2017 07:48:23 +0530 Subject: [PATCH 4/6] [minor] item route item_name + random string --- erpnext/stock/doctype/item/item.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 584541ff08..9b9eb63050 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -7,7 +7,8 @@ import erpnext import json import itertools from frappe import msgprint, _ -from frappe.utils import cstr, flt, cint, getdate, now_datetime, formatdate, strip, get_timestamp +from frappe.utils import (cstr, flt, cint, getdate, now_datetime, formatdate, + strip, get_timestamp, random_string) from frappe.website.website_generator import WebsiteGenerator from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for, get_parent_item_groups from frappe.website.render import clear_cache @@ -143,7 +144,7 @@ class Item(WebsiteGenerator): def make_route(self): if not self.route: return cstr(frappe.db.get_value('Item Group', self.item_group, - 'route')) + '/' + self.scrub(self.item_code + '-' + self.name) + 'route')) + '/' + self.scrub(self.item_name + '-' + random_string(5)) def get_parents(self, context): item_group, route = frappe.db.get_value('Item Group', self.item_group, ['name', 'route']) From 4e6ff8ccd82fe90a9b4619a66b78460fa8968514 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 9 May 2017 15:09:10 +0530 Subject: [PATCH 5/6] Ignore permission for Bin in warehouse query (#8742) --- erpnext/controllers/queries.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 81c9defb46..2f98e865bc 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -360,8 +360,8 @@ def warehouse_query(doctype, txt, searchfield, start, page_len, filters): sub_query = """ select round(`tabBin`.actual_qty, 2) from `tabBin` where `tabBin`.warehouse = `tabWarehouse`.name {bin_conditions} """.format( - bin_conditions=get_filters_cond(doctype, filter_dict.get("Bin"), bin_conditions), - ignore_permissions=True) + bin_conditions=get_filters_cond(doctype, filter_dict.get("Bin"), + bin_conditions, ignore_permissions=True)) response = frappe.db.sql("""select `tabWarehouse`.name, CONCAT_WS(" : ", "Actual Qty", ifnull( ({sub_query}), 0) ) as actual_qty From 70e17787129da837d710a275ed69a1bb438f9a6e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 9 May 2017 15:43:32 +0600 Subject: [PATCH 6/6] bumped to version 8.0.24 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 9e586b53a7..693c9bee1b 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.0.23' +__version__ = '8.0.24' def get_default_company(user=None): '''Get default company for user'''