fix: Ignore PO on So cancel

This commit is contained in:
Deepesh Garg 2021-10-29 11:35:34 +05:30
parent 61757c17ae
commit 051aaa708d
2 changed files with 4 additions and 2 deletions

View File

@ -823,7 +823,7 @@ class AccountsController(TransactionBase):
for item in self.items:
so_items.append(item.name)
linked_po = frappe.get_all(
linked_po = list(set(frappe.get_all(
'Purchase Order Item',
filters = {
'sales_order': self.name,
@ -831,7 +831,7 @@ class AccountsController(TransactionBase):
'docstatus': ['<', 2]
},
pluck='parent'
)
)))
if linked_po:
frappe.db.set_value(

View File

@ -78,6 +78,8 @@ frappe.ui.form.on("Sales Order", {
});
erpnext.queries.setup_warehouse_query(frm);
frm.ignore_doctypes_on_cancel_all = ['Purchase Order'];
},
delivery_date: function(frm) {