2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

Make account field in item as 'required'

This commit is contained in:
Suraj Shetty 2018-07-13 13:57:53 +05:30
parent 1a5d01ffeb
commit 00b93cac73

View File

@ -1,83 +1,84 @@
module.exports = { module.exports = {
name: "Item", name: 'Item',
doctype: "DocType", doctype: 'DocType',
isSingle: 0, isSingle: 0,
keywordFields: [ keywordFields: [
"name", 'name',
"description" 'description'
], ],
fields: [ fields: [
{ {
fieldname: "name", fieldname: 'name',
label: "Item Name", label: 'Item Name',
fieldtype: "Data", fieldtype: 'Data',
required: 1 required: 1
}, },
{ {
fieldname: "description", fieldname: 'description',
label: "Description", label: 'Description',
fieldtype: "Text" fieldtype: 'Text'
}, },
{ {
fieldname: "unit", fieldname: 'unit',
label: "Unit", label: 'Unit',
fieldtype: "Select", fieldtype: 'Select',
default: "No", default: 'No',
options: [ options: [
"No", 'No',
"Kg", 'Kg',
"Gram", 'Gram',
"Hour", 'Hour',
"Day" 'Day'
] ]
}, },
{ {
fieldname: "incomeAccount", fieldname: 'incomeAccount',
label: "Income Account", label: 'Income Account',
fieldtype: "Link", fieldtype: 'Link',
target: "Account" target: 'Account',
required: 1
}, },
{ {
fieldname: "expenseAccount", fieldname: 'expenseAccount',
label: "Expense Account", label: 'Expense Account',
fieldtype: "Link", fieldtype: 'Link',
target: "Account" target: 'Account'
}, },
{ {
fieldname: "tax", fieldname: 'tax',
label: "Tax", label: 'Tax',
fieldtype: "Link", fieldtype: 'Link',
target: "Tax" target: 'Tax'
}, },
{ {
fieldname: "rate", fieldname: 'rate',
label: "Rate", label: 'Rate',
fieldtype: "Currency" fieldtype: 'Currency'
} }
], ],
layout: [ layout: [
// section 1 // section 1
{ {
columns: [ columns: [
{ fields: [ "name", "unit" ] }, { fields: ['name', 'unit'] },
{ fields: [ "rate" ] } { fields: ['rate'] }
] ]
}, },
// section 2 // section 2
{ {
columns: [ columns: [
{ fields: [ "description" ] } { fields: ['description'] }
] ]
}, },
// section 3 // section 3
{ {
title: "Accounting", title: 'Accounting',
columns: [ columns: [
{ fields: [ "incomeAccount", "expenseAccount" ] }, { fields: ['incomeAccount', 'expenseAccount'] },
{ fields: [ "tax" ] } { fields: ['tax'] }
] ]
} }
] ]
} };