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", {
label: "Expense Account", fieldname: 'expenseAccount',
fieldtype: "Link", label: 'Expense Account',
target: "Account" fieldtype: 'Link',
}, target: 'Account'
{ },
fieldname: "tax", {
label: "Tax", fieldname: 'tax',
fieldtype: "Link", label: 'Tax',
target: "Tax" fieldtype: 'Link',
}, target: 'Tax'
{ },
fieldname: "rate", {
label: "Rate", fieldname: 'rate',
fieldtype: "Currency" label: 'Rate',
} fieldtype: 'Currency'
], }
layout: [ ],
// section 1 layout: [
{ // section 1
columns: [ {
{ fields: [ "name", "unit" ] }, columns: [
{ fields: [ "rate" ] } { fields: ['name', 'unit'] },
] { 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'] }
] ]
} }
] ]
} };