mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
fix(demo): Default accounts for demo company
This commit is contained in:
@@ -403,14 +403,18 @@ class Company(NestedSet):
|
||||
self._set_default_account(default_account, default_accounts.get(default_account))
|
||||
|
||||
if not self.default_income_account:
|
||||
income_account = frappe.db.get_value(
|
||||
"Account", {"account_name": _("Sales"), "company": self.name, "is_group": 0}
|
||||
income_account = frappe.db.get_all(
|
||||
"Account",
|
||||
filters={"company": self.name, "is_group": 0},
|
||||
or_filters={
|
||||
"account_name": ("in", [_("Sales"), _("Sales Account")]),
|
||||
"account_type": "Income Account",
|
||||
},
|
||||
pluck="name",
|
||||
)
|
||||
|
||||
if not income_account:
|
||||
income_account = frappe.db.get_value(
|
||||
"Account", {"account_name": _("Sales Account"), "company": self.name}
|
||||
)
|
||||
if income_account:
|
||||
income_account = income_account[0]
|
||||
|
||||
self.db_set("default_income_account", income_account)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user