From 49ebfb6a30bbaef4da226e6e27304fe1b380155c Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 20 Jan 2012 15:32:18 +0530 Subject: [PATCH] version --- erpnext/home/__init__.py | 11 +++++------ erpnext/home/page/my_company/my_company.js | 3 ++- erpnext/home/page/my_company/my_company.py | 13 +++++++------ .../patches/jan_mar_2012/subdomain_login_patch.py | 3 +++ erpnext/startup/event_handlers.py | 5 +++++ index.html | 2 +- version.num | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py index 8969695aa1..0380ec1af0 100644 --- a/erpnext/home/__init__.py +++ b/erpnext/home/__init__.py @@ -48,9 +48,8 @@ def make_feed(doc, subject, color): def update_feed(doc, method=None): "adds a new feed" - if method=='validate': - return - subject, color = feed_dict.get(doc.doctype, [None, None]) - if subject: - subject = subject % doc.fields - make_feed(doc, subject, color) + if method=='on_update': + subject, color = feed_dict.get(doc.doctype, [None, None]) + if subject: + subject = subject % doc.fields + make_feed(doc, subject, color) diff --git a/erpnext/home/page/my_company/my_company.js b/erpnext/home/page/my_company/my_company.js index d286372323..a057ac3e7f 100644 --- a/erpnext/home/page/my_company/my_company.js +++ b/erpnext/home/page/my_company/my_company.js @@ -243,7 +243,8 @@ MemberItem = function(parent, det, mlist) { // image this.img = $a($td(this.tab,0,0),'img','',{width:'41px'}); set_user_img(this.img, det.name, null, - (det.file_list ? det.file_list.split(NEWLINE)[0].split(',')[1] : ('no_img_' + (det.gender=='Female' ? 'f' : 'm')))); + (det.file_list ? det.file_list.split(NEWLINE)[0].split(',')[1] : + ('no_img_' + (det.gender=='Female' ? 'f' : 'm')))); } // set other details like email id, name etc diff --git a/erpnext/home/page/my_company/my_company.py b/erpnext/home/page/my_company/my_company.py index 09bb9eef74..161050693c 100644 --- a/erpnext/home/page/my_company/my_company.py +++ b/erpnext/home/page/my_company/my_company.py @@ -98,18 +98,17 @@ def add_profile(args): SET password = PASSWORD(%s), modified = %s WHERE name = %s""", (args.get('password'), now, email)) - send_welcome_mail(email, args.get('password')) + send_welcome_mail(email, args) -def send_welcome_mail(email, password): +def send_welcome_mail(email, args): """send welcome mail to user with password and login url""" pr = Document('Profile', email) from webnotes.utils.email_lib import sendmail_md - args = { + args.update({ 'company': webnotes.conn.get_default('company'), - 'name': email, 'password': password, 'account_url': webnotes.conn.get_default('account_url') - } + }) sendmail_md(pr.email, subject="Welcome to ERPNext", msg=welcome_txt % args) # @@ -184,7 +183,9 @@ def update_security(args=''): welcome_txt = """ ## %(company)s -#### Welcome! +Dear %(first_name)s %(last_name)s + +Welcome! A new account has been created for you, here are your details: diff --git a/erpnext/patches/jan_mar_2012/subdomain_login_patch.py b/erpnext/patches/jan_mar_2012/subdomain_login_patch.py index edfcb66535..2b893680cb 100644 --- a/erpnext/patches/jan_mar_2012/subdomain_login_patch.py +++ b/erpnext/patches/jan_mar_2012/subdomain_login_patch.py @@ -6,11 +6,14 @@ def execute(): add_default_home_page() cleanup() reload_doc('setup','doctype','manage_account') + webnotes.conn.commit() + webnotes.conn.sql("drop table tabDocTrigger") def cleanup(): from webnotes.model import delete_doc delete_doc("DocType", "SSO Control") delete_doc("DocType", "WN ERP Cient Control") + delete_doc("DocType", "DocTrigger") def add_default_home_page(): if not webnotes.conn.sql("""select name from `tabDefault Home Page` diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index 14cc6a02d4..798c2011d5 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -28,3 +28,8 @@ def on_login_post_session(login_manager): user=%s AND sid!=%s""", \ (webnotes.session['user'], webnotes.session['sid']), as_list=1) + +def doclist_all(doc, method): + """doclist trigger called from webnotes.model.doclist on any event""" + import home + home.update_feed(doc, method) \ No newline at end of file diff --git a/index.html b/index.html index 381e794d5d..772bac4273 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ ERPNext -