[minor] stopped or cancelled message
This commit is contained in:
parent
10fc83d369
commit
fa65c7bf29
@ -227,7 +227,7 @@ class StockController(AccountsController):
|
||||
incoming_rate = incoming_rate[0][0] if incoming_rate else 0.0
|
||||
|
||||
return incoming_rate
|
||||
|
||||
|
||||
def update_reserved_qty(self):
|
||||
so_map = {}
|
||||
for d in self.get("items"):
|
||||
@ -242,22 +242,23 @@ class StockController(AccountsController):
|
||||
sales_order = frappe.get_doc("Sales Order", so)
|
||||
|
||||
if sales_order.status in ["Stopped", "Cancelled"]:
|
||||
frappe.throw(_("Sales Order {0} is cancelled or stopped").format(so), frappe.InvalidStatusError)
|
||||
|
||||
frappe.throw(_("{0} {1} is cancelled or stopped").format(_("Sales Order"), so),
|
||||
frappe.InvalidStatusError)
|
||||
|
||||
sales_order.update_reserved_qty(so_item_rows)
|
||||
|
||||
|
||||
def update_stock_ledger(self):
|
||||
self.update_reserved_qty()
|
||||
|
||||
|
||||
sl_entries = []
|
||||
for d in self.get_item_list():
|
||||
if frappe.db.get_value("Item", d.item_code, "is_stock_item") == 1 \
|
||||
and d.warehouse and flt(d['qty']):
|
||||
|
||||
|
||||
incoming_rate = 0
|
||||
if cint(self.is_return) and self.return_against and self.docstatus==1:
|
||||
incoming_rate = self.get_incoming_rate_for_sales_return(d.item_code, self.return_against)
|
||||
|
||||
|
||||
sl_entries.append(self.get_sl_entries(d, {
|
||||
"actual_qty": -1*flt(d['qty']),
|
||||
"stock_uom": frappe.db.get_value("Item", d.item_code, "stock_uom"),
|
||||
|
@ -162,7 +162,8 @@ def update_completed_and_requested_qty(stock_entry, method):
|
||||
mr_obj = frappe.get_doc("Material Request", mr)
|
||||
|
||||
if mr_obj.status in ["Stopped", "Cancelled"]:
|
||||
frappe.throw(_("Material Request {0} is cancelled or stopped").format(mr), frappe.InvalidStatusError)
|
||||
frappe.throw(_("{0} {1} is cancelled or stopped").format(_("Material Request"), mr),
|
||||
frappe.InvalidStatusError)
|
||||
|
||||
mr_obj.update_completed_qty(mr_item_rows)
|
||||
mr_obj.update_requested_qty(mr_item_rows)
|
||||
|
@ -183,7 +183,8 @@ class PurchaseReceipt(BuyingController):
|
||||
po_obj = frappe.get_doc("Purchase Order", po)
|
||||
|
||||
if po_obj.status in ["Stopped", "Cancelled"]:
|
||||
frappe.throw(_("Material Request {0} is cancelled or stopped").format(po), frappe.InvalidStatusError)
|
||||
frappe.throw(_("{0} {1} is cancelled or stopped").format(_("Purchase Order"), po),
|
||||
frappe.InvalidStatusError)
|
||||
|
||||
po_obj.update_ordered_qty(po_item_rows)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user