mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
Merge pull request #428 from scmmishra/auto-invoicing
fix: permission issues for guest users
This commit is contained in:
@@ -77,7 +77,7 @@ class ConferenceParticipant(Document):
|
|||||||
'taxes': taxes
|
'taxes': taxes
|
||||||
})
|
})
|
||||||
|
|
||||||
invoice.insert()
|
invoice.insert(ignore_permissions=True)
|
||||||
invoice.submit()
|
invoice.submit()
|
||||||
|
|
||||||
self.make_payment_entry(invoice, transaction, currency)
|
self.make_payment_entry(invoice, transaction, currency)
|
||||||
@@ -85,7 +85,9 @@ class ConferenceParticipant(Document):
|
|||||||
|
|
||||||
def make_payment_entry(self, invoice, transaction, currency):
|
def make_payment_entry(self, invoice, transaction, currency):
|
||||||
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
||||||
|
frappe.flags.ignore_account_permission=True
|
||||||
pe = get_payment_entry(dt='Sales Invoice', dn=invoice.name, bank_amount=invoice.grand_total)
|
pe = get_payment_entry(dt='Sales Invoice', dn=invoice.name, bank_amount=invoice.grand_total)
|
||||||
|
frappe.flags.ignore_account_permission=False
|
||||||
pe.paid_to = frappe.get_value("Mode of Payment Account",
|
pe.paid_to = frappe.get_value("Mode of Payment Account",
|
||||||
{'parent': transaction.service,
|
{'parent': transaction.service,
|
||||||
'parenttype': 'Mode of Payment'},
|
'parenttype': 'Mode of Payment'},
|
||||||
@@ -128,7 +130,7 @@ def get_integration_request(docname, currency):
|
|||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
transaction = frappe.get_list('Integration Request', filters=filters, fields=['name', 'data'])[0]
|
transaction = frappe.get_all('Integration Request', filters=filters, fields=['name', 'data'])[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user