From 9b2078feab91f6a75a3885fb5cc053a1aa56aa84 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Mon, 30 Apr 2018 18:10:22 +0530 Subject: [PATCH 1/2] [fix] setup_website, fixes #11143 --- .../setup_wizard/operations/company_setup.py | 3 +-- .../operations/default_website.py | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/erpnext/setup/setup_wizard/operations/company_setup.py b/erpnext/setup/setup_wizard/operations/company_setup.py index 7fe7f0c2bc..7f9795bcfd 100644 --- a/erpnext/setup/setup_wizard/operations/company_setup.py +++ b/erpnext/setup/setup_wizard/operations/company_setup.py @@ -113,8 +113,7 @@ def create_logo(args): " {1}".format(fileurl, args.get("company_name") )) def create_website(args): - if args.get('setup_website'): - website_maker(args) + website_maker(args) def get_fy_details(fy_start_date, fy_end_date): start_year = getdate(fy_start_date).year diff --git a/erpnext/setup/setup_wizard/operations/default_website.py b/erpnext/setup/setup_wizard/operations/default_website.py index d13767648d..8ca213b1a0 100644 --- a/erpnext/setup/setup_wizard/operations/default_website.py +++ b/erpnext/setup/setup_wizard/operations/default_website.py @@ -12,7 +12,7 @@ class website_maker(object): self.args = args self.company = args.company_name self.tagline = args.company_tagline - self.user = args.name + self.user = args.get('email') self.make_web_page() self.make_website_settings() self.make_blog() @@ -50,6 +50,17 @@ class website_maker(object): website_settings.save() def make_blog(self): + blog_category = frappe.get_doc({ + "doctype": "Blog Category", + "category_name": "general", + "published": 1, + "title": _("General") + }).insert() + + if not self.user: + # Admin setup + return + blogger = frappe.new_doc("Blogger") user = frappe.get_doc("User", self.user) blogger.user = self.user @@ -58,13 +69,6 @@ class website_maker(object): blogger.avatar = user.user_image blogger.insert() - blog_category = frappe.get_doc({ - "doctype": "Blog Category", - "category_name": "general", - "published": 1, - "title": _("General") - }).insert() - frappe.get_doc({ "doctype": "Blog Post", "title": "Welcome", From b0a46f397a50cbe567604dadd50d9ce2bd2d0efc Mon Sep 17 00:00:00 2001 From: Zarrar Date: Mon, 30 Apr 2018 19:40:18 +0530 Subject: [PATCH 2/2] display customer's name while printing receivable report (#13830) --- .../report/accounts_receivable/accounts_receivable.html | 8 +++++++- .../report/accounts_receivable/accounts_receivable.js | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 5b68f1d2ab..9fefc03716 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -19,7 +19,13 @@

{%= __(report.report_name) %}

-

{%= filters.customer || filters.supplier %}

+

+ {% if (filters.customer_name) { %} + {%= filters.customer_name %} + {% } else { %} + {%= filters.customer || filters.supplier %} + {% } %} +

{% if (filters.tax_id) { %} {%= __("Tax Id: ")%} {%= filters.tax_id %} diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index f44ea448e7..3f9d167864 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -17,8 +17,9 @@ frappe.query_reports["Accounts Receivable"] = { "options": "Customer", on_change: () => { var customer = frappe.query_report_filters_by_name.customer.get_value(); - frappe.db.get_value('Customer', customer, "tax_id", function(value) { + frappe.db.get_value('Customer', customer, ["tax_id", "customer_name"], function(value) { frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]); + frappe.query_report_filters_by_name.customer_name.set_value(value["customer_name"]); }); } }, @@ -81,6 +82,12 @@ frappe.query_reports["Accounts Receivable"] = { "label": __("Tax Id"), "fieldtype": "Data", "hidden": 1 + }, + { + "fieldname":"customer_name", + "label": __("Customer Name"), + "fieldtype": "Data", + "hidden": 1 } ],