Rushabh Mehta | ad45e31 | 2013-11-20 12:59:58 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
Rushabh Mehta | 04cc515 | 2013-11-18 13:22:07 +0530 | [diff] [blame] | 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from home import update_feed |
| 5 | from core.doctype.notification_count.notification_count import clear_doctype_notifications |
| 6 | from stock.doctype.material_request.material_request import update_completed_qty |
| 7 | |
| 8 | def on_method(bean, method): |
Rushabh Mehta | 04cc515 | 2013-11-18 13:22:07 +0530 | [diff] [blame] | 9 | 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"): |
Anand Doshi | b0636ed | 2013-12-16 13:51:09 +0530 | [diff] [blame] | 16 | update_completed_qty(bean.controller, method) |
| 17 | |