mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 19:19:17 +00:00
* ci: add prettier to pre-commit
(cherry picked from commit 2c16036ef3)
* style: format js files
---------
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -3,20 +3,20 @@
|
||||
|
||||
frappe.provide("erpnext.integrations");
|
||||
|
||||
frappe.ui.form.on('Plaid Settings', {
|
||||
frappe.ui.form.on("Plaid Settings", {
|
||||
enabled: function (frm) {
|
||||
frm.toggle_reqd('plaid_client_id', frm.doc.enabled);
|
||||
frm.toggle_reqd('plaid_secret', frm.doc.enabled);
|
||||
frm.toggle_reqd('plaid_env', frm.doc.enabled);
|
||||
frm.toggle_reqd("plaid_client_id", frm.doc.enabled);
|
||||
frm.toggle_reqd("plaid_secret", frm.doc.enabled);
|
||||
frm.toggle_reqd("plaid_env", frm.doc.enabled);
|
||||
},
|
||||
|
||||
refresh: function (frm) {
|
||||
if (frm.doc.enabled) {
|
||||
frm.add_custom_button(__('Link a new bank account'), () => {
|
||||
frm.add_custom_button(__("Link a new bank account"), () => {
|
||||
new erpnext.integrations.plaidLink(frm);
|
||||
});
|
||||
|
||||
frm.add_custom_button(__('Reset Plaid Link'), () => {
|
||||
frm.add_custom_button(__("Reset Plaid Link"), () => {
|
||||
new erpnext.integrations.plaidLink(frm);
|
||||
});
|
||||
|
||||
@@ -29,20 +29,23 @@ frappe.ui.form.on('Plaid Settings', {
|
||||
|
||||
frappe.msgprint({
|
||||
title: __("Sync Started"),
|
||||
message: __("The sync has started in the background, please check the {0} list for new records.", [bank_transaction_link]),
|
||||
alert: 1
|
||||
message: __(
|
||||
"The sync has started in the background, please check the {0} list for new records.",
|
||||
[bank_transaction_link]
|
||||
),
|
||||
alert: 1,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}).addClass("btn-primary");
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
erpnext.integrations.plaidLink = class plaidLink {
|
||||
constructor(parent) {
|
||||
this.frm = parent;
|
||||
this.plaidUrl = 'https://cdn.plaid.com/link/v2/stable/link-initialize.js';
|
||||
this.plaidUrl = "https://cdn.plaid.com/link/v2/stable/link-initialize.js";
|
||||
this.init_config();
|
||||
}
|
||||
|
||||
@@ -55,9 +58,9 @@ erpnext.integrations.plaidLink = class plaidLink {
|
||||
}
|
||||
|
||||
async get_link_token() {
|
||||
const token = await this.frm.call("get_link_token").then(resp => resp.message);
|
||||
const token = await this.frm.call("get_link_token").then((resp) => resp.message);
|
||||
if (!token) {
|
||||
frappe.throw(__('Cannot retrieve link token. Check Error Log for more information'));
|
||||
frappe.throw(__("Cannot retrieve link token. Check Error Log for more information"));
|
||||
}
|
||||
return token;
|
||||
}
|
||||
@@ -84,55 +87,74 @@ erpnext.integrations.plaidLink = class plaidLink {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const el = document.createElement('script');
|
||||
el.type = 'text/javascript';
|
||||
const el = document.createElement("script");
|
||||
el.type = "text/javascript";
|
||||
el.async = true;
|
||||
el.src = src;
|
||||
el.addEventListener('load', resolve);
|
||||
el.addEventListener('error', reject);
|
||||
el.addEventListener('abort', reject);
|
||||
el.addEventListener("load", resolve);
|
||||
el.addEventListener("error", reject);
|
||||
el.addEventListener("abort", reject);
|
||||
document.head.appendChild(el);
|
||||
});
|
||||
}
|
||||
|
||||
onScriptLoaded(me) {
|
||||
me.linkHandler = Plaid.create({ // eslint-disable-line no-undef
|
||||
me.linkHandler = Plaid.create({
|
||||
// eslint-disable-line no-undef
|
||||
clientName: me.client_name,
|
||||
product: me.product,
|
||||
env: me.plaid_env,
|
||||
token: me.token,
|
||||
onSuccess: me.plaid_success
|
||||
onSuccess: me.plaid_success,
|
||||
});
|
||||
}
|
||||
|
||||
onScriptError(error) {
|
||||
frappe.msgprint(__("There was an issue connecting to Plaid's authentication server. Check browser console for more information"));
|
||||
frappe.msgprint(
|
||||
__(
|
||||
"There was an issue connecting to Plaid's authentication server. Check browser console for more information"
|
||||
)
|
||||
);
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
plaid_success(token, response) {
|
||||
const me = this;
|
||||
|
||||
frappe.prompt({
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
label: __("Company"),
|
||||
fieldname: "company",
|
||||
reqd: 1
|
||||
}, (data) => {
|
||||
me.company = data.company;
|
||||
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_institution', {
|
||||
token: token,
|
||||
response: response
|
||||
}).then((result) => {
|
||||
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_bank_accounts', {
|
||||
response: response,
|
||||
bank: result,
|
||||
company: me.company
|
||||
});
|
||||
}).then(() => {
|
||||
frappe.show_alert({ message: __("Bank accounts added"), indicator: 'green' });
|
||||
});
|
||||
}, __("Select a company"), __("Continue"));
|
||||
frappe.prompt(
|
||||
{
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
label: __("Company"),
|
||||
fieldname: "company",
|
||||
reqd: 1,
|
||||
},
|
||||
(data) => {
|
||||
me.company = data.company;
|
||||
frappe
|
||||
.xcall(
|
||||
"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_institution",
|
||||
{
|
||||
token: token,
|
||||
response: response,
|
||||
}
|
||||
)
|
||||
.then((result) => {
|
||||
frappe.xcall(
|
||||
"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_bank_accounts",
|
||||
{
|
||||
response: response,
|
||||
bank: result,
|
||||
company: me.company,
|
||||
}
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
frappe.show_alert({ message: __("Bank accounts added"), indicator: "green" });
|
||||
});
|
||||
},
|
||||
__("Select a company"),
|
||||
__("Continue")
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,71 +1,77 @@
|
||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('QuickBooks Migrator', {
|
||||
connect: function(frm) {
|
||||
frappe.ui.form.on("QuickBooks Migrator", {
|
||||
connect: function (frm) {
|
||||
// OAuth requires user intervention to provide application access permissionsto requested scope
|
||||
// Here we open a new window and redirect user to the authorization url.
|
||||
// After user grants us permission to access. We will set authorization details on this doc which will force refresh.
|
||||
window.open(frm.doc.authorization_url)
|
||||
window.open(frm.doc.authorization_url);
|
||||
},
|
||||
fetch_data: function(frm) {
|
||||
frm.call("migrate")
|
||||
fetch_data: function (frm) {
|
||||
frm.call("migrate");
|
||||
},
|
||||
onload: function(frm) {
|
||||
frm.trigger("set_indicator")
|
||||
var domain = frappe.urllib.get_base_url()
|
||||
var redirect_url = `${domain}/api/method/erpnext.erpnext_integrations.doctype.quickbooks_migrator.quickbooks_migrator.callback`
|
||||
onload: function (frm) {
|
||||
frm.trigger("set_indicator");
|
||||
var domain = frappe.urllib.get_base_url();
|
||||
var redirect_url = `${domain}/api/method/erpnext.erpnext_integrations.doctype.quickbooks_migrator.quickbooks_migrator.callback`;
|
||||
if (frm.doc.redirect_url != redirect_url) {
|
||||
frm.set_value("redirect_url", redirect_url)
|
||||
frm.set_value("redirect_url", redirect_url);
|
||||
}
|
||||
// Instead of changing percentage width and message of single progress bar
|
||||
// Show a different porgress bar for every action after some time remove the finished progress bar
|
||||
// Former approach causes the progress bar to dance back and forth.
|
||||
frm.trigger("set_indicator")
|
||||
frappe.realtime.on("quickbooks_progress_update", function (data) {
|
||||
frm.dashboard.show_progress(data.message, (data.count / data.total) * 100, data.message)
|
||||
// Former approach causes the progress bar to dance back and forth.
|
||||
frm.trigger("set_indicator");
|
||||
frappe.realtime.on("quickbooks_progress_update", function (data) {
|
||||
frm.dashboard.show_progress(data.message, (data.count / data.total) * 100, data.message);
|
||||
if (data.count == data.total) {
|
||||
window.setTimeout( function(message) {frm.dashboard.hide_progress(message)}, 1500, data.messsage)
|
||||
window.setTimeout(
|
||||
function (message) {
|
||||
frm.dashboard.hide_progress(message);
|
||||
},
|
||||
1500,
|
||||
data.messsage
|
||||
);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
refresh: function(frm) {
|
||||
frm.trigger("set_indicator")
|
||||
refresh: function (frm) {
|
||||
frm.trigger("set_indicator");
|
||||
if (!frm.doc.access_token) {
|
||||
// Unset access_token signifies that we don't have enough information to connect to quickbooks api and fetch data
|
||||
if (frm.doc.authorization_url) {
|
||||
frm.add_custom_button(__("Connect to Quickbooks"), function () {
|
||||
frm.trigger("connect")
|
||||
frm.trigger("connect");
|
||||
});
|
||||
}
|
||||
}
|
||||
if (frm.doc.access_token) {
|
||||
// If we have access_token that means we also have refresh_token we don't need user intervention anymore
|
||||
// All we need now is a Company from erpnext
|
||||
frm.remove_custom_button(__("Connect to Quickbooks"))
|
||||
frm.remove_custom_button(__("Connect to Quickbooks"));
|
||||
|
||||
frm.toggle_display("company_settings", 1)
|
||||
frm.set_df_property("company", "reqd", 1)
|
||||
frm.toggle_display("company_settings", 1);
|
||||
frm.set_df_property("company", "reqd", 1);
|
||||
if (frm.doc.company) {
|
||||
frm.add_custom_button(__("Fetch Data"), function () {
|
||||
frm.trigger("fetch_data")
|
||||
frm.add_custom_button(__("Fetch Data"), function () {
|
||||
frm.trigger("fetch_data");
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
set_indicator: function(frm) {
|
||||
set_indicator: function (frm) {
|
||||
var indicator_map = {
|
||||
"Connecting to QuickBooks": [__("Connecting to QuickBooks"), "orange"],
|
||||
"Connected to QuickBooks": [__("Connected to QuickBooks"), "green"],
|
||||
"In Progress": [__("In Progress"), "orange"],
|
||||
"Complete": [__("Complete"), "green"],
|
||||
"Failed": [__("Failed"), "red"],
|
||||
}
|
||||
Complete: [__("Complete"), "green"],
|
||||
Failed: [__("Failed"), "red"],
|
||||
};
|
||||
if (frm.doc.status) {
|
||||
var indicator = indicator_map[frm.doc.status]
|
||||
var label = indicator[0]
|
||||
var color = indicator[1]
|
||||
frm.page.set_indicator(label, color)
|
||||
var indicator = indicator_map[frm.doc.status];
|
||||
var label = indicator[0];
|
||||
var color = indicator[1];
|
||||
frm.page.set_indicator(label, color);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -16,24 +16,29 @@ frappe.ui.form.on("Tally Migration", {
|
||||
frm.dashboard.show_progress(data.title, (data.count / data.total) * 100, data.message);
|
||||
let error_occurred = data.count === -1;
|
||||
if (data.count == data.total || error_occurred) {
|
||||
window.setTimeout((title) => {
|
||||
frm.dashboard.hide_progress(title);
|
||||
frm.reload_doc();
|
||||
if (error_occurred) {
|
||||
frappe.msgprint({
|
||||
message: __("An error has occurred during {0}. Check {1} for more details",
|
||||
[
|
||||
repl("<a href='/app/tally-migration/%(tally_document)s' class='variant-click'>%(tally_document)s</a>", {
|
||||
tally_document: frm.docname
|
||||
}),
|
||||
"<a href='/app/error-log' class='variant-click'>Error Log</a>"
|
||||
]
|
||||
),
|
||||
title: __("Tally Migration Error"),
|
||||
indicator: "red"
|
||||
});
|
||||
}
|
||||
}, 2000, data.title);
|
||||
window.setTimeout(
|
||||
(title) => {
|
||||
frm.dashboard.hide_progress(title);
|
||||
frm.reload_doc();
|
||||
if (error_occurred) {
|
||||
frappe.msgprint({
|
||||
message: __("An error has occurred during {0}. Check {1} for more details", [
|
||||
repl(
|
||||
"<a href='/app/tally-migration/%(tally_document)s' class='variant-click'>%(tally_document)s</a>",
|
||||
{
|
||||
tally_document: frm.docname,
|
||||
}
|
||||
),
|
||||
"<a href='/app/error-log' class='variant-click'>Error Log</a>",
|
||||
]),
|
||||
title: __("Tally Migration Error"),
|
||||
indicator: "red",
|
||||
});
|
||||
}
|
||||
},
|
||||
2000,
|
||||
data.title
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -43,10 +48,10 @@ frappe.ui.form.on("Tally Migration", {
|
||||
erpnext.tally_migration.failed_import_log = JSON.parse(frm.doc.failed_import_log);
|
||||
erpnext.tally_migration.fixed_errors_log = JSON.parse(frm.doc.fixed_errors_log);
|
||||
|
||||
["default_round_off_account", "default_warehouse", "default_cost_center"].forEach(account => {
|
||||
frm.toggle_reqd(account, frm.doc.is_master_data_imported === 1)
|
||||
frm.toggle_enable(account, frm.doc.is_day_book_data_processed != 1)
|
||||
})
|
||||
["default_round_off_account", "default_warehouse", "default_cost_center"].forEach((account) => {
|
||||
frm.toggle_reqd(account, frm.doc.is_master_data_imported === 1);
|
||||
frm.toggle_enable(account, frm.doc.is_day_book_data_processed != 1);
|
||||
});
|
||||
|
||||
if (frm.doc.master_data && !frm.doc.is_master_data_imported) {
|
||||
if (frm.doc.is_master_data_processed) {
|
||||
@@ -74,27 +79,27 @@ frappe.ui.form.on("Tally Migration", {
|
||||
},
|
||||
|
||||
erpnext_company: function (frm) {
|
||||
frappe.db.exists("Company", frm.doc.erpnext_company).then(exists => {
|
||||
frappe.db.exists("Company", frm.doc.erpnext_company).then((exists) => {
|
||||
if (exists) {
|
||||
frappe.msgprint(
|
||||
__("Company {0} already exists. Continuing will overwrite the Company and Chart of Accounts", [frm.doc.erpnext_company]),
|
||||
__(
|
||||
"Company {0} already exists. Continuing will overwrite the Company and Chart of Accounts",
|
||||
[frm.doc.erpnext_company]
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
add_button: function (frm, label, method) {
|
||||
frm.add_custom_button(
|
||||
label,
|
||||
() => {
|
||||
frm.call({
|
||||
doc: frm.doc,
|
||||
method: method,
|
||||
freeze: true
|
||||
});
|
||||
frm.reload_doc();
|
||||
}
|
||||
);
|
||||
frm.add_custom_button(label, () => {
|
||||
frm.call({
|
||||
doc: frm.doc,
|
||||
method: method,
|
||||
freeze: true,
|
||||
});
|
||||
frm.reload_doc();
|
||||
});
|
||||
},
|
||||
|
||||
render_html_table(frm, shown_logs, hidden_logs, field) {
|
||||
@@ -102,23 +107,26 @@ frappe.ui.form.on("Tally Migration", {
|
||||
frm.toggle_display(field, true);
|
||||
} else {
|
||||
frm.toggle_display(field, false);
|
||||
return
|
||||
return;
|
||||
}
|
||||
let rows = erpnext.tally_migration.get_html_rows(shown_logs, field);
|
||||
let rows_head, table_caption;
|
||||
|
||||
let table_footer = (hidden_logs && (hidden_logs.length > 0)) ? `<tr class="text-muted">
|
||||
let table_footer =
|
||||
hidden_logs && hidden_logs.length > 0
|
||||
? `<tr class="text-muted">
|
||||
<td colspan="4">And ${hidden_logs.length} more others</td>
|
||||
</tr>`: "";
|
||||
</tr>`
|
||||
: "";
|
||||
|
||||
if (field === "fixed_error_log_preview") {
|
||||
rows_head = `<th width="75%">${__("Meta Data")}</th>
|
||||
<th width="10%">${__("Unresolve")}</th>`
|
||||
table_caption = "Resolved Issues"
|
||||
<th width="10%">${__("Unresolve")}</th>`;
|
||||
table_caption = "Resolved Issues";
|
||||
} else {
|
||||
rows_head = `<th width="75%">${__("Error Message")}</th>
|
||||
<th width="10%">${__("Create")}</th>`
|
||||
table_caption = "Error Log"
|
||||
<th width="10%">${__("Create")}</th>`;
|
||||
table_caption = "Error Log";
|
||||
}
|
||||
|
||||
frm.get_field(field).$wrapper.html(`
|
||||
@@ -144,7 +152,7 @@ frappe.ui.form.on("Tally Migration", {
|
||||
summary[row.doc.doctype] = 1;
|
||||
}
|
||||
}
|
||||
return summary
|
||||
return summary;
|
||||
}, {});
|
||||
console.table(summary);
|
||||
},
|
||||
@@ -177,7 +185,7 @@ frappe.ui.form.on("Tally Migration", {
|
||||
let hidden_logs = completed_log.slice(20);
|
||||
|
||||
frm.events.render_html_table(frm, logs, hidden_logs, "fixed_error_log_preview");
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
erpnext.tally_migration.getError = (traceback) => {
|
||||
@@ -186,31 +194,33 @@ erpnext.tally_migration.getError = (traceback) => {
|
||||
let message;
|
||||
|
||||
if (is_multiline) {
|
||||
let exc_error_idx = traceback.trim().lastIndexOf("\n") + 1
|
||||
let error_line = traceback.substr(exc_error_idx)
|
||||
let split_str_idx = (error_line.indexOf(':') > 0) ? error_line.indexOf(':') + 1 : 0;
|
||||
let exc_error_idx = traceback.trim().lastIndexOf("\n") + 1;
|
||||
let error_line = traceback.substr(exc_error_idx);
|
||||
let split_str_idx = error_line.indexOf(":") > 0 ? error_line.indexOf(":") + 1 : 0;
|
||||
message = error_line.slice(split_str_idx).trim();
|
||||
} else {
|
||||
message = traceback;
|
||||
}
|
||||
|
||||
return message
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
erpnext.tally_migration.cleanDoc = (obj) => {
|
||||
/* Strips all null and empty values of your JSON object */
|
||||
let temp = obj;
|
||||
$.each(temp, function(key, value){
|
||||
if (value === "" || value === null){
|
||||
$.each(temp, function (key, value) {
|
||||
if (value === "" || value === null) {
|
||||
delete obj[key];
|
||||
} else if (Object.prototype.toString.call(value) === '[object Object]') {
|
||||
} else if (Object.prototype.toString.call(value) === "[object Object]") {
|
||||
erpnext.tally_migration.cleanDoc(value);
|
||||
} else if ($.isArray(value)) {
|
||||
$.each(value, function (k,v) { erpnext.tally_migration.cleanDoc(v); });
|
||||
$.each(value, function (k, v) {
|
||||
erpnext.tally_migration.cleanDoc(v);
|
||||
});
|
||||
}
|
||||
});
|
||||
return temp;
|
||||
}
|
||||
};
|
||||
|
||||
erpnext.tally_migration.unresolve = (document) => {
|
||||
/* Mark document migration as unresolved ie. move to failed error log */
|
||||
@@ -218,9 +228,9 @@ erpnext.tally_migration.unresolve = (document) => {
|
||||
let failed_log = erpnext.tally_migration.failed_import_log;
|
||||
let fixed_log = erpnext.tally_migration.fixed_errors_log;
|
||||
|
||||
let modified_fixed_log = fixed_log.filter(row => {
|
||||
let modified_fixed_log = fixed_log.filter((row) => {
|
||||
if (!frappe.utils.deep_equal(erpnext.tally_migration.cleanDoc(row.doc), document)) {
|
||||
return row
|
||||
return row;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -231,7 +241,7 @@ erpnext.tally_migration.unresolve = (document) => {
|
||||
|
||||
frm.dirty();
|
||||
frm.save();
|
||||
}
|
||||
};
|
||||
|
||||
erpnext.tally_migration.resolve = (document) => {
|
||||
/* Mark document migration as resolved ie. move to fixed error log */
|
||||
@@ -239,9 +249,9 @@ erpnext.tally_migration.resolve = (document) => {
|
||||
let failed_log = erpnext.tally_migration.failed_import_log;
|
||||
let fixed_log = erpnext.tally_migration.fixed_errors_log;
|
||||
|
||||
let modified_failed_log = failed_log.filter(row => {
|
||||
let modified_failed_log = failed_log.filter((row) => {
|
||||
if (!frappe.utils.deep_equal(erpnext.tally_migration.cleanDoc(row.doc), document)) {
|
||||
return row
|
||||
return row;
|
||||
}
|
||||
});
|
||||
fixed_log.push({ doc: document, exc: `Solved on ${Date()}` });
|
||||
@@ -251,27 +261,27 @@ erpnext.tally_migration.resolve = (document) => {
|
||||
|
||||
frm.dirty();
|
||||
frm.save();
|
||||
}
|
||||
};
|
||||
|
||||
erpnext.tally_migration.create_new_doc = (document) => {
|
||||
/* Mark as resolved and create new document */
|
||||
erpnext.tally_migration.resolve(document);
|
||||
return frappe.call({
|
||||
type: "POST",
|
||||
method: 'erpnext.erpnext_integrations.doctype.tally_migration.tally_migration.new_doc',
|
||||
method: "erpnext.erpnext_integrations.doctype.tally_migration.tally_migration.new_doc",
|
||||
args: {
|
||||
document
|
||||
document,
|
||||
},
|
||||
freeze: true,
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
callback: function (r) {
|
||||
if (!r.exc) {
|
||||
frappe.model.sync(r.message);
|
||||
frappe.get_doc(r.message.doctype, r.message.name).__run_link_triggers = true;
|
||||
frappe.set_route("Form", r.message.doctype, r.message.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
erpnext.tally_migration.get_html_rows = (logs, field) => {
|
||||
let index = 0;
|
||||
@@ -304,14 +314,18 @@ erpnext.tally_migration.get_html_rows = (logs, field) => {
|
||||
</div>`;
|
||||
|
||||
let create_button = `
|
||||
<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.create_new_doc(${JSON.stringify(doc)})'>
|
||||
<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.create_new_doc(${JSON.stringify(
|
||||
doc
|
||||
)})'>
|
||||
${__("Create Document")}
|
||||
</button>`
|
||||
</button>`;
|
||||
|
||||
let mark_as_unresolved = `
|
||||
<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.unresolve(${JSON.stringify(doc)})'>
|
||||
<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.unresolve(${JSON.stringify(
|
||||
doc
|
||||
)})'>
|
||||
${__("Mark as unresolved")}
|
||||
</button>`
|
||||
</button>`;
|
||||
|
||||
if (field === "fixed_error_log_preview") {
|
||||
return `<tr>
|
||||
@@ -343,7 +357,8 @@ erpnext.tally_migration.get_html_rows = (logs, field) => {
|
||||
</td>
|
||||
</tr>`;
|
||||
}
|
||||
}).join("");
|
||||
})
|
||||
.join("");
|
||||
|
||||
return rows
|
||||
}
|
||||
return rows;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user