fix(demo): Default accounts for demo company
This commit is contained in:
parent
ab6e600b9e
commit
6349b67df4
@ -69,8 +69,7 @@
|
|||||||
"Persediaan Barang": {
|
"Persediaan Barang": {
|
||||||
"Persediaan Barang": {
|
"Persediaan Barang": {
|
||||||
"account_number": "1141.000",
|
"account_number": "1141.000",
|
||||||
"account_type": "Stock",
|
"account_type": "Stock"
|
||||||
"is_group": 1
|
|
||||||
},
|
},
|
||||||
"Uang Muka Pembelian": {
|
"Uang Muka Pembelian": {
|
||||||
"Uang Muka Pembelian": {
|
"Uang Muka Pembelian": {
|
||||||
|
@ -45,7 +45,8 @@ erpnext.setup.slides_settings = [
|
|||||||
fieldname: 'setup_demo',
|
fieldname: 'setup_demo',
|
||||||
label: __('Generate Demo Data for Exploration'),
|
label: __('Generate Demo Data for Exploration'),
|
||||||
fieldtype: 'Check',
|
fieldtype: 'Check',
|
||||||
description: 'If checked, we will create demo data for you to explore the system. This demo data can be erased later.'},
|
description: __('If checked, we will create demo data for you to explore the system. This demo data can be erased later.')
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
onload: function (slide) {
|
onload: function (slide) {
|
||||||
|
@ -403,14 +403,18 @@ class Company(NestedSet):
|
|||||||
self._set_default_account(default_account, default_accounts.get(default_account))
|
self._set_default_account(default_account, default_accounts.get(default_account))
|
||||||
|
|
||||||
if not self.default_income_account:
|
if not self.default_income_account:
|
||||||
income_account = frappe.db.get_value(
|
income_account = frappe.db.get_all(
|
||||||
"Account", {"account_name": _("Sales"), "company": self.name, "is_group": 0}
|
"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:
|
if income_account:
|
||||||
income_account = frappe.db.get_value(
|
income_account = income_account[0]
|
||||||
"Account", {"account_name": _("Sales Account"), "company": self.name}
|
|
||||||
)
|
|
||||||
|
|
||||||
self.db_set("default_income_account", income_account)
|
self.db_set("default_income_account", income_account)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user