From 233c0bc779effa24f5ec07d19b211fd09defd03f Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Thu, 24 Oct 2019 15:45:32 +0530 Subject: [PATCH 1/7] fix: sync delivery note status in both list view and form view --- erpnext/stock/doctype/delivery_note/delivery_note_list.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_list.js b/erpnext/stock/doctype/delivery_note/delivery_note_list.js index 6fc51ecdd9..0ae7c37b3f 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note_list.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note_list.js @@ -6,9 +6,9 @@ frappe.listview_settings['Delivery Note'] = { return [__("Return"), "darkgrey", "is_return,=,Yes"]; } else if (doc.status === "Closed") { return [__("Closed"), "green", "status,=,Closed"]; - } else if (doc.grand_total !== 0 && flt(doc.per_billed, 2) < 100) { + } else if (flt(doc.per_billed, 2) < 100) { return [__("To Bill"), "orange", "per_billed,<,100"]; - } else if (doc.grand_total === 0 || flt(doc.per_billed, 2) == 100) { + } else if (flt(doc.per_billed, 2) == 100) { return [__("Completed"), "green", "per_billed,=,100"]; } }, From 8916916a03cffd22b9c26b8a0df7843d37c9ad01 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 28 Oct 2019 13:00:18 +0530 Subject: [PATCH 2/7] fix: 'NoneType' object is not iterable --- .../account_balance_timeline/account_balance_timeline.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py index bc07b6d807..d098d8421c 100644 --- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py +++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import frappe, json +from frappe import _ from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate from erpnext.accounts.report.general_ledger.general_ledger import execute from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan @@ -24,6 +25,9 @@ def get(chart_name = None, chart = None, no_cache = None, from_date = None, to_d account = filters.get("account") company = filters.get("company") + if not account and chart: + frappe.throw(_("Account is not set for the dashboard chart {0}").format(chart)) + if not to_date: to_date = nowdate() if not from_date: From 88d2c973913b68c0256e7fb4dcab35428585083b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 28 Oct 2019 17:37:55 +0530 Subject: [PATCH 3/7] fix: default accounts are not added on creation of company --- erpnext/setup/doctype/company/company.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index e69a6aaded..8b42b19921 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -33,6 +33,10 @@ class Company(NestedSet): return exists def validate(self): + self.update_default_account = False + if self.is_new(): + self.update_default_account = True + self.validate_abbr() self.validate_default_accounts() self.validate_currency() @@ -203,8 +207,8 @@ class Company(NestedSet): "default_expense_account": "Cost of Goods Sold" }) - for default_account in default_accounts: - if self.is_new() or frappe.flags.in_test or frappe.flags.in_demo: + if self.update_default_account or frappe.flags.in_test: + for default_account in default_accounts: self._set_default_account(default_account, default_accounts.get(default_account)) if not self.default_income_account: From 4f7885f1aa63f99320c26c8b87b2d32bfacc35ec Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Tue, 29 Oct 2019 13:20:17 +0530 Subject: [PATCH 4/7] chore: fix unexpected keyword in shopify_settings Signed-off-by: Chinmay D. Pai --- .../doctype/shopify_settings/shopify_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py b/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py index a4332b199e..0cad0cca72 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py @@ -43,7 +43,7 @@ class ShopifySettings(Document): d.raise_for_status() self.update_webhook_table(method, d.json()) except Exception as e: - make_shopify_log(status="Warning", message=e, exception=False) + make_shopify_log(status="Warning", exception=e, rollback=True) def unregister_webhooks(self): session = get_request_session() From 702f9f929b46b3edd25ec53b3b3cb9186beeb10d Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Tue, 29 Oct 2019 13:30:13 +0530 Subject: [PATCH 5/7] chore: rename undefined variable in shopify_log Signed-off-by: Chinmay D. Pai --- erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py b/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py index 7d3f572978..a2b6af99b2 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py +++ b/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py @@ -39,7 +39,7 @@ def get_message(exception): if hasattr(exception, 'message'): message = exception.message elif hasattr(exception, '__str__'): - message = e.__str__() + message = exception.__str__() else: message = "Something went wrong while syncing" return message From 2a72d1fee4bf8d6baed9632bf6dbf58495bc6fd1 Mon Sep 17 00:00:00 2001 From: ahmadRagheb Date: Tue, 29 Oct 2019 19:49:08 +0200 Subject: [PATCH 6/7] Update salary_slip.py getdate imported twice --- erpnext/hr/doctype/salary_slip/salary_slip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 27a51c30e7..46be4fe287 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe, erpnext import datetime, math -from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, getdate +from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words from frappe.model.naming import make_autoname from frappe import msgprint, _ From e127d937f745e58b857d425d2eacc497d49e75cd Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 30 Oct 2019 13:31:05 +0530 Subject: [PATCH 7/7] fix(ExpenseClaim): List filter config for Rejected and Unpaid (#19434) --- erpnext/hr/doctype/expense_claim/expense_claim_list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim_list.js b/erpnext/hr/doctype/expense_claim/expense_claim_list.js index 0e25e66687..6195ad414a 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim_list.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim_list.js @@ -2,11 +2,11 @@ frappe.listview_settings['Expense Claim'] = { add_fields: ["total_claimed_amount", "docstatus"], get_indicator: function(doc) { if(doc.status == "Paid") { - return [__("Paid"), "green", "status,=,'Paid'"]; + return [__("Paid"), "green", "status,=,Paid"]; }else if(doc.status == "Unpaid") { - return [__("Unpaid"), "orange"]; + return [__("Unpaid"), "orange", "status,=,Unpaid"]; } else if(doc.status == "Rejected") { - return [__("Rejected"), "grey"]; + return [__("Rejected"), "grey", "status,=,Rejected"]; } } };