fix: Ignore linked purchase invoice on cancel

(cherry picked from commit faadf78332)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
This commit is contained in:
Deepesh Garg
2022-10-17 18:50:54 +05:30
committed by Mergify
parent 44f5ccc9dc
commit eec770a4a8
2 changed files with 11 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
this._super();
// Ignore linked advances
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry'];
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice'];
if(!this.frm.doc.__islocal) {
// show credit_to in print format

View File

@@ -1368,7 +1368,17 @@ class PurchaseInvoice(BuyingController):
frappe.db.set(self, "status", "Cancelled")
unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference)
<<<<<<< HEAD
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Repost Item Valuation")
=======
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Repost Item Valuation",
"Payment Ledger Entry",
"Purchase Invoice",
)
>>>>>>> faadf78332 (fix: Ignore linked purchase invoice on cancel)
self.update_advance_tax_references(cancel=1)
def update_project(self):