Merge pull request #43973 from frappe/mergify/bp/version-15-hotfix/pr-43971

refactor: update permission requirement for advance ledger (backport #43971)
This commit is contained in:
ruthra kumar
2024-11-05 11:20:10 +05:30
committed by GitHub
2 changed files with 24 additions and 6 deletions

View File

@@ -70,25 +70,41 @@
"read_only": 1 "read_only": 1
} }
], ],
"in_create": 1,
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2024-10-16 17:11:28.143979", "modified": "2024-11-05 10:31:28.736671",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Advance Payment Ledger Entry", "name": "Advance Payment Ledger Entry",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"create": 1,
"delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "System Manager", "role": "Accounts User",
"share": 1, "share": 1
"write": 1 },
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Auditor",
"share": 1
} }
], ],
"sort_field": "creation", "sort_field": "creation",

View File

@@ -2588,6 +2588,7 @@ class AccountsController(TransactionBase):
doc.amount = amount if self.docstatus == 1 else -1 * amount doc.amount = amount if self.docstatus == 1 else -1 * amount
doc.event = "Submit" if self.docstatus == 1 else "Cancel" doc.event = "Submit" if self.docstatus == 1 else "Cancel"
doc.currency = x.account_currency doc.currency = x.account_currency
doc.flags.ignore_permissions = 1
doc.save() doc.save()
def make_advance_payment_ledger_for_payment(self): def make_advance_payment_ledger_for_payment(self):
@@ -2610,6 +2611,7 @@ class AccountsController(TransactionBase):
doc.amount = x.allocated_amount if self.docstatus == 1 else -1 * x.allocated_amount doc.amount = x.allocated_amount if self.docstatus == 1 else -1 * x.allocated_amount
doc.currency = currency doc.currency = currency
doc.event = "Submit" if self.docstatus == 1 else "Cancel" doc.event = "Submit" if self.docstatus == 1 else "Cancel"
doc.flags.ignore_permissions = 1
doc.save() doc.save()
def make_advance_payment_ledger_entries(self): def make_advance_payment_ledger_entries(self):