From ec2d09c557f189ad54eee61f29aad7376cd2a757 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 9 Aug 2016 16:43:15 +0530 Subject: [PATCH] [minor] setting up website optional in setup wizard --- erpnext/accounts/doctype/account/account.js | 4 +-- .../report/general_ledger/general_ledger.py | 7 +++-- erpnext/portal/doctype/homepage/homepage.json | 29 ++++++++++++++++++- .../homepage_featured_product.json | 27 ++++++++++++++++- erpnext/public/js/setup_wizard.js | 2 ++ erpnext/setup/setup_wizard/setup_wizard.py | 4 ++- erpnext/templates/pages/home.py | 6 ++-- erpnext/tests/test_client.py | 2 +- 8 files changed, 70 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index c3a01b941b8..2450a8a9098 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -47,7 +47,7 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) { cur_frm.cscript.add_toolbar_buttons = function(doc) { cur_frm.add_custom_button(__('Chart of Accounts'), - function() { frappe.set_route("Tree", "Account"); }, __("View")) + function() { frappe.set_route("Tree", "Account"); }); if (doc.is_group == 1) { cur_frm.add_custom_button(__('Group to Non-Group'), @@ -61,7 +61,7 @@ cur_frm.cscript.add_toolbar_buttons = function(doc) { "company": doc.company }; frappe.set_route("query-report", "General Ledger"); - }, __("View")); + }); cur_frm.add_custom_button(__('Non-Group to Group'), function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet', 'btn-default') diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index d10b3d902b0..15fd2990220 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -25,6 +25,9 @@ def execute(filters=None): return columns, res def validate_filters(filters, account_details): + if not filters.get('company'): + frappe.throw(_('{0} is mandatory').format(_('Company'))) + if filters.get("account") and not account_details.get(filters.account): frappe.throw(_("Account {0} does not exists").format(filters.account)) @@ -87,7 +90,7 @@ def get_columns(filters): columns += [ _("Voucher Type") + "::120", _("Voucher No") + ":Dynamic Link/"+_("Voucher Type")+":160", _("Against Account") + "::120", _("Party Type") + "::80", _("Party") + "::150", - _("Project") + ":Link/Project:100", _("Cost Center") + ":Link/Cost Center:100", + _("Project") + ":Link/Project:100", _("Cost Center") + ":Link/Cost Center:100", _("Remarks") + "::400" ] @@ -111,7 +114,7 @@ def get_gl_entries(filters): if filters.get("group_by_voucher") else "group by name" gl_entries = frappe.db.sql(""" - select + select posting_date, account, party_type, party, sum(debit) as debit, sum(credit) as credit, voucher_type, voucher_no, cost_center, project, diff --git a/erpnext/portal/doctype/homepage/homepage.json b/erpnext/portal/doctype/homepage/homepage.json index cbe58c7bf25..51d79553b02 100644 --- a/erpnext/portal/doctype/homepage/homepage.json +++ b/erpnext/portal/doctype/homepage/homepage.json @@ -9,6 +9,7 @@ "docstatus": 0, "doctype": "DocType", "document_type": "Setup", + "editable_grid": 0, "fields": [ { "allow_on_submit": 0, @@ -36,6 +37,31 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "title", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "TItle", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -145,13 +171,14 @@ "hide_heading": 0, "hide_toolbar": 0, "idx": 0, + "image_view": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2016-05-12 14:19:41.689519", + "modified": "2016-08-09 05:01:30.287861", "modified_by": "Administrator", "module": "Portal", "name": "Homepage", diff --git a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json index f3f9ce98a65..870c8b194ac 100644 --- a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json +++ b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json @@ -95,6 +95,31 @@ "unique": 0, "width": "150" }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "view", + "fieldtype": "Button", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -260,7 +285,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-07-11 03:28:00.729983", + "modified": "2016-08-09 06:09:34.731971", "modified_by": "Administrator", "module": "Portal", "name": "Homepage Featured Product", diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js index 55d3296566a..0013fdb64b8 100644 --- a/erpnext/public/js/setup_wizard.js +++ b/erpnext/public/js/setup_wizard.js @@ -311,6 +311,8 @@ function load_erpnext_slides() { slide.fields.push({fieldtype: "Section Break"}); slide.fields.push({fieldtype: "Check", fieldname: "add_sample_data", label: __("Add a few sample records"), "default": 1}); + slide.fields.push({fieldtype: "Check", fieldname: "setup_website", + label: __("Setup a simple website for my organization"), "default": 1}); }, css_class: "two-column" }, diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index 97ca7a3fc9d..c9679bd9a04 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -41,7 +41,9 @@ def setup_complete(args=None): create_instructor(args) create_room(args) - website_maker(args) + if args.get('setup_website'): + website_maker(args) + create_logo(args) frappe.local.message_log = [] diff --git a/erpnext/templates/pages/home.py b/erpnext/templates/pages/home.py index 00cd3a9aaed..9a4c89c8120 100644 --- a/erpnext/templates/pages/home.py +++ b/erpnext/templates/pages/home.py @@ -15,6 +15,8 @@ def get_context(context): if route: item.route = '/' + route + context.title = homepage.title or homepage.company + # show atleast 3 products if len(homepage.products) < 3: for i in xrange(3 - len(homepage.products)): @@ -24,6 +26,4 @@ def get_context(context): 'route': '#' }) - return { - 'homepage': homepage - } + context.homepage = homepage diff --git a/erpnext/tests/test_client.py b/erpnext/tests/test_client.py index 153ce751d45..bf8834145fe 100644 --- a/erpnext/tests/test_client.py +++ b/erpnext/tests/test_client.py @@ -6,7 +6,7 @@ import unittest, frappe from frappe.utils import sel from frappe.utils import formatdate -selenium_tests = True +#selenium_tests = True # class TestLogin(unittest.TestCase): # def setUp(self):