refactor: clean up long conditional
This commit is contained in:
parent
88b854c859
commit
ed64dd728e
1 changed files with 6 additions and 7 deletions
|
|
@ -290,13 +290,12 @@ $.extend(frappe.model, {
|
|||
// don't copy name and blank fields
|
||||
let df = frappe.meta.get_docfield(doc.doctype, key);
|
||||
|
||||
if (
|
||||
df &&
|
||||
key.substring(0, 2) != "__" &&
|
||||
!no_copy_list.includes(key) &&
|
||||
!(df && !from_amend && cint(df.no_copy) == 1) &&
|
||||
df.fieldtype !== "Password"
|
||||
) {
|
||||
const is_internal_field = key.substring(0, 2) === "__";
|
||||
const is_blocked_field = no_copy_list.includes(key);
|
||||
const is_no_copy = !from_amend && df && cint(df.no_copy) == 1;
|
||||
const is_password = df && df.fieldtype === "Password";
|
||||
|
||||
if (df && !is_internal_field && !is_blocked_field && !is_no_copy && !is_password) {
|
||||
let value = doc[key] || [];
|
||||
if (frappe.model.table_fields.includes(df.fieldtype)) {
|
||||
for (let i = 0, j = value.length; i < j; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue