Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi 2013-11-18 15:31:10 +05:30
commit 6f5bd11d79
8 changed files with 31 additions and 15 deletions

View File

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt
from webnotes.model.bean import getlist
from webnotes.model.utils import getlist
from webnotes import msgprint, _
from buying.utils import get_last_purchase_details

View File

@ -4,7 +4,6 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint
import MySQLdb
def execute():
webnotes.reload_doc("stock", "doctype", "price_list")
@ -20,7 +19,7 @@ def execute():
buying_or_selling = "Selling" if selling else "Buying"
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", buying_or_selling)
except MySQLdb.OperationalError, e:
except webnotes.SQLError, e:
if e.args[0] == 1054:
webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling'
where ifnull(buying_or_selling, '')='' """)

View File

@ -3,7 +3,6 @@
from __future__ import unicode_literals
import webnotes
import MySQLdb
def execute():
webnotes.reload_doc("core", "doctype", "communication")
@ -17,6 +16,6 @@ def execute():
set parenttype=%s, parentfield='communications',
parent=`%s`
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
except MySQLdb.OperationalError, e:
except webnotes.SQLError, e:
if e.args[0] != 1054:
raise

17
startup/bean_handlers.py Normal file
View File

@ -0,0 +1,17 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from home import update_feed
from core.doctype.notification_count.notification_count import clear_doctype_notifications
from stock.doctype.material_request.material_request import update_completed_qty
def on_method(bean, method):
print method
if method in ("on_update", "on_submit"):
update_feed(bean.controller, method)
if method in ("on_update", "on_cancel", "on_trash"):
clear_doctype_notifications(bean.controller, method)
if bean.doc.doctype=="Stock Entry" and method in ("on_submit", "on_cancel"):
update_completed_qty(bean.controller, method)

View File

@ -1,9 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
observer_map = {
"*:on_update": "home.update_feed",
"*:on_submit": "home.update_feed",
"Stock Entry:on_submit": "stock.doctype.material_request.material_request.update_completed_qty",
"Stock Entry:on_cancel": "stock.doctype.material_request.material_request.update_completed_qty",
}

View File

@ -56,6 +56,12 @@ def get_unread_messages():
AND ifnull(docstatus,0)=0
""", webnotes.user.name)[0][0]
for_module_doctypes = {
"ToDo": "To Do",
"Event": "Calendar",
"Comment": "Messages"
}
for_module = {
"To Do": get_things_todo,
"Calendar": get_todays_events,

View File

@ -30,6 +30,10 @@ def execute_daily():
from core.doctype.event.event import send_event_digest
run_fn(send_event_digest)
# clear daily event notifications
from core.doctype.notification_count.notification_count import delete_notification_count_for
delete_notification_count_for("Event")
# email digest
from setup.doctype.email_digest.email_digest import send
run_fn(send)

View File

@ -8,7 +8,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt
from webnotes.model.bean import getlist
from webnotes.model.utils import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint, _