From 473437931ce02c81f94c0f10cb72364868ef270b Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Mon, 22 Oct 2018 11:22:12 +0530 Subject: [PATCH 01/12] field name fix --- .../doctype/request_for_quotation/request_for_quotation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js index 2ff80755df..873d210749 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js @@ -128,7 +128,7 @@ frappe.ui.form.on("Request for Quotation",{ doctype: "Supplier", order_by: "name", fields: ["name"], - filters: [["Supplier", "supplier_group_name", "=", args.supplier_group]] + filters: [["Supplier", "supplier_group", "=", args.supplier_group]] }, callback: load_suppliers From ac6e3a69f992541b48997faaf0e0b5fae939a6c8 Mon Sep 17 00:00:00 2001 From: Ranjith Kurungadam Date: Mon, 22 Oct 2018 12:06:54 +0530 Subject: [PATCH 02/12] fix: Serial No- allow editing SO, track changes (#15741) --- erpnext/stock/doctype/serial_no/serial_no.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/serial_no/serial_no.json b/erpnext/stock/doctype/serial_no/serial_no.json index 09973d98e4..8c3dafe8ba 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.json +++ b/erpnext/stock/doctype/serial_no/serial_no.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, @@ -397,7 +398,7 @@ "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 1, + "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, @@ -1613,7 +1614,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-08-29 06:29:51.682813", + "modified": "2018-10-19 12:38:34.448513", "modified_by": "Administrator", "module": "Stock", "name": "Serial No", @@ -1684,7 +1685,7 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", - "track_changes": 0, + "track_changes": 1, "track_seen": 0, "track_views": 0 } \ No newline at end of file From aef7a6ec444abe9f98c5cf6c0e40e04e686600a2 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 22 Oct 2018 13:51:32 +0530 Subject: [PATCH 03/12] [Fix] User able to edit the rate in offline POS even if it has no permissions --- erpnext/public/js/pos/pos.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html index af90756963..8e9e2ca20c 100644 --- a/erpnext/public/js/pos/pos.html +++ b/erpnext/public/js/pos/pos.html @@ -73,7 +73,7 @@ {% for(var j=i*3; j <(i+1)*3; j++) { %} {% } %} - + {% } %}
From 91eac5a7cf1dc9ee25384a3de3470b9f8411d405 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 22 Oct 2018 15:04:57 +0530 Subject: [PATCH 04/12] fix(report): Optimization for financial statements --- erpnext/accounts/report/financial_statements.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 1be3d74185..459f492289 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -306,19 +306,20 @@ def set_gl_entries_by_account(company, from_date, to_date, root_lft, root_rgt, f additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters) + accounts = frappe.db.sql_list("""select name from `tabAccount` + where lft >= %s and rgt <= %s""", (root_lft, root_rgt)) + additional_conditions += " and account in ('{}')"\ + .format("', '".join([frappe.db.escape(d) for d in accounts])) + gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year from `tabGL Entry` where company=%(company)s {additional_conditions} and posting_date <= %(to_date)s - and account in (select name from `tabAccount` - where lft >= %(lft)s and rgt <= %(rgt)s) order by account, posting_date""".format(additional_conditions=additional_conditions), { "company": company, "from_date": from_date, "to_date": to_date, - "lft": root_lft, - "rgt": root_rgt }, as_dict=True) From 3a11f343554b38a30bf91421f56cc9ee6d8ca3cf Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Mon, 22 Oct 2018 10:15:07 +0000 Subject: [PATCH 05/12] fix(): fetch correct warehouse for item in report Fix 'Sales Person-wise Transaction Summary' Report by fetching the correct Warehouse for the Item fron the respective, Sales Order/Sales Invoice/ Delivery Note --- .../sales_person_wise_transaction_summary.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py index 345d608fef..db11ae95c2 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py @@ -20,7 +20,7 @@ def execute(filters=None): for d in entries: if d.stock_qty > 0 or filters.get('show_return_entries', 0): data.append([ - d.name, d.customer, d.territory, d.posting_date, d.item_code, + d.name, d.customer, d.territory, d.warehouse, d.posting_date, d.item_code, item_details.get(d.item_code, {}).get("item_group"), item_details.get(d.item_code, {}).get("brand"), d.stock_qty, d.base_net_amount, d.sales_person, d.allocated_percentage, d.contribution_amt, company_currency ]) @@ -144,10 +144,10 @@ def get_entries(filters): conditions, values = get_conditions(filters, date_field) entries = frappe.db.sql(""" - select + SELECT dt.name, dt.customer, dt.territory, dt.%s as posting_date, dt_item.item_code, - st.sales_person, st.allocated_percentage, - CASE + st.sales_person, st.allocated_percentage, dt_item.warehouse, + CASE WHEN dt.status = "Closed" THEN dt_item.%s * dt_item.conversion_factor ELSE dt_item.stock_qty END as stock_qty, @@ -159,9 +159,9 @@ def get_entries(filters): WHEN dt.status = "Closed" THEN ((dt_item.base_net_rate * dt_item.%s * dt_item.conversion_factor) * st.allocated_percentage/100) ELSE dt_item.base_net_amount * st.allocated_percentage/100 END as contribution_amt - from + FROM `tab%s` dt, `tab%s Item` dt_item, `tabSales Team` st - where + WHERE st.parent = dt.name and dt.name = dt_item.parent and st.parenttype = %s and dt.docstatus = 1 %s order by st.sales_person, dt.name desc """ %(date_field, qty_field, qty_field, qty_field, filters["doc_type"], filters["doc_type"], '%s', conditions), @@ -211,7 +211,7 @@ def get_items(filters): def get_item_details(): item_details = {} - for d in frappe.db.sql("""select name, item_group, brand from `tabItem`""", as_dict=1): + for d in frappe.db.sql("""SELECT `name`, `item_group`, `brand` FROM `tabItem`""", as_dict=1): item_details.setdefault(d.name, d) return item_details From c365ce8f2146da4d5c65e49207cb1bf1a6ba982a Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Mon, 22 Oct 2018 10:34:35 +0000 Subject: [PATCH 06/12] bumped to version 10.1.62 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index d44bf40a9f..ec3f371a15 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.61' +__version__ = '10.1.62' def get_default_company(user=None): '''Get default company for user''' From 635d4dbebe94e1717630bb0c63c6e0e676e1f341 Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Tue, 23 Oct 2018 11:00:19 +0530 Subject: [PATCH 07/12] subscriber deprecated test case fixes --- .../doctype/subscription/test_subscription.py | 56 ++++++++----------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index a5285ea16a..3d96f233b4 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -41,24 +41,14 @@ def create_plan(): plan.billing_interval_count = 14 plan.insert() - -def create_subscriber(): - if not frappe.db.exists('Subscriber', '_Test Customer'): - subscriber = frappe.new_doc('Subscriber') - subscriber.subscriber_name = '_Test Customer' - subscriber.customer = '_Test Customer' - subscriber.insert() - - class TestSubscription(unittest.TestCase): def setUp(self): create_plan() - create_subscriber() def test_create_subscription_with_trial_with_correct_period(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.trial_period_start = nowdate() subscription.trial_period_end = add_days(nowdate(), 30) subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) @@ -75,7 +65,7 @@ class TestSubscription(unittest.TestCase): def test_create_subscription_without_trial_with_correct_period(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() @@ -91,7 +81,7 @@ class TestSubscription(unittest.TestCase): def test_create_subscription_trial_with_wrong_dates(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.trial_period_end = nowdate() subscription.trial_period_start = add_days(nowdate(), 30) subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) @@ -101,7 +91,7 @@ class TestSubscription(unittest.TestCase): def test_create_subscription_multi_with_different_billing_fails(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.trial_period_end = nowdate() subscription.trial_period_start = add_days(nowdate(), 30) subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) @@ -112,7 +102,7 @@ class TestSubscription(unittest.TestCase): def test_invoice_is_generated_at_end_of_billing_period(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.start = '2018-01-01' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.insert() @@ -129,7 +119,7 @@ class TestSubscription(unittest.TestCase): def test_status_goes_back_to_active_after_invoice_is_paid(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.start = '2018-01-01' subscription.insert() @@ -159,7 +149,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.start = '2018-01-01' subscription.insert() @@ -182,7 +172,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.start = '2018-01-01' subscription.insert() @@ -200,7 +190,7 @@ class TestSubscription(unittest.TestCase): def test_subscription_invoice_days_until_due(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.days_until_due = 10 subscription.start = add_months(nowdate(), -1) @@ -218,7 +208,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.start = '2018-01-01' subscription.insert() @@ -242,7 +232,7 @@ class TestSubscription(unittest.TestCase): def test_subscription_remains_active_during_invoice_period(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() subscription.process() # no changes expected @@ -268,7 +258,7 @@ class TestSubscription(unittest.TestCase): def test_subscription_cancelation(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() subscription.cancel_subscription() @@ -284,7 +274,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() @@ -319,7 +309,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() subscription.cancel_subscription() @@ -339,7 +329,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() subscription.cancel_subscription() @@ -363,7 +353,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.start = '2018-01-01' subscription.insert() @@ -397,7 +387,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.start = '2018-01-01' subscription.insert() @@ -434,7 +424,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.start = '2018-01-01' subscription.insert() @@ -463,7 +453,7 @@ class TestSubscription(unittest.TestCase): def test_restart_active_subscription(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() @@ -473,7 +463,7 @@ class TestSubscription(unittest.TestCase): def test_subscription_invoice_discount_percentage(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.additional_discount_percentage = 10 subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() @@ -488,7 +478,7 @@ class TestSubscription(unittest.TestCase): def test_subscription_invoice_discount_amount(self): subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.additional_discount_amount = 11 subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() @@ -505,7 +495,7 @@ class TestSubscription(unittest.TestCase): # Create a non pre-billed subscription, processing should not create # invoices. subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() subscription.process() @@ -527,7 +517,7 @@ class TestSubscription(unittest.TestCase): settings.save() subscription = frappe.new_doc('Subscription') - subscription.subscriber = '_Test Customer' + subscription.customer = '_Test Customer' subscription.generate_invoice_at_period_start = True subscription.append('plans', {'plan': '_Test Plan Name', 'qty': 1}) subscription.save() From 60d8a0da1ef9a6cb7d6a57a9c14c883f3b865d1f Mon Sep 17 00:00:00 2001 From: Shreya Date: Wed, 17 Oct 2018 17:06:45 +0530 Subject: [PATCH 08/12] fix(leave-status): Do not consider current leave application while submitting --- .../leave_application/leave_application.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 2278036ba3..aca277effd 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -191,9 +191,8 @@ class LeaveApplication(Document): frappe.throw(_("The day(s) on which you are applying for leave are holidays. You need not apply for leave.")) if not is_lwp(self.leave_type): - self.leave_balance = get_leave_balance_on(self.employee, self.leave_type, self.from_date, + self.leave_balance = get_leave_balance_on(self.employee, self.leave_type, self.from_date, docname=self.name, consider_all_leaves_in_the_allocation_period=True) - if self.status != "Rejected" and self.leave_balance < self.total_leave_days: if frappe.db.get_value("Leave Type", self.leave_type, "allow_negative"): frappe.msgprint(_("Note: There is not enough leave balance for Leave Type {0}") @@ -385,26 +384,24 @@ def get_leave_details(employee, date): return ret @frappe.whitelist() -def get_leave_balance_on(employee, leave_type, date, allocation_records=None, +def get_leave_balance_on(employee, leave_type, date, allocation_records=None, docname=None, consider_all_leaves_in_the_allocation_period=False, consider_encashed_leaves=True): + if allocation_records == None: allocation_records = get_leave_allocation_records(date, employee).get(employee, frappe._dict()) - allocation = allocation_records.get(leave_type, frappe._dict()) - if consider_all_leaves_in_the_allocation_period: date = allocation.to_date - leaves_taken = get_leaves_for_period(employee, leave_type, allocation.from_date, date, status="Approved") - + leaves_taken = get_leaves_for_period(employee, leave_type, allocation.from_date, date, status="Approved", docname=docname) leaves_encashed = 0 if frappe.db.get_value("Leave Type", leave_type, 'allow_encashment') and consider_encashed_leaves: leaves_encashed = flt(allocation.total_leaves_encashed) return flt(allocation.total_leaves_allocated) - (flt(leaves_taken) + flt(leaves_encashed)) -def get_leaves_for_period(employee, leave_type, from_date, to_date, status): +def get_leaves_for_period(employee, leave_type, from_date, to_date, status, docname=None): leave_applications = frappe.db.sql(""" - select employee, leave_type, from_date, to_date, total_leave_days + select name, employee, leave_type, from_date, to_date, total_leave_days from `tabLeave Application` where employee=%(employee)s and leave_type=%(leave_type)s and status = %(status)s and docstatus != 2 @@ -418,9 +415,10 @@ def get_leaves_for_period(employee, leave_type, from_date, to_date, status): "status": status, "leave_type": leave_type }, as_dict=1) - leave_days = 0 for leave_app in leave_applications: + if docname and leave_app.name == docname: + continue if leave_app.from_date >= getdate(from_date) and leave_app.to_date <= getdate(to_date): leave_days += leave_app.total_leave_days else: @@ -450,7 +448,6 @@ def get_leave_allocation_records(date, employee=None): "total_leaves_allocated": d.total_leaves_allocated, "total_leaves_encashed":d.total_leaves_encashed })) - return allocated_leaves @frappe.whitelist() From 1b105e25758e27ba9266a1cef215350662129863 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 21 Oct 2018 22:01:21 +0530 Subject: [PATCH 09/12] Add test case --- .../test_leave_application.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 71c602b500..4748011b62 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -392,6 +392,34 @@ class TestLeaveApplication(unittest.TestCase): i += 1 self.assertEqual(get_leave_balance_on(employee.name, leave_type, nowdate()), 6) + # test to not consider current leave in leave balance while submitting + def test_current_leave_on_submit(self): + employee = get_employee() + leave_type = 'Sick leave' + allocation = frappe.get_doc(dict( + doctype = 'Leave Allocation', + employee = employee.name, + leave_type = leave_type, + from_date = '2018-10-01', + to_date = '2018-10-10', + new_leaves_allocated = 1 + )) + allocation.insert(ignore_permissions=True) + allocation.submit() + leave_application = frappe.get_doc(dict( + doctype = 'Leave Application', + employee = employee.name, + leave_type = leave_type, + from_date = '2018-10-02', + to_date = '2018-10-02', + company = '_Test Company', + status = 'Approved', + leave_approver = 'test@example.com' + )) + self.assertTrue(leave_application.insert()) + leave_application.submit() + self.assertEqual(leave_application.docstatus, 1) + def make_allocation_record(employee=None, leave_type=None): frappe.db.sql("delete from `tabLeave Allocation`") From 55416e08f1b7431d4c332babf9ea8785ed59ea38 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 23 Oct 2018 11:52:06 +0530 Subject: [PATCH 10/12] [Fix] Marketplace setting permission error --- .../marketplace_settings/marketplace_settings.py | 10 +++++++++- erpnext/public/js/hub/hub_factory.js | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py index 9bfa39f73f..91c7bf5850 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe, requests, json, time from frappe.model.document import Document -from frappe.utils import add_years, now, get_datetime, get_datetime_str +from frappe.utils import add_years, now, get_datetime, get_datetime_str, cint from frappe import _ from frappe.frappeclient import FrappeClient from erpnext.utilities.product import get_price, get_qty_in_stock @@ -84,3 +84,11 @@ class MarketplaceSettings(Document): def unregister(self): """Disable the User on hubmarket.org""" pass + +@frappe.whitelist() +def is_marketplace_enabled(): + if not hasattr(frappe.local, 'is_marketplace_enabled'): + frappe.local.is_marketplace_enabled = cint(frappe.db.get_single_value('Marketplace Settings', + 'disable_marketplace')) + + return frappe.local.is_marketplace_enabled diff --git a/erpnext/public/js/hub/hub_factory.js b/erpnext/public/js/hub/hub_factory.js index 506d374f5e..7d9fefc8b9 100644 --- a/erpnext/public/js/hub/hub_factory.js +++ b/erpnext/public/js/hub/hub_factory.js @@ -32,8 +32,9 @@ frappe.views.marketplaceFactory = class marketplaceFactory extends frappe.views. }; function is_marketplace_disabled() { - return frappe.model.with_doc('Marketplace Settings') - .then(doc => doc.disable_marketplace); + return frappe.call({ + method: "erpnext.hub_node.doctype.marketplace_settings.marketplace_settings.is_marketplace_enabled" + }).then(r => r.message) } $(document).on('toolbar_setup', () => { From ac64b3956233dddf1ec6ee7ba42b11b7e7b31ce1 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Tue, 23 Oct 2018 07:58:11 +0000 Subject: [PATCH 11/12] bumped to version 10.1.63 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index ec3f371a15..425bf786e3 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.62' +__version__ = '10.1.63' def get_default_company(user=None): '''Get default company for user''' From 4293d176027922609406217d1452b2fd48352bd0 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Tue, 23 Oct 2018 08:05:33 +0000 Subject: [PATCH 12/12] bumped to version 11.0.3-beta.14 --- erpnext/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 1d6b5e02be..58b2c44684 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" develop_version = '11.x.x-develop' -staging_version = '11.0.3-beta.13' +staging_version = '11.0.3-beta.14' error_report_email = "support@erpnext.com"