fix: ignore permissions while creating repost
If user reached this code then they already have permission to create stock transaction, hence ignore permission checks while creating/cancelling repost item valuation entries.
This commit is contained in:
parent
42f1dd98dd
commit
aa024fc9da
@ -676,5 +676,6 @@ def create_repost_item_valuation_entry(args):
|
||||
repost_entry.company = args.company
|
||||
repost_entry.allow_zero_rate = args.allow_zero_rate
|
||||
repost_entry.flags.ignore_links = True
|
||||
repost_entry.flags.ignore_permissions = True
|
||||
repost_entry.save()
|
||||
repost_entry.submit()
|
||||
|
@ -111,6 +111,7 @@ def validate_cancellation(args):
|
||||
frappe.throw(_("Cannot cancel the transaction. Reposting of item valuation on submission is not completed yet."))
|
||||
if repost_entry.status == 'Queued':
|
||||
doc = frappe.get_doc("Repost Item Valuation", repost_entry.name)
|
||||
doc.flags.ignore_permissions = True
|
||||
doc.cancel()
|
||||
doc.delete()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user