2
0
mirror of https://github.com/frappe/books.git synced 2025-01-10 18:24:40 +00:00

[model] copy base object before extending

This commit is contained in:
Faris Ansari 2018-06-15 21:12:02 +05:30
parent 66c439d3d1
commit 084bd05fa9

View File

@ -2,6 +2,7 @@ const deepmerge = require('deepmerge');
module.exports = { module.exports = {
extend: (base, target, options = {}) => { extend: (base, target, options = {}) => {
base = deepmerge({}, base);
const fieldsToMerge = (target.fields || []).map(df => df.fieldname); const fieldsToMerge = (target.fields || []).map(df => df.fieldname);
const fieldsToRemove = options.skipFields || []; const fieldsToRemove = options.skipFields || [];