Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7214ad3
feat: add configurable automatic field alias mapping
May 14, 2026
ddefe01
fix: prevent timestamp mismatch during import processing
May 14, 2026
a87047f
update field mapping schema
May 18, 2026
b0857c4
refactor: modularize backend bulk import engine and helper utilities
May 20, 2026
cbde63e
feat: implement background Multiple Target queue import engine
May 20, 2026
5bb0cc7
feat: implement centralized Combined Field Mapping dialog
May 20, 2026
32ded35
fix: resolve identical column mapping across multiple target doctypes
May 20, 2026
5440b0f
fix: filter Combined Dialog mapping rows to existing database aliases
May 20, 2026
868c860
fix: validate update imports using mapped custom update fields
May 20, 2026
522e229
fix(ui): remove duplicate Map Fields button from child table
May 21, 2026
ebdd392
fix(ui): show only Save button before document is saved
May 21, 2026
842badd
fix(ui): remove automatic save when opening Map Fields
May 21, 2026
5f55bab
fix: split failed rows before CSV generation, add 500-row chunks and …
May 21, 2026
e624cc5
feat: support combined header and doctype keys for multiple import fi…
May 22, 2026
d031402
fix: prioritize local user mapping overrides over global defaults in …
May 22, 2026
b5c8343
feat: generate human-readable text for import error logs
May 22, 2026
874a579
fix:update_on_field and duplicate_check_field dropdown listing in Si…
May 23, 2026
6f52b48
fix:Fixed Single Import update_on_field dropdown population
May 23, 2026
dfc1af9
fix: populate update and duplicate fields only after CSV upload
May 25, 2026
70a90fe
fix: show unmapped csv columns in field mapping dialog with default d…
May 25, 2026
809629a
fixtures are exported and committed
May 25, 2026
e96dfe3
more fixtures are exported
May 25, 2026
2e60850
fix: persist manual field mapping edits in mapping dialog
May 25, 2026
4e20016
feat: pass import_type parameter to prepare_records and row validatio…
basim-tridz May 26, 2026
81cdc3b
refactor: rename duplicate_check_field to update_on_field, add row in…
basim-tridz Jun 1, 2026
9129ac4
feat: aggregate target doctypes and import types for display in list …
basim-tridz Jun 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"python.defaultInterpreterPath": "../../env/bin/python",
"python.analysis.extraPaths": [
"../../apps/frappe",
"../../apps/erpnext",
"../../apps/crm",
"../../apps/waflo",
"../../apps/talal",
"../../apps/frappe_whatsapp",
"../../apps/frappe_notifier"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (c) 2025, Tridz Technologies Pvt Ltd and contributors
// For license information, please see license.txt

frappe.ui.form.on('Lightning Field Mapping', {
refresh: function(frm) {
if (frm.doc.reference_doctype) {
frm.trigger('set_field_options');
}
},

reference_doctype: function(frm) {
// Clear existing rows when changing doctype to avoid invalid mappings
if (frm.doc.mappings && frm.doc.mappings.length > 0) {
frm.clear_table('mappings');
frm.refresh_field('mappings');
}
frm.trigger('set_field_options');
},

set_field_options: function(frm) {
if (frm.doc.reference_doctype) {
frappe.call({
method: 'lightning_import.lightning_import.api.get_fields.get_doctype_fields',
args: { doctype: frm.doc.reference_doctype },
callback: function(r) {
if (r.message && r.message.fields) {
const options = [''].concat(r.message.fields.map(f => f.fieldname)).join('\n');

// 1. Update base metadata
let base_df = frappe.meta.get_docfield('Lightning Fields', 'field_name');
if (base_df) {
base_df.options = options;
}

// 2. Update form-specific metadata
let form_df = frappe.meta.get_docfield('Lightning Fields', 'field_name', frm.doc.name);
if (form_df) {
form_df.options = options;
}

// 3. Update grid column properties directly
if (frm.fields_dict.mappings && frm.fields_dict.mappings.grid) {
frm.fields_dict.mappings.grid.update_docfield_property('field_name', 'options', options);
}

frm.refresh_field('mappings');
}
}
});
} else {
// Clear options if no doctype selected
let base_df = frappe.meta.get_docfield('Lightning Fields', 'field_name');
if (base_df) base_df.options = "";

let form_df = frappe.meta.get_docfield('Lightning Fields', 'field_name', frm.doc.name);
if (form_df) form_df.options = "";

if (frm.fields_dict.mappings && frm.fields_dict.mappings.grid) {
frm.fields_dict.mappings.grid.update_docfield_property('field_name', 'options', "");
}
frm.refresh_field('mappings');
}
}
});

frappe.ui.form.on('Lightning Fields', {
mappings_add: function(frm, cdt, cdn) {
// Ensure options are set when a new row is added
frm.trigger('set_field_options');
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "LFM-.#####",
"creation": "2026-05-14 11:00:52.970656",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"reference_doctype",
"mappings"
],
"fields": [
{
"fieldname": "reference_doctype",
"fieldtype": "Link",
"label": "Reference DocType",
"options": "DocType"
},
{
"fieldname": "mappings",
"fieldtype": "Table",
"label": "Mappings",
"options": "Lightning Fields"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2026-05-14 12:47:06.768504",
"modified_by": "Administrator",
"module": "Lightning Import",
"name": "Lightning Field Mapping",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"row_format": "Dynamic",
"rows_threshold_for_grid_search": 20,
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2026, Tridz Technologies Pvt Ltd and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class LightningFieldMapping(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2026, Tridz Technologies Pvt Ltd and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestLightningFieldMapping(FrappeTestCase):
pass
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2026-05-13 12:51:05.099561",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"field_name",
"alternate_name"
],
"fields": [
{
"fieldname": "field_name",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Field Name"
},
{
"fieldname": "alternate_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Alternate Name"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2026-05-25 14:12:23.875906",
"modified_by": "Administrator",
"module": "Lightning Import",
"name": "Lightning Fields",
"owner": "Administrator",
"permissions": [],
"row_format": "Dynamic",
"rows_threshold_for_grid_search": 20,
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2026, Tridz Technologies Pvt Ltd and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class LightningFields(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) 2026, Tridz Technologies Pvt Ltd and contributors
// For license information, please see license.txt

frappe.ui.form.on("Lightning Multi Import Target", {
// custom logic for child table if needed
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2026-05-20 05:00:00",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"enabled",
"execution_order",
"target_doctype",
"import_type",
"update_on_field",
"duplicate_check_field",
"status",
"total_records",
"successful_records",
"failed_records",
"last_processed_row",
"field_mapping"
],
"fields": [
{
"default": "1",
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled"
},
{
"fieldname": "execution_order",
"fieldtype": "Int",
"label": "Execution Order"
},
{
"fieldname": "target_doctype",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Target DocType",
"options": "DocType",
"reqd": 1
},
{
"fieldname": "import_type",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Import Type",
"options": "Insert New Records\nUpdate Existing Records\nInsert and Update Records",
"reqd": 1
},
{
"fieldname": "update_on_field",
"fieldtype": "Select",
"label": "Validate On CSV Column"
},
{
"fieldname": "duplicate_check_field",
"fieldtype": "Select",
"label": "Check Duplicates in Column"
},
{
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Draft\nQueued\nIn Progress\nCompleted\nFailed\nPartial Success",
"read_only": 1
},
{
"fieldname": "total_records",
"fieldtype": "Int",
"label": "Total Records",
"read_only": 1
},
{
"fieldname": "successful_records",
"fieldtype": "Int",
"label": "Successful Records",
"read_only": 1
},
{
"fieldname": "failed_records",
"fieldtype": "Int",
"label": "Failed Records",
"read_only": 1
},
{
"fieldname": "last_processed_row",
"fieldtype": "Int",
"label": "Last Processed Row",
"read_only": 1
},
{
"fieldname": "field_mapping",
"fieldtype": "Code",
"hidden": 1,
"label": "Field Mapping",
"options": "JSON",
"read_only": 1
}
],
"istable": 1,
"links": [],
"modified": "2026-05-22 18:13:11.967628",
"modified_by": "Administrator",
"module": "Lightning Import",
"name": "Lightning Multi Import Target",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [],
"row_format": "Dynamic",
"sort_field": "execution_order",
"sort_order": "ASC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2026, Tridz Technologies Pvt Ltd and contributors
# For license information, please see license.txt

import frappe
from frappe.model.document import Document

class LightningMultiImportTarget(Document):
pass
Loading