Skip to content

Commit

Permalink
fix: Ignore PO on So cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 committed Oct 29, 2021
1 parent 61757c1 commit 051aaa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/controllers/accounts_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,15 +823,15 @@ def unlink_ref_doc_from_po(self):
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,
'sales_order_item': ['in', so_items],
'docstatus': ['<', 2]
},
pluck='parent'
)
)))

if linked_po:
frappe.db.set_value(
Expand Down
2 changes: 2 additions & 0 deletions erpnext/selling/doctype/sales_order/sales_order.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 051aaa7

Please sign in to comment.