From e401eb1210c4ffeeb4099d0c097f19184ad8e5fe Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Fri, 24 Apr 2026 12:40:10 +0000 Subject: [PATCH] Drop useless "already in system" counter on AMAS done screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During setup the Employee table is always empty, so the breakdown was always "new: N, already in system: 0" — noise without signal. Removed the counter and the get_list round-trip that fed it. The import step still updates existing rows on FIN match if any ever appear. --- jey_wizard/__init__.py | 2 +- jey_wizard/public/js/jey_setup.js | 37 ++----------------------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/jey_wizard/__init__.py b/jey_wizard/__init__.py index 3dc1f76..485f44a 100644 --- a/jey_wizard/__init__.py +++ b/jey_wizard/__init__.py @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.1.1" diff --git a/jey_wizard/public/js/jey_setup.js b/jey_wizard/public/js/jey_setup.js index c2870dc..a9dcd84 100644 --- a/jey_wizard/public/js/jey_setup.js +++ b/jey_wizard/public/js/jey_setup.js @@ -10,7 +10,7 @@ frappe.provide("jey_wizard"); // Bump this string in every commit that changes wizard code. Displayed in the badge so // we can tell at a glance which version is actually running on a given machine. Kept in // sync with __version__ in jey_wizard/__init__.py. -const JEY_WIZARD_VERSION = "0.1.0"; +const JEY_WIZARD_VERSION = "0.1.1"; // Wipe Frappe + ERPNext default slides so their `before_load`/`after_load` listeners // don't try to mutate a wizard that isn't slide-based anymore. @@ -368,14 +368,11 @@ frappe.setup.SetupWizard = class JeySetupWizard { `); } else if (this.amas_state === "done") { const n = (this.data.amas_selected_employees || []).length; - const existingCount = Object.keys(this.amas_existing_map || {}).length; - const newCount = n - existingCount; $body.html(`
${__("All employees will be imported into ƏMAS Employees and the standard Employee doctype after the wizard finishes.")}
`); @@ -993,37 +990,7 @@ frappe.setup.SetupWizard = class JeySetupWizard { return; } this.amas_employees = employees; - // Populate existing_map purely for the summary UI; the actual import - // updates existing records rather than skipping them, so no filtering. - const fins = employees - .map((e) => e.identification_number) - .filter(Boolean); - if (fins.length === 0) { - this.amas_existing_map = {}; - this.amas_commit_selection(); - return; - } - frappe.call({ - method: "frappe.client.get_list", - args: { - doctype: "Employee", - filters: { passport_number: ["in", fins] }, - fields: ["name", "passport_number"], - limit_page_length: 0, - }, - callback: (r2) => { - const map = {}; - (r2.message || []).forEach((emp) => { - if (emp.passport_number) map[emp.passport_number] = emp.name; - }); - this.amas_existing_map = map; - this.amas_commit_selection(); - }, - error: () => { - this.amas_existing_map = {}; - this.amas_commit_selection(); - }, - }); + this.amas_commit_selection(); }, }); }