mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
nested set wip
This commit is contained in:
parent
6fb782b300
commit
769c9e86bd
@ -206,7 +206,7 @@ module.exports = class BaseForm extends Observable {
|
||||
}
|
||||
|
||||
refreshLinks(links) {
|
||||
if (!this.container) return;
|
||||
if (!(this.container && this.container.clearLinks)) return;
|
||||
|
||||
this.container.clearLinks();
|
||||
for(let link of links) {
|
||||
|
@ -7,8 +7,6 @@ async function getHTML(doctype, name) {
|
||||
let doc = await frappe.getDoc(doctype, name);
|
||||
let context = {doc: doc, frappe: frappe};
|
||||
|
||||
console.log(context);
|
||||
|
||||
let html;
|
||||
try {
|
||||
html = nunjucks.renderString(printFormat.template, context);
|
||||
|
@ -34,5 +34,13 @@ module.exports = {
|
||||
{
|
||||
fieldname: 'parentfield', fieldtype: 'Data', required: 1
|
||||
}
|
||||
],
|
||||
treeFields: [
|
||||
{
|
||||
fieldname: 'lft', fieldtype: 'Int', required: 1
|
||||
},
|
||||
{
|
||||
fieldname: 'rgt', fieldtype: 'Int', required: 1
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
||||
|
@ -112,6 +112,15 @@ module.exports = class BaseMeta extends BaseDocument {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isTree) {
|
||||
// tree fields
|
||||
for (let field of model.treeFields) {
|
||||
if (frappe.db.typeMap[field.fieldtype] && !doctype_fields.includes(field.fieldname)) {
|
||||
_add(field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// doctype fields
|
||||
for (let field of this.fields) {
|
||||
let include = frappe.db.typeMap[field.fieldtype];
|
||||
|
0
model/nestedset.js
Normal file
0
model/nestedset.js
Normal file
Loading…
Reference in New Issue
Block a user