From 1d5fa40ff216931541195038b39d2fc94c17cd57 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 16 Jul 2013 16:47:38 +0530 Subject: [PATCH 1/4] [minor] [fix] close button in appframe --- public/js/complete_setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/complete_setup.js b/public/js/complete_setup.js index a93aae6ce1..d7fbe5aa41 100644 --- a/public/js/complete_setup.js +++ b/public/js/complete_setup.js @@ -50,7 +50,7 @@ $.extend(erpnext.complete_setup, { }); if(user != 'Administrator'){ - $(d.appframe.$titlebar).find('.close').toggle(false); // Hide close image + d.appframe.$w.find('.close').toggle(false); // Hide close image $('header').toggle(false); // hide toolbar } From c8f4bda9a2b26b599a86f936abc5bc68dea3c9f7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 16 Jul 2013 16:51:55 +0530 Subject: [PATCH 2/4] [minor] [fix] close button in appframe --- public/js/complete_setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/complete_setup.js b/public/js/complete_setup.js index d7fbe5aa41..7eaff5a1bb 100644 --- a/public/js/complete_setup.js +++ b/public/js/complete_setup.js @@ -50,7 +50,7 @@ $.extend(erpnext.complete_setup, { }); if(user != 'Administrator'){ - d.appframe.$w.find('.close').toggle(false); // Hide close image + d.$wrapper.find('.close').toggle(false); // Hide close image $('header').toggle(false); // hide toolbar } From 9c2bb0e1db1158e599025030940d8db5ea481db9 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 16 Jul 2013 16:56:28 +0530 Subject: [PATCH 3/4] [minor] [fix] autoset abbreviation if company name is set in complete setup --- public/js/complete_setup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/js/complete_setup.js b/public/js/complete_setup.js index 7eaff5a1bb..d66d09a5ce 100644 --- a/public/js/complete_setup.js +++ b/public/js/complete_setup.js @@ -116,6 +116,7 @@ $.extend(erpnext.complete_setup, { var inp = d.fields_dict.company_name.input; inp.value = wn.control_panel.company_name; inp.disabled = true; + d.fields_dict.company_name.$input.trigger("change"); } // set first name, last name From d618b6e1ab350270dd85f4b6fa1963aab5b4ea6c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 16 Jul 2013 17:12:48 +0530 Subject: [PATCH 4/4] [minor] [fix] email digest creation post setup --- setup/doctype/setup_control/setup_control.py | 32 +++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py index a85384b202..b029da3e2b 100644 --- a/setup/doctype/setup_control/setup_control.py +++ b/setup/doctype/setup_control/setup_control.py @@ -186,25 +186,21 @@ class DocType: from webnotes.model.doc import Document for company in companies_list: if company and company[0]: - edigest = Document('Email Digest') - edigest.name = "Default Weekly Digest - " + company[0] - edigest.company = company[0] - edigest.frequency = 'Weekly' - edigest.recipient_list = "\n".join(system_managers) - for f in ['new_leads', 'new_enquiries', 'new_quotations', - 'new_sales_orders', 'new_purchase_orders', - 'new_transactions', 'payables', 'payments', - 'expenses_booked', 'invoiced_amount', 'collections', - 'income', 'bank_balance', 'stock_below_rl', - 'income_year_to_date', 'enabled']: - edigest.fields[f] = 1 - exists = webnotes.conn.sql("""\ - SELECT name FROM `tabEmail Digest` - WHERE name = %s""", edigest.name) - if (exists and exists[0]) and exists[0][0]: + edigest = webnotes.bean({ + "doctype": "Email Digest", + "name": "Default Weekly Digest - " + company[0], + "company": company[0], + "frequency": "Weekly", + "recipient_list": "\n".join(system_managers) + }) + + if webnotes.conn.sql("""select name from `tabEmail Digest` where name=%s""", edigest.doc.name): continue - else: - edigest.save(1) + + for fieldname in edigest.meta.get_fieldnames({"fieldtype": "Check"}): + edigest.doc.fields[fieldname] = 1 + + edigest.insert() # Get Fiscal year Details # ------------------------