fix: block cancellation of SL/GL entries (#30652)
Individual GL/SLEs aren't supposed to be cancelled by users.
This commit is contained in:
parent
fcbd25f27a
commit
af6b07f9b9
@ -3,6 +3,6 @@
|
||||
|
||||
frappe.ui.form.on('GL Entry', {
|
||||
refresh: function(frm) {
|
||||
|
||||
frm.page.btn_secondary.hide()
|
||||
}
|
||||
});
|
||||
|
@ -269,6 +269,11 @@ class GLEntry(Document):
|
||||
if not self.fiscal_year:
|
||||
self.fiscal_year = get_fiscal_year(self.posting_date, company=self.company)[0]
|
||||
|
||||
def on_cancel(self):
|
||||
msg = _("Individual GL Entry cannot be cancelled.")
|
||||
msg += "<br>" + _("Please cancel related transaction.")
|
||||
frappe.throw(msg)
|
||||
|
||||
|
||||
def validate_balance_type(account, adv_adj=False):
|
||||
if not adv_adj and account:
|
||||
|
@ -3,6 +3,6 @@
|
||||
|
||||
frappe.ui.form.on('Stock Ledger Entry', {
|
||||
refresh: function(frm) {
|
||||
|
||||
frm.page.btn_secondary.hide()
|
||||
}
|
||||
});
|
||||
|
@ -209,6 +209,11 @@ class StockLedgerEntry(Document):
|
||||
msg += "<br>" + "<br>".join(authorized_users)
|
||||
frappe.throw(msg, BackDatedStockTransaction, title=_("Backdated Stock Entry"))
|
||||
|
||||
def on_cancel(self):
|
||||
msg = _("Individual Stock Ledger Entry cannot be cancelled.")
|
||||
msg += "<br>" + _("Please cancel related transaction.")
|
||||
frappe.throw(msg)
|
||||
|
||||
|
||||
def on_doctype_update():
|
||||
if not frappe.db.has_index("tabStock Ledger Entry", "posting_sort_index"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user