2018-01-16 06:09:17 +00:00
|
|
|
const frappe = require('frappejs');
|
2018-02-13 11:54:57 +00:00
|
|
|
const Observable = require('frappejs/utils/observable');
|
2018-03-05 16:45:21 +00:00
|
|
|
const naming = require('./naming');
|
2018-01-12 12:25:07 +00:00
|
|
|
|
2018-02-13 11:54:57 +00:00
|
|
|
module.exports = class BaseDocument extends Observable {
|
2019-07-30 11:01:06 +00:00
|
|
|
constructor(data) {
|
|
|
|
super();
|
|
|
|
this.fetchValuesCache = {};
|
|
|
|
this.flags = {};
|
|
|
|
this.setup();
|
2019-10-08 11:16:54 +00:00
|
|
|
this.setValues(data);
|
2019-07-30 11:01:06 +00:00
|
|
|
|
|
|
|
// clear fetch-values cache
|
|
|
|
frappe.db.on(
|
|
|
|
'change',
|
|
|
|
params => (this.fetchValuesCache[`${params.doctype}:${params.name}`] = {})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
// add listeners
|
|
|
|
}
|
|
|
|
|
2019-10-08 11:16:54 +00:00
|
|
|
setValues(data) {
|
|
|
|
for (let fieldname in data) {
|
|
|
|
let value = data[fieldname];
|
2019-10-19 14:35:13 +00:00
|
|
|
if (fieldname.startsWith('_')) {
|
|
|
|
// private property
|
|
|
|
this[fieldname] = value;
|
|
|
|
} else if (Array.isArray(value)) {
|
2019-10-08 11:16:54 +00:00
|
|
|
for (let row of value) {
|
|
|
|
this.append(fieldname, row);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this[fieldname] = value;
|
|
|
|
}
|
|
|
|
}
|
2019-10-19 14:35:13 +00:00
|
|
|
// set unset fields as null
|
|
|
|
for (let field of this.meta.getValidFields()) {
|
|
|
|
// check for null or undefined
|
|
|
|
if (this[field.fieldname] == null) {
|
|
|
|
this[field.fieldname] = null;
|
|
|
|
}
|
|
|
|
}
|
2019-10-08 11:16:54 +00:00
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
get meta() {
|
|
|
|
if (this.isCustom) {
|
|
|
|
this._meta = frappe.createMeta(this.fields);
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
if (!this._meta) {
|
|
|
|
this._meta = frappe.getMeta(this.doctype);
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
return this._meta;
|
|
|
|
}
|
2018-01-12 12:25:07 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
async getSettings() {
|
|
|
|
if (!this._settings) {
|
|
|
|
this._settings = await frappe.getSingle(this.meta.settings);
|
2018-02-12 12:01:31 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
return this._settings;
|
|
|
|
}
|
|
|
|
|
|
|
|
// set value and trigger change
|
|
|
|
async set(fieldname, value) {
|
|
|
|
if (typeof fieldname === 'object') {
|
|
|
|
const valueDict = fieldname;
|
|
|
|
for (let fieldname in valueDict) {
|
|
|
|
await this.set(fieldname, valueDict[fieldname]);
|
|
|
|
}
|
|
|
|
return;
|
2018-02-12 12:01:31 +00:00
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
if (this[fieldname] !== value) {
|
|
|
|
this._dirty = true;
|
2019-10-08 11:16:54 +00:00
|
|
|
if (Array.isArray(value)) {
|
|
|
|
this[fieldname] = [];
|
|
|
|
for (let row of value) {
|
|
|
|
this.append(fieldname, row);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this[fieldname] = await this.validateField(fieldname, value);
|
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
await this.applyChange(fieldname);
|
2018-02-16 13:13:46 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async applyChange(fieldname) {
|
|
|
|
if (await this.applyFormula()) {
|
|
|
|
// multiple changes
|
|
|
|
await this.trigger('change', {
|
2019-08-28 08:54:11 +00:00
|
|
|
doc: this,
|
|
|
|
changed: fieldname
|
2019-07-30 11:01:06 +00:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
// no other change, trigger control refresh
|
|
|
|
await this.trigger('change', {
|
|
|
|
doc: this,
|
2019-08-28 08:54:11 +00:00
|
|
|
fieldname: fieldname,
|
|
|
|
changed: fieldname
|
2019-07-30 11:01:06 +00:00
|
|
|
});
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
setDefaults() {
|
|
|
|
for (let field of this.meta.fields) {
|
2019-10-19 14:36:53 +00:00
|
|
|
if (this[field.fieldname] == null) {
|
2019-07-30 11:01:06 +00:00
|
|
|
let defaultValue = null;
|
|
|
|
|
|
|
|
if (field.fieldtype === 'Table') {
|
|
|
|
defaultValue = [];
|
2018-02-12 12:01:31 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
if (field.default) {
|
|
|
|
defaultValue = field.default;
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
this[field.fieldname] = defaultValue;
|
|
|
|
}
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-10-19 14:36:53 +00:00
|
|
|
|
|
|
|
if (this.meta.basedOn && this.meta.filters) {
|
|
|
|
this.setValues(this.meta.filters);
|
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
2018-01-12 12:25:07 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
setKeywords() {
|
|
|
|
let keywords = [];
|
|
|
|
for (let fieldname of this.meta.getKeywordFields()) {
|
|
|
|
keywords.push(this[fieldname]);
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
this.keywords = keywords.join(', ');
|
|
|
|
}
|
2018-01-12 12:25:07 +00:00
|
|
|
|
2019-10-08 11:16:54 +00:00
|
|
|
append(key, document = {}) {
|
2019-07-30 11:01:06 +00:00
|
|
|
if (!this[key]) {
|
|
|
|
this[key] = [];
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-10-08 11:16:54 +00:00
|
|
|
this[key].push(this._initChild(document, key));
|
2019-10-19 14:36:29 +00:00
|
|
|
this._dirty = true;
|
|
|
|
this.applyChange(key);
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
2019-10-08 11:16:54 +00:00
|
|
|
_initChild(data, key) {
|
|
|
|
if (data instanceof BaseDocument) {
|
2019-07-30 11:01:06 +00:00
|
|
|
return data;
|
|
|
|
} else {
|
2019-10-19 14:36:29 +00:00
|
|
|
data.doctype = this.meta.getField(key).childtype;
|
2019-10-08 11:16:54 +00:00
|
|
|
data.parent = this.name;
|
|
|
|
data.parenttype = this.doctype;
|
|
|
|
data.parentfield = key;
|
2019-10-19 14:36:29 +00:00
|
|
|
data.parentdoc = this;
|
2019-10-08 11:16:54 +00:00
|
|
|
|
|
|
|
if (!data.idx) {
|
|
|
|
data.idx = (this[key] || []).length;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!data.name) {
|
|
|
|
data.name = frappe.getRandomString();
|
|
|
|
}
|
|
|
|
|
2019-10-08 07:41:13 +00:00
|
|
|
return new BaseDocument(data);
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
}
|
2018-01-12 12:25:07 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
async validateField(key, value) {
|
|
|
|
let field = this.meta.getField(key);
|
|
|
|
if (field && field.fieldtype == 'Select') {
|
|
|
|
return this.meta.validateSelect(field, value);
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
return value;
|
|
|
|
}
|
2018-01-12 12:25:07 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
getValidDict() {
|
|
|
|
let data = {};
|
|
|
|
for (let field of this.meta.getValidFields()) {
|
2019-11-15 07:45:16 +00:00
|
|
|
let value = this[field.fieldname];
|
|
|
|
if (Array.isArray(value)) {
|
|
|
|
value = value.map(doc => doc.getValidDict ? doc.getValidDict() : doc);
|
|
|
|
}
|
|
|
|
data[field.fieldname] = value;
|
2018-03-05 16:45:21 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
getFullDict() {
|
|
|
|
let data = this.getValidDict();
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
setStandardValues() {
|
|
|
|
// set standard values on server-side only
|
|
|
|
if (frappe.isServer) {
|
|
|
|
let now = new Date().toISOString();
|
|
|
|
if (!this.submitted) {
|
|
|
|
this.submitted = 0;
|
|
|
|
}
|
2018-03-05 16:45:21 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
if (!this.owner) {
|
|
|
|
this.owner = frappe.session.user;
|
|
|
|
}
|
2018-05-07 04:23:20 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
if (!this.creation) {
|
|
|
|
this.creation = now;
|
|
|
|
}
|
2018-05-07 04:23:20 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
if (!this.modifiedBy) {
|
|
|
|
this.modifiedBy = frappe.session.user;
|
|
|
|
}
|
|
|
|
this.modified = now;
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async load() {
|
|
|
|
let data = await frappe.db.get(this.doctype, this.name);
|
|
|
|
if (data.name) {
|
|
|
|
this.syncValues(data);
|
|
|
|
if (this.meta.isSingle) {
|
|
|
|
this.setDefaults();
|
|
|
|
}
|
2019-11-15 07:45:16 +00:00
|
|
|
await this.loadLinks();
|
2019-07-30 11:01:06 +00:00
|
|
|
} else {
|
2019-11-15 07:45:16 +00:00
|
|
|
throw new frappe.errors.NotFoundError(
|
2019-07-30 11:01:06 +00:00
|
|
|
`Not Found: ${this.doctype} ${this.name}`
|
|
|
|
);
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
2019-11-15 07:45:16 +00:00
|
|
|
async loadLinks() {
|
|
|
|
this._links = {};
|
|
|
|
let inlineLinks = this.meta.fields.filter(df => df.inline);
|
|
|
|
for (let df of inlineLinks) {
|
|
|
|
if (this[df.fieldname]) {
|
|
|
|
this._links[df.fieldname] = await frappe.getDoc(
|
|
|
|
df.target,
|
|
|
|
this[df.fieldname]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
getLink(fieldname) {
|
|
|
|
return this._links ? this._links[fieldname] : null;
|
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
syncValues(data) {
|
|
|
|
this.clearValues();
|
2019-10-19 14:35:13 +00:00
|
|
|
this.setValues(data);
|
2019-07-30 11:01:06 +00:00
|
|
|
this._dirty = false;
|
|
|
|
this.trigger('change', {
|
|
|
|
doc: this
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
clearValues() {
|
2019-10-29 20:54:05 +00:00
|
|
|
let toClear = ['_dirty', '_notInserted'].concat(
|
|
|
|
this.meta.getValidFields().map(df => df.fieldname)
|
|
|
|
);
|
|
|
|
for (let key of toClear) {
|
2019-11-15 07:45:16 +00:00
|
|
|
this[key] = null;
|
2018-02-01 11:07:36 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
setChildIdx() {
|
|
|
|
// renumber children
|
|
|
|
for (let field of this.meta.getValidFields()) {
|
|
|
|
if (field.fieldtype === 'Table') {
|
|
|
|
for (let i = 0; i < (this[field.fieldname] || []).length; i++) {
|
|
|
|
this[field.fieldname][i].idx = i;
|
2018-02-01 11:07:36 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
2018-02-01 11:07:36 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async compareWithCurrentDoc() {
|
|
|
|
if (frappe.isServer && !this.isNew()) {
|
|
|
|
let currentDoc = await frappe.db.get(this.doctype, this.name);
|
|
|
|
|
|
|
|
// check for conflict
|
|
|
|
if (currentDoc && this.modified != currentDoc.modified) {
|
|
|
|
throw new frappe.errors.Conflict(
|
|
|
|
frappe._('Document {0} {1} has been modified after loading', [
|
|
|
|
this.doctype,
|
|
|
|
this.name
|
|
|
|
])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.submitted && !this.meta.isSubmittable) {
|
|
|
|
throw new frappe.errors.ValidationError(
|
|
|
|
frappe._('Document type {1} is not submittable', [this.doctype])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// set submit action flag
|
|
|
|
if (this.submitted && !currentDoc.submitted) {
|
|
|
|
this.flags.submitAction = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentDoc.submitted && !this.submitted) {
|
|
|
|
this.flags.revertAction = true;
|
|
|
|
}
|
2018-02-07 13:23:52 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
2018-02-07 13:23:52 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
async applyFormula() {
|
|
|
|
if (!this.meta.hasFormula()) {
|
|
|
|
return false;
|
2018-02-27 16:29:14 +00:00
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
let doc = this;
|
|
|
|
|
|
|
|
// children
|
|
|
|
for (let tablefield of this.meta.getTableFields()) {
|
|
|
|
let formulaFields = frappe
|
|
|
|
.getMeta(tablefield.childtype)
|
|
|
|
.getFormulaFields();
|
|
|
|
if (formulaFields.length) {
|
|
|
|
// for each row
|
|
|
|
for (let row of this[tablefield.fieldname]) {
|
|
|
|
for (let field of formulaFields) {
|
|
|
|
if (shouldApplyFormula(field, row)) {
|
|
|
|
const val = await field.formula(row, doc);
|
|
|
|
if (val !== false && val !== undefined) {
|
|
|
|
row[field.fieldname] = val;
|
|
|
|
}
|
2018-02-08 11:45:32 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
2018-02-08 11:45:32 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
2018-02-07 13:23:52 +00:00
|
|
|
}
|
|
|
|
|
2019-10-19 14:36:29 +00:00
|
|
|
// parent or child row
|
2019-07-30 11:01:06 +00:00
|
|
|
for (let field of this.meta.getFormulaFields()) {
|
|
|
|
if (shouldApplyFormula(field, doc)) {
|
2019-10-19 14:36:29 +00:00
|
|
|
let val;
|
|
|
|
if (this.meta.isChild) {
|
|
|
|
val = await field.formula(doc, this.parentdoc);
|
|
|
|
} else {
|
|
|
|
val = await field.formula(doc);
|
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
if (val !== false && val !== undefined) {
|
|
|
|
doc[field.fieldname] = val;
|
|
|
|
}
|
|
|
|
}
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
return true;
|
2018-03-05 16:45:21 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
function shouldApplyFormula(field, doc) {
|
|
|
|
if (field.readOnly) {
|
|
|
|
return true;
|
|
|
|
}
|
2018-03-05 16:45:21 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
if (!frappe.isServer || frappe.isElectron) {
|
|
|
|
if (doc[field.fieldname] == null || doc[field.fieldname] == '') {
|
|
|
|
return true;
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
return false;
|
2018-01-12 12:25:07 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
}
|
|
|
|
|
2019-10-29 19:38:43 +00:00
|
|
|
async setName() {
|
|
|
|
await naming.setName(this);
|
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
async commit() {
|
|
|
|
// re-run triggers
|
|
|
|
this.setStandardValues();
|
|
|
|
this.setKeywords();
|
|
|
|
this.setChildIdx();
|
|
|
|
await this.applyFormula();
|
|
|
|
await this.trigger('validate');
|
|
|
|
}
|
|
|
|
|
|
|
|
async insert() {
|
2019-10-29 19:38:43 +00:00
|
|
|
await this.setName();
|
2019-07-30 11:01:06 +00:00
|
|
|
await this.commit();
|
|
|
|
await this.trigger('beforeInsert');
|
|
|
|
|
2019-10-19 14:29:41 +00:00
|
|
|
let oldName = this.name;
|
2019-07-30 11:01:06 +00:00
|
|
|
const data = await frappe.db.insert(this.doctype, this.getValidDict());
|
|
|
|
this.syncValues(data);
|
|
|
|
|
2019-10-19 14:29:41 +00:00
|
|
|
if (oldName !== this.name) {
|
|
|
|
frappe.removeFromCache(this.doctype, oldName);
|
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
await this.trigger('afterInsert');
|
|
|
|
await this.trigger('afterSave');
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
async update() {
|
|
|
|
await this.compareWithCurrentDoc();
|
|
|
|
await this.commit();
|
|
|
|
await this.trigger('beforeUpdate');
|
|
|
|
|
|
|
|
// before submit
|
|
|
|
if (this.flags.submitAction) await this.trigger('beforeSubmit');
|
|
|
|
if (this.flags.revertAction) await this.trigger('beforeRevert');
|
|
|
|
|
|
|
|
const data = await frappe.db.update(this.doctype, this.getValidDict());
|
|
|
|
this.syncValues(data);
|
|
|
|
|
|
|
|
await this.trigger('afterUpdate');
|
|
|
|
await this.trigger('afterSave');
|
|
|
|
|
|
|
|
// after submit
|
|
|
|
if (this.flags.submitAction) await this.trigger('afterSubmit');
|
|
|
|
if (this.flags.revertAction) await this.trigger('afterRevert');
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2019-11-15 07:45:16 +00:00
|
|
|
insertOrUpdate() {
|
|
|
|
if (this._notInserted) {
|
|
|
|
return this.insert();
|
|
|
|
} else {
|
|
|
|
return this.update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
async delete() {
|
|
|
|
await this.trigger('beforeDelete');
|
|
|
|
await frappe.db.delete(this.doctype, this.name);
|
|
|
|
await this.trigger('afterDelete');
|
|
|
|
}
|
|
|
|
|
|
|
|
async submit() {
|
|
|
|
this.submitted = 1;
|
|
|
|
this.update();
|
|
|
|
}
|
|
|
|
|
|
|
|
async revert() {
|
|
|
|
this.submitted = 0;
|
|
|
|
this.update();
|
|
|
|
}
|
|
|
|
|
2019-10-05 21:46:14 +00:00
|
|
|
async rename(newName) {
|
|
|
|
await this.trigger('beforeRename');
|
|
|
|
await frappe.db.rename(this.doctype, this.name, newName);
|
|
|
|
this.name = newName;
|
|
|
|
await this.trigger('afterRename');
|
|
|
|
}
|
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
// trigger methods on the class if they match
|
|
|
|
// with the trigger name
|
|
|
|
async trigger(event, params) {
|
|
|
|
if (this[event]) {
|
|
|
|
await this[event](params);
|
2018-02-09 12:55:55 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
await super.trigger(event, params);
|
|
|
|
}
|
|
|
|
|
|
|
|
// helper functions
|
|
|
|
getSum(tablefield, childfield) {
|
|
|
|
return this[tablefield]
|
2019-11-15 07:45:16 +00:00
|
|
|
.map(d => parseFloat(d[childfield], 10) || 0)
|
2019-07-30 11:01:06 +00:00
|
|
|
.reduce((a, b) => a + b, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
async getFrom(doctype, name, fieldname) {
|
|
|
|
if (!name) return '';
|
|
|
|
let _values =
|
|
|
|
this.fetchValuesCache[`${doctype}:${name}`] ||
|
|
|
|
(this.fetchValuesCache[`${doctype}:${name}`] = {});
|
|
|
|
if (!_values[fieldname]) {
|
|
|
|
_values[fieldname] = await frappe.db.getValue(doctype, name, fieldname);
|
2018-02-09 12:55:55 +00:00
|
|
|
}
|
2019-07-30 11:01:06 +00:00
|
|
|
return _values[fieldname];
|
|
|
|
}
|
2018-11-09 19:07:14 +00:00
|
|
|
|
2019-07-30 11:01:06 +00:00
|
|
|
isNew() {
|
|
|
|
return this._notInserted;
|
|
|
|
}
|
|
|
|
};
|