blob: 06d27343d8f0441f0f9efc77aec36830b989776a [file] [log] [blame]
Rushabh Mehtaad45e312013-11-20 12:59:58 +05301# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
Rushabh Mehta04cc5152013-11-18 13:22:07 +05302# License: GNU General Public License v3. See license.txt
3
4from home import update_feed
5from core.doctype.notification_count.notification_count import clear_doctype_notifications
6from stock.doctype.material_request.material_request import update_completed_qty
7
8def on_method(bean, method):
Rushabh Mehta04cc5152013-11-18 13:22:07 +05309 if method in ("on_update", "on_submit"):
10 update_feed(bean.controller, method)
11
12 if method in ("on_update", "on_cancel", "on_trash"):
13 clear_doctype_notifications(bean.controller, method)
14
15 if bean.doc.doctype=="Stock Entry" and method in ("on_submit", "on_cancel"):
16 update_completed_qty(bean.controller, method)