2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +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 = {
name: "Item",
doctype: "DocType",
isSingle: 0,
keywordFields: [
"name",
"description"
],
fields: [
{
fieldname: "name",
label: "Item Name",
fieldtype: "Data",
required: 1
},
{
fieldname: "description",
label: "Description",
fieldtype: "Text"
},
{
fieldname: "unit",
label: "Unit",
fieldtype: "Select",
default: "No",
options: [
"No",
"Kg",
"Gram",
"Hour",
"Day"
]
},
{
fieldname: "incomeAccount",
label: "Income Account",
fieldtype: "Link",
target: "Account"
},
{
fieldname: "expenseAccount",
label: "Expense Account",
fieldtype: "Link",
target: "Account"
},
{
fieldname: "tax",
label: "Tax",
fieldtype: "Link",
target: "Tax"
},
{
fieldname: "rate",
label: "Rate",
fieldtype: "Currency"
}
],
layout: [
// section 1
{
columns: [
{ fields: [ "name", "unit" ] },
{ fields: [ "rate" ] }
]
},
name: 'Item',
doctype: 'DocType',
isSingle: 0,
keywordFields: [
'name',
'description'
],
fields: [
{
fieldname: 'name',
label: 'Item Name',
fieldtype: 'Data',
required: 1
},
{
fieldname: 'description',
label: 'Description',
fieldtype: 'Text'
},
{
fieldname: 'unit',
label: 'Unit',
fieldtype: 'Select',
default: 'No',
options: [
'No',
'Kg',
'Gram',
'Hour',
'Day'
]
},
{
fieldname: 'incomeAccount',
label: 'Income Account',
fieldtype: 'Link',
target: 'Account',
required: 1
},
{
fieldname: 'expenseAccount',
label: 'Expense Account',
fieldtype: 'Link',
target: 'Account'
},
{
fieldname: 'tax',
label: 'Tax',
fieldtype: 'Link',
target: 'Tax'
},
{
fieldname: 'rate',
label: 'Rate',
fieldtype: 'Currency'
}
],
layout: [
// section 1
{
columns: [
{ fields: ['name', 'unit'] },
{ fields: ['rate'] }
]
},
// section 2
{
columns: [
{ fields: [ "description" ] }
]
},
// section 2
{
columns: [
{ fields: ['description'] }
]
},
// section 3
{
title: "Accounting",
columns: [
{ fields: [ "incomeAccount", "expenseAccount" ] },
{ fields: [ "tax" ] }
]
}
]
}
// section 3
{
title: 'Accounting',
columns: [
{ fields: ['incomeAccount', 'expenseAccount'] },
{ fields: ['tax'] }
]
}
]
};