mirror of
https://github.com/frappe/books.git
synced 2024-11-12 16:36:27 +00:00
added new model item
This commit is contained in:
parent
72902cdeb8
commit
61b3facf16
2
index.js
2
index.js
@ -11,11 +11,13 @@ client.start({
|
||||
// require modules
|
||||
frappe.modules.todo = require('frappejs/models/doctype/todo/todo.js');
|
||||
frappe.modules.account = require('./models/doctype/account/account.js');
|
||||
frappe.modules.item = require('./models/doctype/item/item.js');
|
||||
frappe.modules.todo_client = require('frappejs/models/doctype/todo/todo_client.js');
|
||||
frappe.modules.account_client = require('./models/doctype/account/account_client.js');
|
||||
|
||||
frappe.desk.add_sidebar_item('ToDo', '#list/todo');
|
||||
frappe.desk.add_sidebar_item('Accounts', '#list/account');
|
||||
frappe.desk.add_sidebar_item('Items', '#list/item');
|
||||
|
||||
frappe.router.default = '#list/todo';
|
||||
|
||||
|
441
js/bundle.js
441
js/bundle.js
File diff suppressed because one or more lines are too long
@ -12,7 +12,7 @@ class AccountList extends BaseList {
|
||||
|
||||
class AccountForm extends BaseForm {
|
||||
make() {
|
||||
this.super();
|
||||
super.make();
|
||||
|
||||
// override controller event
|
||||
this.controls['parent_account'].get_filters = (query) => {
|
||||
|
16
models/doctype/item/item.js
Normal file
16
models/doctype/item/item.js
Normal file
@ -0,0 +1,16 @@
|
||||
const BaseMeta = require('frappejs/model/meta');
|
||||
const BaseDocument = require('frappejs/model/document');
|
||||
|
||||
class ItemMeta extends BaseMeta {
|
||||
setup_meta() {
|
||||
Object.assign(this, require('./item.json'));
|
||||
}
|
||||
}
|
||||
|
||||
class Item extends BaseDocument {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
Document: Item,
|
||||
Meta: ItemMeta
|
||||
};
|
39
models/doctype/item/item.json
Normal file
39
models/doctype/item/item.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "Item",
|
||||
"doctype": "DocType",
|
||||
"issingle": 0,
|
||||
"keyword_fields": [
|
||||
"name",
|
||||
"description"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "name",
|
||||
"label": "Item Name",
|
||||
"fieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "description",
|
||||
"label": "Description",
|
||||
"fieldtype": "Text"
|
||||
},
|
||||
{
|
||||
"fieldname": "unit",
|
||||
"label": "Unit",
|
||||
"fieldtype": "Select",
|
||||
"options": [
|
||||
"No",
|
||||
"Kg",
|
||||
"Gram",
|
||||
"Hour",
|
||||
"Day"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldname": "rate",
|
||||
"label": "Rate",
|
||||
"fieldtype": "Currency"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user