2
0
mirror of https://github.com/frappe/books.git synced 2024-12-24 11:55:46 +00:00
books/model/boilerplate.js
2018-03-27 19:25:26 +05:30

29 lines
590 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`, `module.exports = {
name: "${name}",
label: "${name}",
naming: "name", // {random|autoincrement}
isSingle: 0,
isChild: 0,
isSubmittable: 0,
settings: null,
keywordFields: [],
fields: [
{
fieldname: "name",
label: "Name",
fieldtype: "Data",
required: 1
}
]
}`);
}
}