Set default account in mode-of-payment Cash, only if default cash account exists (#8909)
This commit is contained in:
parent
c6d75eb942
commit
012c9a0916
@ -170,7 +170,8 @@ class Company(Document):
|
|||||||
|
|
||||||
def set_mode_of_payment_account(self):
|
def set_mode_of_payment_account(self):
|
||||||
cash = frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name')
|
cash = frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name')
|
||||||
if cash and not frappe.db.get_value('Mode of Payment Account', {'company': self.name}):
|
if cash and self.default_cash_account \
|
||||||
|
and not frappe.db.get_value('Mode of Payment Account', {'company': self.name}):
|
||||||
mode_of_payment = frappe.get_doc('Mode of Payment', cash)
|
mode_of_payment = frappe.get_doc('Mode of Payment', cash)
|
||||||
mode_of_payment.append('accounts', {
|
mode_of_payment.append('accounts', {
|
||||||
'company': self.name,
|
'company': self.name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user