[fix] Clear notifications for Sales / Purchase Order on stop/unstop

This commit is contained in:
Nabin Hait 2015-08-27 12:06:11 +05:30
parent 740db53b86
commit 35a5c87cbf
2 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@ from frappe.model.mapper import get_mapped_doc
from erpnext.controllers.buying_controller import BuyingController
from erpnext.stock.doctype.item.item import get_last_purchase_details
from erpnext.stock.stock_balance import update_bin_qty, get_ordered_qty
from frappe.desk.notifications import clear_doctype_notifications
form_grid_templates = {
@ -166,6 +167,7 @@ class PurchaseOrder(BuyingController):
msgprint(_("Status of {0} {1} is now {2}").format(self.doctype, self.name, status))
self.notify_modified()
clear_doctype_notifications(self)
def on_submit(self):
super(PurchaseOrder, self).on_submit()

View File

@ -9,6 +9,7 @@ from frappe.utils import cstr, flt, getdate, comma_and
from frappe import _
from frappe.model.mapper import get_mapped_doc
from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty
from frappe.desk.notifications import clear_doctype_notifications
from erpnext.controllers.selling_controller import SellingController
@ -218,12 +219,14 @@ class SalesOrder(SellingController):
self.update_reserved_qty()
frappe.msgprint(_("{0} {1} status is Stopped").format(self.doctype, self.name))
self.notify_modified()
clear_doctype_notifications(self)
def unstop_sales_order(self):
self.check_modified_date()
frappe.db.set(self, 'status', 'Submitted')
self.update_reserved_qty()
frappe.msgprint(_("{0} {1} status is Unstopped").format(self.doctype, self.name))
clear_doctype_notifications(self)
def update_reserved_qty(self, so_item_rows=None):
"""update requested qty (before ordered_qty is updated)"""