Skip to content

Commit

Permalink
Merge pull request #32624 from frappe/mergify/bp/version-13-hotfix/pr…
Browse files Browse the repository at this point in the history
…-32622

fix: Ignore linked purchase invoice on cancel (backport #32622)
  • Loading branch information
deepeshgarg007 authored Oct 18, 2022
2 parents 44f5ccc + 015a221 commit 56c4c31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,14 @@ def on_cancel(self):
frappe.db.set(self, "status", "Cancelled")

unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference)
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Repost Item Valuation")

self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Repost Item Valuation",
"Purchase Invoice",
)

self.update_advance_tax_references(cancel=1)

def update_project(self):
Expand Down

0 comments on commit 56c4c31

Please sign in to comment.