mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-19 10:14:59 +00:00
fix: Subcontracting Receipt incorrect status
(cherry picked from commit a55b818119)
This commit is contained in:
@@ -245,17 +245,17 @@ class SubcontractingReceipt(SubcontractingController):
|
|||||||
item.expense_account = expense_account
|
item.expense_account = expense_account
|
||||||
|
|
||||||
def update_status(self, status=None, update_modified=False):
|
def update_status(self, status=None, update_modified=False):
|
||||||
if self.docstatus >= 1 and not status:
|
if not status:
|
||||||
if self.docstatus == 1:
|
if self.docstatus == 0:
|
||||||
|
status = "Draft"
|
||||||
|
elif self.docstatus == 1:
|
||||||
|
status = "Completed"
|
||||||
if self.is_return:
|
if self.is_return:
|
||||||
status = "Return"
|
status = "Return"
|
||||||
return_against = frappe.get_doc("Subcontracting Receipt", self.return_against)
|
return_against = frappe.get_doc("Subcontracting Receipt", self.return_against)
|
||||||
return_against.run_method("update_status")
|
return_against.run_method("update_status")
|
||||||
else:
|
elif self.per_returned == 100:
|
||||||
if self.per_returned == 100:
|
status = "Return Issued"
|
||||||
status = "Return Issued"
|
|
||||||
elif self.status == "Draft":
|
|
||||||
status = "Completed"
|
|
||||||
elif self.docstatus == 2:
|
elif self.docstatus == 2:
|
||||||
status = "Cancelled"
|
status = "Cancelled"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user