Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav Naik committed May 10, 2017
2 parents ad8d76d + 8d17047 commit d118b63
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 70 deletions.
2 changes: 1 addition & 1 deletion awfis_erpnext/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import unicode_literals

__version__ = '2.0.3'
__version__ = '2.0.4'
31 changes: 14 additions & 17 deletions awfis_erpnext/awfis_erpnext/doctype/awfis_centre/awfis_centre.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:centre_name",
"beta": 0,
"creation": "2016-04-10 06:20:05.077502",
Expand All @@ -12,6 +13,7 @@
"editable_grid": 0,
"fields": [
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
Expand All @@ -22,6 +24,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Centre Name",
Expand All @@ -40,6 +43,7 @@
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
Expand All @@ -50,6 +54,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "City",
Expand All @@ -69,6 +74,7 @@
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
Expand All @@ -79,6 +85,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Abbreviation",
Expand All @@ -97,17 +104,17 @@
"unique": 1
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-03-21 20:55:48.527905",
"modified": "2017-05-10 08:17:12.785570",
"modified_by": "Administrator",
"module": "Awfis Erpnext",
"name": "Awfis Centre",
Expand All @@ -124,7 +131,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
Expand All @@ -145,7 +151,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 0,
"read": 1,
Expand All @@ -166,7 +171,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 1,
"read": 1,
Expand All @@ -187,7 +191,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 1,
"read": 1,
Expand All @@ -208,7 +211,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
Expand All @@ -229,7 +231,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 1,
"read": 1,
Expand All @@ -250,7 +251,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
Expand All @@ -268,10 +268,9 @@
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
Expand All @@ -292,7 +291,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
Expand All @@ -313,7 +311,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
Expand All @@ -334,7 +331,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 1,
"read": 1,
Expand All @@ -355,7 +351,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 1,
"read": 1,
Expand All @@ -371,7 +366,9 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "centre_name, city",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
}
37 changes: 37 additions & 0 deletions awfis_erpnext/fixtures/custom_field.json
Original file line number Diff line number Diff line change
Expand Up @@ -2218,5 +2218,42 @@
"search_index": 0,
"unique": 0,
"width": null
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": null,
"default": null,
"depends_on": null,
"description": null,
"docstatus": 0,
"doctype": "Custom Field",
"dt": "Sales Invoice",
"fieldname": "awfis_pos_invoice_no",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"insert_after": "amended_from",
"label": "Awfis POS Invoice No",
"modified": "2017-05-10 19:37:39.847615",
"name": "Sales Invoice-awfis_pos_invoice_no",
"no_copy": 0,
"options": null,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"unique": 0,
"width": null
}
]
34 changes: 17 additions & 17 deletions awfis_erpnext/fixtures/custom_scripts/Lead.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ frappe.ui.form.on("Lead Awfis Space", {
"Fixed Seat": 1, "Flexi Seat": 1, "Cabin Seat": 1, "Virtual Office": 1, "Mobile Awfis": 1,
"Meeting Room 4": 4, "Meeting Room 6": 6, "Meeting Room 8": 8, "Meeting Room 10": 10}

space.capacity = space_capacity_map[space.space_type];
space.capacity = space_capacity_map[space.space_type];

refresh_field("awfis_spaces");
refresh_field("awfis_spaces");
}
});

//Ensure that only newer tenures are seen.

frappe.ui.form.on("Lead Awfis Centre", "centre_city", function(frm, cdt, cdn){
var child = locals[cdt][cdn];
var child = locals[cdt][cdn];
grid_row = cur_frm.fields_dict['lead_awfis_centres'].grid.grid_rows_by_docname[child.name];
field = frappe.utils.filter_dict(grid_row.docfields, {fieldname: "centre"})[0]
field.get_query = function(){
Expand Down Expand Up @@ -61,7 +61,7 @@ frappe.ui.form.on("Lead", "onload", function(frm) {
}
};
});

if ((frappe.boot.user.roles != "Awfis Ops User") && (frm.doc.__islocal)) {
var dialog = new frappe.ui.Dialog({
title: __("Lookup Lead"),
Expand All @@ -73,9 +73,9 @@ frappe.ui.form.on("Lead", "onload", function(frm) {

});

dialog.fields_dict.search_lead.$input.click(function() {
dialog.fields_dict.search_lead.$input.click(function() {
args = dialog.get_values();

frappe.call({
method: "awfis_erpnext.awfis_erpnext.api.lookup_lead",
args: {
Expand All @@ -89,7 +89,7 @@ frappe.ui.form.on("Lead", "onload", function(frm) {
cur_frm.set_value("awfis_mobile_no", args.caller_number)
dialog.hide();
} else {
frappe.set_route("Form", "Lead", r.message);
frappe.set_route("Form", "Lead", r.message);
dialog.hide();
cur_frm.refresh();
}
Expand All @@ -113,14 +113,14 @@ frappe.ui.form.on("Lead", "last_name", function(frm){
frappe.ui.form.on("Lead", "refresh", function(frm) {
frm.toggle_display("lead_name", false);
frm.toggle_display("lead_name", false);
//Set sources by channel.
var sources_by_channel = {
"Sales Team" : ["Referral", "Marketing", "Broker", "Direct"],

//Set sources by channel.
var sources_by_channel = {
"Sales Team" : ["Referral", "Marketing", "Broker", "Direct"],
"Centre Walk-in": ["Outdoor", "Online", "Referral", "Marketing"],
"Call Centre": ["Outdoor", "Online", "Referral", "Marketing", "Returning Customer", "NA"],
"Inbound": ["Email", "SEM", "Online", "Instant Office", "Listings"]
}
}

var campaigns_by_sub_source = {
"Events" : ["Internal", "External"],
Expand Down Expand Up @@ -168,7 +168,7 @@ frappe.ui.form.on("Lead", "refresh", function(frm) {
]
}
}
});
});
set_field_visibility();

//Hide mobile no in modify mode.
Expand Down Expand Up @@ -221,7 +221,7 @@ function buildName(fname, lname) {
// space.capacity = "";
// set_capacity_property_readonly(0);
// }
// refresh_field("awfis_spaces");
// refresh_field("awfis_spaces");
// });

function set_capacity_property_readonly(state) {
Expand Down Expand Up @@ -253,7 +253,7 @@ frappe.ui.form.on("Lead", "awfis_lead_sub_source", function(frm) {
});

function set_field_visibility() {

if (cur_frm.doc.awfis_lead_channel == "Sales Team") {
cur_frm.set_df_property("awfis_lead_sub_source", "hidden", ["Referral", "Broker"].indexOf(cur_frm.doc.source) == -1);
} else if (cur_frm.doc.awfis_lead_channel == "Call Centre") {
Expand All @@ -262,9 +262,9 @@ function set_field_visibility() {
cur_frm.set_df_property("awfis_lead_sub_source", "hidden", 0);
}


if (cur_frm.doc.awfis_lead_channel == "Sales Team") {
cur_frm.set_df_property("campaign_name", "hidden", (cur_frm.doc.source != "Marketing"));
cur_frm.set_df_property("campaign_name", "hidden", (cur_frm.doc.source != "Marketing"));
} else if (["Events", "Social Media", "Online Listing", "Advertising", "Friend/Colleague"].indexOf(cur_frm.doc.awfis_lead_sub_source) == -1) {
cur_frm.set_df_property("campaign_name", "hidden", 1);
} else {
Expand Down
Loading

0 comments on commit d118b63

Please sign in to comment.