mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-12 23:07:41 +00:00
Merge pull request #41900 from ljain112/unreco
refactor: ignore unreconcile doc for PO and SO on cancel/delete
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user