mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
refactor: ignore unreconcile doc for PO and SO on cancel/delete
(cherry picked from commit b618d685c6)
# Conflicts:
# erpnext/buying/doctype/purchase_order/purchase_order.js
# erpnext/selling/doctype/sales_order/sales_order.js
This commit is contained in:
@@ -6,8 +6,13 @@ frappe.provide("erpnext.accounts.dimensions");
|
||||
{% include 'erpnext/public/js/controllers/buying.js' %};
|
||||
|
||||
frappe.ui.form.on("Purchase Order", {
|
||||
<<<<<<< HEAD
|
||||
setup: function(frm) {
|
||||
|
||||
=======
|
||||
setup: function (frm) {
|
||||
frm.ignore_doctypes_on_cancel_all = ["Unreconcile Payment", "Unreconcile Payment Entries"];
|
||||
>>>>>>> b618d685c6 (refactor: ignore unreconcile doc for PO and SO on cancel/delete)
|
||||
if (frm.doc.is_old_subcontracting_flow) {
|
||||
frm.set_query("reserve_warehouse", "supplied_items", function() {
|
||||
return {
|
||||
|
||||
@@ -345,7 +345,13 @@ class PurchaseOrder(BuyingController):
|
||||
update_linked_doc(self.doctype, self.name, self.inter_company_order_reference)
|
||||
|
||||
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():
|
||||
|
||||
@@ -150,7 +150,15 @@ frappe.ui.form.on("Sales Order", {
|
||||
frm.set_value("advance_paid", 0)
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
frm.ignore_doctypes_on_cancel_all = ['Purchase Order'];
|
||||
=======
|
||||
frm.ignore_doctypes_on_cancel_all = [
|
||||
"Purchase Order",
|
||||
"Unreconcile Payment",
|
||||
"Unreconcile Payment Entries",
|
||||
];
|
||||
>>>>>>> b618d685c6 (refactor: ignore unreconcile doc for PO and SO on cancel/delete)
|
||||
},
|
||||
|
||||
delivery_date: function(frm) {
|
||||
|
||||
@@ -269,7 +269,13 @@ class SalesOrder(SellingController):
|
||||
update_coupon_code_count(self.coupon_code, "used")
|
||||
|
||||
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