[minor] setting up website optional in setup wizard

This commit is contained in:
Rushabh Mehta 2016-08-09 16:43:15 +05:30
parent 722b22a834
commit ec2d09c557
8 changed files with 70 additions and 11 deletions

View File

@ -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')

View File

@ -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,

View File

@ -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",

View File

@ -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",

View File

@ -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"
},

View File

@ -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 = []

View File

@ -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

View File

@ -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):