fix: standard submit perm in repost ledger for editable invoices (backport #37826) (#37855)

fix: standard submit perm in repost ledger for editable invoices (#37826)

* fix: ignore perm while reposting ledger

* fix: use flag in save

* fix: remove unnecessary save

(cherry picked from commit 1b808e1d7c2c2d1ad51bd18acf6a45e9b5cfc605)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2023-11-02 14:33:47 +05:30 committed by GitHub
parent 7bc02c49ba
commit 71361f7673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2267,6 +2267,7 @@ class AccountsController(TransactionBase):
repost_ledger = frappe.new_doc("Repost Accounting Ledger")
repost_ledger.company = self.company
repost_ledger.append("vouchers", {"voucher_type": self.doctype, "voucher_no": self.name})
repost_ledger.flags.ignore_permissions = True
repost_ledger.insert()
repost_ledger.submit()
self.db_set("repost_required", 0)