mirror of
https://github.com/frappe/books.git
synced 2025-02-02 12:08:27 +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) {
|
refreshLinks(links) {
|
||||||
if (!this.container) return;
|
if (!(this.container && this.container.clearLinks)) return;
|
||||||
|
|
||||||
this.container.clearLinks();
|
this.container.clearLinks();
|
||||||
for(let link of links) {
|
for(let link of links) {
|
||||||
|
@ -7,8 +7,6 @@ async function getHTML(doctype, name) {
|
|||||||
let doc = await frappe.getDoc(doctype, name);
|
let doc = await frappe.getDoc(doctype, name);
|
||||||
let context = {doc: doc, frappe: frappe};
|
let context = {doc: doc, frappe: frappe};
|
||||||
|
|
||||||
console.log(context);
|
|
||||||
|
|
||||||
let html;
|
let html;
|
||||||
try {
|
try {
|
||||||
html = nunjucks.renderString(printFormat.template, context);
|
html = nunjucks.renderString(printFormat.template, context);
|
||||||
|
@ -34,5 +34,13 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
fieldname: 'parentfield', fieldtype: 'Data', required: 1
|
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
|
// doctype fields
|
||||||
for (let field of this.fields) {
|
for (let field of this.fields) {
|
||||||
let include = frappe.db.typeMap[field.fieldtype];
|
let include = frappe.db.typeMap[field.fieldtype];
|
||||||
|
0
model/nestedset.js
Normal file
0
model/nestedset.js
Normal file
Loading…
x
Reference in New Issue
Block a user