mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
27 lines
548 B
JavaScript
27 lines
548 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,
|
|
keywordFields: [],
|
|
fields: [
|
|
{
|
|
fieldname: "name",
|
|
label: "Name",
|
|
fieldtype: "Data",
|
|
required: 1
|
|
}
|
|
]
|
|
}`);
|
|
|
|
}
|
|
}
|