2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

Contact Added

This commit is contained in:
Revant Nandgaonkar 2018-03-27 18:46:40 +05:30
parent 242771584d
commit c949309771
4 changed files with 90 additions and 1 deletions

View File

@ -23,6 +23,8 @@ module.exports = {
frappe.desk.menu.addItem('Items', '#list/Item');
frappe.desk.menu.addItem('Customers', '#list/Customer');
frappe.desk.menu.addItem('Invoice', '#list/Invoice');
frappe.desk.menu.addItem('Address', "#list/Address");
frappe.desk.menu.addItem('Contact', "#list/Contact");
frappe.desk.menu.addItem('Settings', () => frappe.desk.showFormModal('SystemSettings'));
frappe.router.default = '#list/ToDo';

View File

@ -6,6 +6,10 @@ module.exports = {
"keywordFields": [
"addressTitle"
],
pageSettings: {
hideTitle: true
},
"naming": "autoincrement",
"fields": [
{
"fieldname": "addressTitle",

View File

@ -0,0 +1,82 @@
module.exports = {
"name": "Contact",
"doctype": "DocType",
"isSingle": 0,
"naming": "autoincrement",
"pageSettings": {
"hideTitle": true
},
"titleField": "fullName",
"keywordFields": [
"fullName"
],
"titleField": "fullName",
"fields": [
{
"fieldname": "fullName",
"label": "Full Name",
"fieldtype": "Data",
"required": 1
},
{
"fieldname": "emailAddress",
"label": "Email Address",
"fieldtype": "Data"
},
{
"fieldname": "userId",
"label": "User ID",
"fieldtype": "Link",
"target": "User",
"hidden": 1
},
{
"fieldname": "status",
"label": "Status",
"fieldtype": "Select",
"options": ["Passive", "Open", "Replied"]
},
{
"fieldname": "gender",
"label": "Gender",
"fieldtype": "Select",
"options": ["Male", "Female", "Gender"]
},
{
"fieldname": "mobileNumber",
"label": "Mobile Number",
"fieldtype": "Data"
},
{
"fieldname": "phone",
"label": "Phone",
"fieldtype": "Data"
}
],
events: {
validate: (doc) => {
}
},
listSettings: {
getFields(list) {
return ['fullName'];
},
getRowHTML(list, data) {
console.log(list, data);
return `<div class="col-11">${list.getNameHTML(data)}</div>`;
}
},
layout: [
// section 1
{
columns: [
{ fields: [ "fullName", "emailAddress", "userId", "status" ] },
{ fields: [ "postalCode", "gender", "phone", "mobileNumber" ] }
]
}
]
}

View File

@ -12,6 +12,7 @@ module.exports = {
Tax: require('./doctype/Tax/Tax.js'),
TaxDetail: require('./doctype/TaxDetail/TaxDetail.js'),
TaxSummary: require('./doctype/TaxSummary/TaxSummary.js'),
Address: require('./doctype/Address/Address.js')
Address: require('./doctype/Address/Address.js'),
Contact: require('./doctype/Contact/Contact.js')
}
}