Merge pull request #26420 from deepeshgarg007/new_company_error

fix: Errors on parallel requests creation of company for India
This commit is contained in:
Deepesh Garg
2021-07-13 20:29:56 +05:30
committed by GitHub
2 changed files with 10 additions and 5 deletions

View File

@@ -291,7 +291,7 @@ class Company(NestedSet):
cash = frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name')
if cash and self.default_cash_account \
and not frappe.db.get_value('Mode of Payment Account', {'company': self.name, 'parent': cash}):
mode_of_payment = frappe.get_doc('Mode of Payment', cash)
mode_of_payment = frappe.get_doc('Mode of Payment', cash, for_update=True)
mode_of_payment.append('accounts', {
'company': self.name,
'default_account': self.default_cash_account