Allow to make return against sales invoice which has closed sales order. (#36676)
fix: Allow to make return against sales invoice which has closed sales order fix: Allow to make return against sales invoice which has closed sales order (cherry picked from commit 0f98cc85e9dce00fa333474cfb438f243503df81) Co-authored-by: Gourav Saini <63018500+gouravsaini021@users.noreply.github.com>
This commit is contained in:
parent
fa2e5d5ab7
commit
35f72a17db
@ -388,7 +388,7 @@ class SellingController(StockController):
|
||||
for d in self.get("items"):
|
||||
if d.get(ref_fieldname):
|
||||
status = frappe.db.get_value("Sales Order", d.get(ref_fieldname), "status")
|
||||
if status in ("Closed", "On Hold"):
|
||||
if status in ("Closed", "On Hold") and not self.is_return:
|
||||
frappe.throw(_("Sales Order {0} is {1}").format(d.get(ref_fieldname), status))
|
||||
|
||||
def update_reserved_qty(self):
|
||||
@ -404,7 +404,9 @@ class SellingController(StockController):
|
||||
if so and so_item_rows:
|
||||
sales_order = frappe.get_doc("Sales Order", so)
|
||||
|
||||
if sales_order.status in ["Closed", "Cancelled"]:
|
||||
if (sales_order.status == "Closed" and not self.is_return) or sales_order.status in [
|
||||
"Cancelled"
|
||||
]:
|
||||
frappe.throw(
|
||||
_("{0} {1} is cancelled or closed").format(_("Sales Order"), so), frappe.InvalidStatusError
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user