From 492aff2a8b5a91df74a7f3f839de45a336b9fb9d Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 17 Apr 2018 14:21:40 +0530 Subject: [PATCH 01/13] [fix] check if academic_year exists (#13665) --- .../doctype/student_group/student_group.js | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/erpnext/education/doctype/student_group/student_group.js b/erpnext/education/doctype/student_group/student_group.js index f3f8c88624..5373df9124 100644 --- a/erpnext/education/doctype/student_group/student_group.js +++ b/erpnext/education/doctype/student_group/student_group.js @@ -82,36 +82,39 @@ frappe.ui.form.on("Student Group", { max_roll_no = d.group_roll_number; } }); - frappe.call({ - method: "erpnext.education.doctype.student_group.student_group.get_students", - args: { - "academic_year": frm.doc.academic_year, - "academic_term": frm.doc.academic_term, - "group_based_on": frm.doc.group_based_on, - "program": frm.doc.program, - "batch" : frm.doc.batch, - "course": frm.doc.course - }, - callback: function(r) { - if(r.message) { - $.each(r.message, function(i, d) { - if(!in_list(student_list, d.student)) { - var s = frm.add_child("students"); - s.student = d.student; - s.student_name = d.student_name; - if (d.active === 0) { - s.active = 0; + + if(frm.doc.academic_year) { + frappe.call({ + method: "erpnext.education.doctype.student_group.student_group.get_students", + args: { + "academic_year": frm.doc.academic_year, + "academic_term": frm.doc.academic_term, + "group_based_on": frm.doc.group_based_on, + "program": frm.doc.program, + "batch" : frm.doc.batch, + "course": frm.doc.course + }, + callback: function(r) { + if(r.message) { + $.each(r.message, function(i, d) { + if(!in_list(student_list, d.student)) { + var s = frm.add_child("students"); + s.student = d.student; + s.student_name = d.student_name; + if (d.active === 0) { + s.active = 0; + } + s.group_roll_number = ++max_roll_no; } - s.group_roll_number = ++max_roll_no; - } - }); - refresh_field("students"); - frm.save(); - } else { - frappe.msgprint(__("Student Group is already updated.")) + }); + refresh_field("students"); + frm.save(); + } else { + frappe.msgprint(__("Student Group is already updated.")) + } } - } - }) + }) + } } else { frappe.msgprint(__("Select students manually for the Activity based Group")); } From 46ffbb74ff4ca4af66da729bad505cdf6f907345 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 17 Apr 2018 20:44:37 +0530 Subject: [PATCH 02/13] fix cheque print measurements --- .../doctype/cheque_print_template/cheque_print_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py index 5b7d73f2bd..0556e9b992 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py @@ -29,11 +29,11 @@ def create_or_update_cheque_print_format(template_name): cheque_print.html = """
- %(message_to_show)s - {{ frappe.utils.formatdate(doc.reference_date) or '' }} From 2476a8aab91498d5a80e2da8b1b0e56794021a31 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 17 Apr 2018 20:45:06 +0530 Subject: [PATCH 03/13] a[fix] check content before making in condition --- .../report/stock_balance/stock_balance.py | 28 +++++++++++-------- .../stock/report/stock_ledger/stock_ledger.py | 5 +++- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 45035f25eb..3e05716af5 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -200,13 +200,14 @@ def get_item_details(items, sle, filters): item_details = {} if not items: items = list(set([d.item_code for d in sle])) - - for item in frappe.db.sql(""" - select name, item_name, description, item_group, brand, stock_uom - from `tabItem` - where name in ({0}) - """.format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])), as_dict=1): - item_details.setdefault(item.name, item) + + if items: + for item in frappe.db.sql(""" + select name, item_name, description, item_group, brand, stock_uom + from `tabItem` + where name in ({0}) + """.format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])), as_dict=1): + item_details.setdefault(item.name, item) if filters.get('show_variant_attributes', 0) == 1: variant_values = get_variant_values_for(item_details.keys()) @@ -215,11 +216,14 @@ def get_item_details(items, sle, filters): return item_details def get_item_reorder_details(items): - item_reorder_details = frappe.db.sql(""" - select parent, warehouse, warehouse_reorder_qty, warehouse_reorder_level - from `tabItem Reorder` - where parent in ({0}) - """.format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])), as_dict=1) + item_reorder_details = frappe._dict() + + if items: + item_reorder_details = frappe.db.sql(""" + select parent, warehouse, warehouse_reorder_qty, warehouse_reorder_level + from `tabItem Reorder` + where parent in ({0}) + """.format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])), as_dict=1) return dict((d.parent + d.warehouse, d) for d in item_reorder_details) diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py index 5e185e0533..e29f50a549 100644 --- a/erpnext/stock/report/stock_ledger/stock_ledger.py +++ b/erpnext/stock/report/stock_ledger/stock_ledger.py @@ -93,11 +93,14 @@ def get_item_details(items, sl_entries): if not items: items = list(set([d.item_code for d in sl_entries])) + if not items: + return item_details + for item in frappe.db.sql(""" select name, item_name, description, item_group, brand, stock_uom from `tabItem` where name in ({0}) - """.format(', '.join(['"' + frappe.db.escape(i,percent=False) + '"' for i in items])), as_dict=1): + """.format(', '.join(['"' + frappe.db.escape(i,percent=False) + '"' for i in items])), as_dict=1, debug=1): item_details.setdefault(item.name, item) return item_details From 59f7b8c4a122a00eceb3893adf70cf8f965df639 Mon Sep 17 00:00:00 2001 From: Zarrar Date: Wed, 18 Apr 2018 16:26:02 +0530 Subject: [PATCH 04/13] issue routing to report (#13710) --- erpnext/accounts/doctype/account/account_tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index 9f06ada260..fe1977c16e 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -71,7 +71,7 @@ frappe.treeview_settings["Account"] = { // financial statements for (let report of ['Trial Balance', 'General Ledger', 'Balance Sheet', - 'Profit and Loss', 'Cash Flow Statement', 'Accounts Payable', 'Accounts Receivable']) { + 'Profit and Loss Statement', 'Cash Flow Statement', 'Accounts Payable', 'Accounts Receivable']) { treeview.page.add_inner_button(__(report), function() { frappe.set_route('query-report', report, {company: get_company()}); }, __('Financial Statements')); From 91b0dce4d8e838c17bbb7bc7ff41913650641a45 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Wed, 18 Apr 2018 16:27:04 +0530 Subject: [PATCH 05/13] removed bad code and made compatible with pip 10 (#13685) --- setup.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index c293fb82d0..3c19b2b293 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,13 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages -try: # for pip >= 10 - from pip._internal.req import parse_requirements -except ImportError: # for pip <= 9.0.3 - from pip.req import parse_requirements import re, ast # get version from __version__ variable in erpnext/__init__.py _version_re = re.compile(r'__version__\s+=\s+(.*)') +with open('requirements.txt') as f: + install_requires = f.read().strip().split('\n') + with open('erpnext/__init__.py', 'rb') as f: version = str(ast.literal_eval(_version_re.search( f.read().decode('utf-8')).group(1))) @@ -24,6 +23,5 @@ setup( packages=find_packages(), zip_safe=False, include_package_data=True, - install_requires=[str(ir.req) for ir in requirements], - dependency_links=[str(ir._link) for ir in requirements if ir._link] + install_requires=install_requires ) From ff8f1bc88e21c042b78e9b5eb9eabc4c6b0b7c39 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 18 Apr 2018 02:57:44 -0800 Subject: [PATCH 06/13] Revert "removed bad code and made compatible with pip 10 (#13685)" (#13713) This reverts commit 91b0dce4d8e838c17bbb7bc7ff41913650641a45. --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 3c19b2b293..c293fb82d0 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages +try: # for pip >= 10 + from pip._internal.req import parse_requirements +except ImportError: # for pip <= 9.0.3 + from pip.req import parse_requirements import re, ast # get version from __version__ variable in erpnext/__init__.py _version_re = re.compile(r'__version__\s+=\s+(.*)') -with open('requirements.txt') as f: - install_requires = f.read().strip().split('\n') - with open('erpnext/__init__.py', 'rb') as f: version = str(ast.literal_eval(_version_re.search( f.read().decode('utf-8')).group(1))) @@ -23,5 +24,6 @@ setup( packages=find_packages(), zip_safe=False, include_package_data=True, - install_requires=install_requires + install_requires=[str(ir.req) for ir in requirements], + dependency_links=[str(ir._link) for ir in requirements if ir._link] ) From 78869f1e77ebb3b6ec060c6619f26f44cdc4bc7f Mon Sep 17 00:00:00 2001 From: Julian Robbins Date: Wed, 18 Apr 2018 12:12:30 +0100 Subject: [PATCH 07/13] Update manual-feedback-request.md (#13709) Changed wording to reflect current wording of Feedback Request rather than 'Ask a Feedback' --- .../manual/en/setting-up/feedback/manual-feedback-request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/docs/user/manual/en/setting-up/feedback/manual-feedback-request.md b/erpnext/docs/user/manual/en/setting-up/feedback/manual-feedback-request.md index 7f873cee2f..383bd454fd 100644 --- a/erpnext/docs/user/manual/en/setting-up/feedback/manual-feedback-request.md +++ b/erpnext/docs/user/manual/en/setting-up/feedback/manual-feedback-request.md @@ -4,7 +4,7 @@ We can also send the feedback request to Customer/User without configuring the Feedback Trigger. To request a feedback manually go to respective document e.g. Sales Order, Issue etc. -and click on Ask a Feedback option in Menu. +and click on Request Feedback option in Menu. Setting Condition From 8441dd918436e96acf7a07786a612bda10d10e74 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 19 Apr 2018 12:55:06 +0530 Subject: [PATCH 08/13] [Fix] Item with special character not adding in the POS cart --- .../page/point_of_sale/point_of_sale.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 0fa082fddc..aa78b85bdb 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -774,7 +774,7 @@ class POSCart { }); this.numpad.reset_value(); } else { - const item_code = this.selected_item.attr('data-item-code'); + const item_code = unescape(this.selected_item.attr('data-item-code')); const field = this.selected_item.active_field; const value = this.numpad.get_value(); @@ -819,7 +819,7 @@ class POSCart { } update_item(item) { - const $item = this.$cart_items.find(`[data-item-code="${item.item_code}"]`); + const $item = this.$cart_items.find(`[data-item-code="${escape(item.item_code)}"]`); if(item.qty > 0) { const is_stock_item = this.get_item_details(item.item_code).is_stock_item; @@ -841,7 +841,7 @@ class POSCart { const rate = format_currency(item.rate, this.frm.doc.currency); const indicator_class = (!is_stock_item || item.actual_qty >= item.qty) ? 'green' : 'red'; return ` -
+
${item.item_name}
@@ -883,18 +883,18 @@ class POSCart { } exists(item_code) { - let $item = this.$cart_items.find(`[data-item-code="${item_code}"]`); + let $item = this.$cart_items.find(`[data-item-code="${escape(item_code)}"]`); return $item.length > 0; } highlight_item(item_code) { - const $item = this.$cart_items.find(`[data-item-code="${item_code}"]`); + const $item = this.$cart_items.find(`[data-item-code="${escape(item_code)}"]`); $item.addClass('highlight'); setTimeout(() => $item.removeClass('highlight'), 1000); } scroll_to_item(item_code) { - const $item = this.$cart_items.find(`[data-item-code="${item_code}"]`); + const $item = this.$cart_items.find(`[data-item-code="${escape(item_code)}"]`); if ($item.length === 0) return; const scrollTop = $item.offset().top - this.$cart_items.offset().top + this.$cart_items.scrollTop(); this.$cart_items.animate({ scrollTop }); @@ -909,7 +909,7 @@ class POSCart { '[data-action="increment"], [data-action="decrement"]', function() { const $btn = $(this); const $item = $btn.closest('.list-item[data-item-code]'); - const item_code = $item.attr('data-item-code'); + const item_code = unescape($item.attr('data-item-code')); const action = $btn.attr('data-action'); if(action === 'increment') { @@ -932,7 +932,7 @@ class POSCart { this.$cart_items.on('change', '.quantity input', function() { const $input = $(this); const $item = $input.closest('.list-item[data-item-code]'); - const item_code = $item.attr('data-item-code'); + const item_code = unescape($item.attr('data-item-code')); events.on_field_change(item_code, 'qty', flt($input.val())); }); @@ -1200,7 +1200,7 @@ class POSItems { var me = this; this.wrapper.on('click', '.pos-item-wrapper', function() { const $item = $(this); - const item_code = $item.attr('data-item-code'); + const item_code = unescape($item.attr('data-item-code')); me.events.update_cart(item_code, 'qty', '+1'); }); } @@ -1226,7 +1226,7 @@ class POSItems { const item_title = item_name || item_code; const template = ` -
+
From c36524ec547046847197b0df185f8b3996c861ae Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 20 Apr 2018 11:00:20 +0530 Subject: [PATCH 09/13] Update chart_of_accounts.py --- .../doctype/account/chart_of_accounts/chart_of_accounts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py index dc98db141e..737b34ae71 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py @@ -165,7 +165,7 @@ def build_account_tree(tree, parent, all_accounts): tree[child.account_name] = {} # assign account_type and root_type - if child.account_type: + if child.account_number: tree[child.account_name]["account_number"] = child.account_number if child.account_type: tree[child.account_name]["account_type"] = child.account_type @@ -175,4 +175,4 @@ def build_account_tree(tree, parent, all_accounts): tree[child.account_name]["root_type"] = child.root_type # call recursively to build a subtree for current account - build_account_tree(tree[child.account_name], child, all_accounts) \ No newline at end of file + build_account_tree(tree[child.account_name], child, all_accounts) From fa5ecb066e1ce4f2d9db60668868f5e96bb94e4f Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Sun, 22 Apr 2018 12:11:01 +0530 Subject: [PATCH 10/13] typo fix in leaderboard --- erpnext/utilities/page/leaderboard/leaderboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/utilities/page/leaderboard/leaderboard.js b/erpnext/utilities/page/leaderboard/leaderboard.js index 746ac79488..1a9efd587b 100644 --- a/erpnext/utilities/page/leaderboard/leaderboard.js +++ b/erpnext/utilities/page/leaderboard/leaderboard.js @@ -24,7 +24,7 @@ frappe.Leaderboard = Class.extend({ "Item": ["total_sales_amount", "total_qty_sold", "total_purchase_amount", "total_qty_purchased", "available_stock_qty", "available_stock_value"], "Supplier": ["total_purchase_amount", "total_qty_purchased", "outstanding_amount"], - "Sales Partner": ["total_sales_amount", "total_commision"], + "Sales Partner": ["total_sales_amount", "total_commission"], "Sales Person": ["total_sales_amount"], }; From 9630aa3d7fcb526f137d6aec5f2d5417e17bb34c Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Mon, 23 Apr 2018 12:37:11 +0530 Subject: [PATCH 11/13] fixed the gantt view of patient appointment --- .../patient_appointment/patient_appointment_calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js index bfb53b83b8..0b62d8e368 100644 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js @@ -1,8 +1,8 @@ frappe.views.calendar["Patient Appointment"] = { field_map: { - "start": "start", - "end": "end", + "start": "appointment_date", + "end": "appointment_datetime", "id": "name", "title": "patient", "allDay": "allDay" From c0ec3c3f7b6c17b09f988886e3c29b98e006b8b4 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Mon, 23 Apr 2018 13:05:54 +0530 Subject: [PATCH 12/13] [fix] cal view start end date field discrepancies --- erpnext/hr/doctype/holiday_list/holiday_list_calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js index 3cc8dd5036..507d070444 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js +++ b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js @@ -3,8 +3,8 @@ frappe.views.calendar["Holiday List"] = { field_map: { - "start": "holiday_date", - "end": "holiday_date", + "start": "from_date", + "end": "to_date", "id": "name", "title": "description", "allDay": "allDay" From d9f1b539dc8560fc7e798849f8e432e6fe05f8a9 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 24 Apr 2018 11:42:07 +0600 Subject: [PATCH 13/13] bumped to version 10.1.24 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 777b7bdc2f..178d7e803d 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.23' +__version__ = '10.1.24' def get_default_company(user=None): '''Get default company for user'''