Skip to content

Commit

Permalink
fix: security context as per semgrep rule
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Jul 4, 2024
1 parent e7749a2 commit 1432d27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,22 +1170,27 @@ def set_remarks(self):

self.set("remarks", "\n".join(remarks))

@frappe.requires_permission("Sales Order", "read")
def _from_sales_order(self, so):
frappe.flags.new_payment_entry = self
return get_payment_entry(so.doctype, so.name)

@frappe.requires_permission("Sales Invoice", "read")
def _from_sales_invoice(self, si):
frappe.flags.new_payment_entry = self
return get_payment_entry(si.doctype, si.name)

@frappe.requires_permission("Purchase Order", "read")
def _from_purchase_order(self, po):
frappe.flags.new_payment_entry = self
return get_payment_entry(po.doctype, po.name)

@frappe.requires_permission("Purchase Invoice", "read")
def _from_purchase_invoice(self, pi):
frappe.flags.new_payment_entry = self
return get_payment_entry(pi.doctype, pi.name)

@frappe.requires_permission("Dunning", "read")
def _from_dunning(self, d):
frappe.flags.new_payment_entry = self
return get_payment_entry(d.doctype, d.name)
Expand Down
1 change: 1 addition & 0 deletions erpnext/selling/doctype/sales_order/sales_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ def cancel_stock_reservation_entries(self, sre_list=None, notify=True) -> None:
voucher_type=self.doctype, voucher_no=self.name, sre_list=sre_list, notify=notify
)

@frappe.requires_permission("Sales Invoice", "create")
def _into_sales_invoice(self):
make_sales_invoice(self.name)

Expand Down

0 comments on commit 1432d27

Please sign in to comment.