Merge pull request #41900 from ljain112/unreco

refactor: ignore unreconcile doc for PO and SO on cancel/delete
This commit is contained in:
ruthra kumar
2024-06-18 10:26:58 +05:30
committed by GitHub
4 changed files with 20 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ erpnext.buying.setup_buying_controller();
frappe.ui.form.on("Purchase Order", {
setup: function (frm) {
frm.ignore_doctypes_on_cancel_all = ["Unreconcile Payment", "Unreconcile Payment Entries"];
if (frm.doc.is_old_subcontracting_flow) {
frm.set_query("reserve_warehouse", "supplied_items", function () {
return {

View File

@@ -488,7 +488,13 @@ class PurchaseOrder(BuyingController):
self.auto_create_subcontracting_order()
def on_cancel(self):
self.ignore_linked_doctypes = ("GL Entry", "Payment Ledger Entry")
self.ignore_linked_doctypes = (
"GL Entry",
"Payment Ledger Entry",
"Unreconcile Payment",
"Unreconcile Payment Entries",
)
super().on_cancel()
if self.is_against_so():

View File

@@ -227,7 +227,11 @@ frappe.ui.form.on("Sales Order", {
frm.set_value("advance_paid", 0);
}
frm.ignore_doctypes_on_cancel_all = ["Purchase Order"];
frm.ignore_doctypes_on_cancel_all = [
"Purchase Order",
"Unreconcile Payment",
"Unreconcile Payment Entries",
];
},
delivery_date: function (frm) {

View File

@@ -423,7 +423,13 @@ class SalesOrder(SellingController):
self.create_stock_reservation_entries()
def on_cancel(self):
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Payment Ledger Entry",
"Unreconcile Payment",
"Unreconcile Payment Entries",
)
super().on_cancel()
# Cannot cancel closed SO