Skip to content

Commit b687c4e

Browse files
committed
Merge branch 'feature/demo_data' into v3-test
2 parents 63e788a + 994b277 commit b687c4e

36 files changed

Lines changed: 2253 additions & 6 deletions

ury/hooks.py

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,46 @@
6060
{"from_route": "/order/<path:app_path>", "to_route": "order"},
6161
{"from_route": "/pos/<path:app_path>", "to_route": "pos"},
6262
]
63+
64+
setup_wizard_requires = [
65+
"assets/erpnext/js/setup_wizard.js",
66+
"assets/ury/js/setup_wizard.js",
67+
]
68+
69+
setup_wizard_stages = "ury.setup.setup_wizard.get_setup_stages"
70+
71+
ury_demo_master_doctypes = [
72+
"Gender",
73+
"Item Group",
74+
"Item",
75+
"Item Price",
76+
"Customer Group",
77+
"Customer",
78+
"User",
79+
"Employee",
80+
"BOM",
81+
"Supplier Group",
82+
"Supplier",
83+
"Branch",
84+
"URY Menu Course",
85+
"URY Menu",
86+
"URY Room",
87+
"URY Restaurant",
88+
"URY Table",
89+
"Product Bundle",
90+
"URY Production Unit",
91+
"URY Report Settings",
92+
"POS Profile"
93+
]
94+
95+
ury_demo_transaction_doctypes = [
96+
"Production Plan",
97+
"Material Request",
98+
"Purchase Order",
99+
"Sales Order",
100+
"Journal Entry",
101+
"Payment Entry"
102+
]
63103
# Home Pages
64104
# ----------
65105

@@ -193,9 +233,9 @@
193233
# Overriding Methods
194234
# ------------------------------
195235
#
196-
# override_whitelisted_methods = {
197-
# "frappe.desk.doctype.event.event.get_events": "ury.event.get_events"
198-
# }
236+
override_whitelisted_methods = {
237+
"erpnext.setup.demo.clear_demo_data": "ury.setup.demo.clear_demo_data"
238+
}
199239
#
200240
# each overriding function accepts a `data` argument;
201241
# generated from the base implementation of the doctype dashboard,

ury/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import click
22

3-
from ury.setup import after_install as setup
3+
from ury.setup_customizations import after_install as setup
44

55

66
def after_install():

ury/public/js/setup_wizard.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
console.log("URY setup_wizard.js loaded");
2+
3+
frappe.setup.on("before_load", function () {
4+
if (!window.erpnext || !erpnext.setup?.slides_settings) return;
5+
6+
const slide = erpnext.setup.slides_settings.find(
7+
s => s.name === "organization"
8+
);
9+
if (!slide) return;
10+
11+
// Prevent duplicate field
12+
if (slide.fields.find(f => f.fieldname === "setup_ury_demo")) return;
13+
14+
const idx = slide.fields.findIndex(f => f.fieldname === "setup_demo");
15+
if (idx === -1) return;
16+
17+
// Hide the ERPNext demo data checkbox
18+
slide.fields[idx].hidden = 1;
19+
20+
slide.fields.splice(idx + 1, 0, {
21+
fieldname: "setup_ury_demo",
22+
label: __("Generate URY Demo Data"),
23+
fieldtype: "Check",
24+
default: 0,
25+
description: __("If checked, we will create URY demo data for you to explore the system. This demo data can be erased later.")
26+
});
27+
});

ury/setup/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)