2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/model/boilerplate.js
2018-02-19 22:11:10 +05:30

26 lines
487 B
JavaScript

const fs = require('fs');
module.exports = {
make_model_files(name) {
// [doctype].json
fs.mkdirSync(`./models/doctype/${name}`);
fs.writeFileSync(`./models/doctype/${name}/${name}.js`, `{
name: "${name}",
doctype: "DocType",
isSingle: 0,
isChild: 0,
keywordFields: [],
fields: [
{
fieldname: "name",
label: "Name",
fieldtype: "Data",
required: 1
}
]
}`);
}
}