[new-module] crm
This commit is contained in:
parent
36b84408a8
commit
60cfccbf77
126
erpnext/config/crm.py
Normal file
126
erpnext/config/crm.py
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
from frappe import _
|
||||||
|
|
||||||
|
def get_data():
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"label": _("Documents"),
|
||||||
|
"icon": "icon-star",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Lead",
|
||||||
|
"description": _("Database of potential customers."),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Customer",
|
||||||
|
"description": _("Customer database."),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Opportunity",
|
||||||
|
"description": _("Potential opportunities for selling."),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Contact",
|
||||||
|
"description": _("All Contacts."),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Newsletter",
|
||||||
|
"description": _("Newsletters to contacts, leads."),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Tools"),
|
||||||
|
"icon": "icon-wrench",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "SMS Center",
|
||||||
|
"description":_("Send mass SMS to your contacts"),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Setup"),
|
||||||
|
"icon": "icon-cog",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Campaign",
|
||||||
|
"description": _("Sales campaigns."),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "page",
|
||||||
|
"label": _("Customer Group"),
|
||||||
|
"name": "Sales Browser",
|
||||||
|
"icon": "icon-sitemap",
|
||||||
|
"link": "Sales Browser/Customer Group",
|
||||||
|
"description": _("Manage Customer Group Tree."),
|
||||||
|
"doctype": "Customer Group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "page",
|
||||||
|
"label": _("Territory"),
|
||||||
|
"name": "Sales Browser",
|
||||||
|
"icon": "icon-sitemap",
|
||||||
|
"link": "Sales Browser/Territory",
|
||||||
|
"description": _("Manage Territory Tree."),
|
||||||
|
"doctype": "Territory",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "page",
|
||||||
|
"label": _("Sales Person"),
|
||||||
|
"name": "Sales Browser",
|
||||||
|
"icon": "icon-sitemap",
|
||||||
|
"link": "Sales Browser/Sales Person",
|
||||||
|
"description": _("Manage Sales Person Tree."),
|
||||||
|
"doctype": "Sales Person",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "SMS Settings",
|
||||||
|
"description": _("Setup SMS gateway settings")
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Main Reports"),
|
||||||
|
"icon": "icon-table",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "page",
|
||||||
|
"name": "sales-funnel",
|
||||||
|
"label": _("Sales Funnel"),
|
||||||
|
"icon": "icon-bar-chart",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Standard Reports"),
|
||||||
|
"icon": "icon-list",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"is_query_report": True,
|
||||||
|
"name": "Lead Details",
|
||||||
|
"doctype": "Lead"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"is_query_report": True,
|
||||||
|
"name": "Customer Addresses and Contacts",
|
||||||
|
"doctype": "Contact"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"is_query_report": True,
|
||||||
|
"name": "Customers Not Buying Since Long Time",
|
||||||
|
"doctype": "Sales Order"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
@ -45,6 +45,11 @@ def get_data():
|
|||||||
"icon": "octicon octicon-tag",
|
"icon": "octicon octicon-tag",
|
||||||
"type": "module"
|
"type": "module"
|
||||||
},
|
},
|
||||||
|
"CRM": {
|
||||||
|
"color": "#EF4DB6",
|
||||||
|
"icon": "octicon octicon-broadcast",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
"Stock": {
|
"Stock": {
|
||||||
"color": "#f39c12",
|
"color": "#f39c12",
|
||||||
"icon": "icon-truck",
|
"icon": "icon-truck",
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class SellingController(StockController):
|
|||||||
self.update_if_missing(party_details)
|
self.update_if_missing(party_details)
|
||||||
|
|
||||||
elif getattr(self, "lead", None):
|
elif getattr(self, "lead", None):
|
||||||
from erpnext.selling.doctype.lead.lead import get_lead_details
|
from erpnext.crm.doctype.lead.lead import get_lead_details
|
||||||
self.update_if_missing(get_lead_details(self.lead))
|
self.update_if_missing(get_lead_details(self.lead))
|
||||||
|
|
||||||
def set_price_list_and_item_details(self):
|
def set_price_list_and_item_details(self):
|
||||||
|
|||||||
0
erpnext/crm/__init__.py
Normal file
0
erpnext/crm/__init__.py
Normal file
0
erpnext/crm/doctype/__init__.py
Normal file
0
erpnext/crm/doctype/__init__.py
Normal file
9
erpnext/crm/doctype/lead/.py
Normal file
9
erpnext/crm/doctype/lead/.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
class Lead(Document):
|
||||||
|
pass
|
||||||
0
erpnext/crm/doctype/lead/__init__.py
Normal file
0
erpnext/crm/doctype/lead/__init__.py
Normal file
@ -41,14 +41,14 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
|||||||
|
|
||||||
create_customer: function() {
|
create_customer: function() {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.selling.doctype.lead.lead.make_customer",
|
method: "erpnext.crm.doctype.lead.lead.make_customer",
|
||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
create_opportunity: function() {
|
create_opportunity: function() {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.selling.doctype.lead.lead.make_opportunity",
|
method: "erpnext.crm.doctype.lead.lead.make_opportunity",
|
||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -331,9 +331,9 @@
|
|||||||
],
|
],
|
||||||
"icon": "icon-user",
|
"icon": "icon-user",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"modified": "2015-02-05 05:11:40.379661",
|
"modified": "2015-02-16 23:54:10.622839",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "CRM",
|
||||||
"name": "Lead",
|
"name": "Lead",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
@ -10,7 +10,7 @@ test_records = frappe.get_test_records('Lead')
|
|||||||
|
|
||||||
class TestLead(unittest.TestCase):
|
class TestLead(unittest.TestCase):
|
||||||
def test_make_customer(self):
|
def test_make_customer(self):
|
||||||
from erpnext.selling.doctype.lead.lead import make_customer
|
from erpnext.crm.doctype.lead.lead import make_customer
|
||||||
|
|
||||||
frappe.delete_doc_if_exists("Customer", "_Test Lead")
|
frappe.delete_doc_if_exists("Customer", "_Test Lead")
|
||||||
|
|
||||||
0
erpnext/crm/doctype/opportunity/__init__.py
Normal file
0
erpnext/crm/doctype/opportunity/__init__.py
Normal file
@ -7,12 +7,12 @@ frappe.ui.form.on_change("Opportunity", "customer_address", erpnext.utils.get_ad
|
|||||||
frappe.ui.form.on_change("Opportunity", "contact_person", erpnext.utils.get_contact_details);
|
frappe.ui.form.on_change("Opportunity", "contact_person", erpnext.utils.get_contact_details);
|
||||||
|
|
||||||
|
|
||||||
frappe.provide("erpnext.selling");
|
frappe.provide("erpnext.crm");
|
||||||
frappe.require("assets/erpnext/js/utils.js");
|
frappe.require("assets/erpnext/js/utils.js");
|
||||||
cur_frm.email_field = "contact_email";
|
cur_frm.email_field = "contact_email";
|
||||||
|
|
||||||
// TODO commonify this code
|
// TODO commonify this code
|
||||||
erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
|
erpnext.crm.Opportunity = frappe.ui.form.Controller.extend({
|
||||||
onload: function() {
|
onload: function() {
|
||||||
if(!this.frm.doc.enquiry_from && this.frm.doc.customer)
|
if(!this.frm.doc.enquiry_from && this.frm.doc.customer)
|
||||||
this.frm.doc.enquiry_from = "Customer";
|
this.frm.doc.enquiry_from = "Customer";
|
||||||
@ -62,13 +62,13 @@ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
|
|||||||
|
|
||||||
create_quotation: function() {
|
create_quotation: function() {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.selling.doctype.opportunity.opportunity.make_quotation",
|
method: "erpnext.crm.doctype.opportunity.opportunity.make_quotation",
|
||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$.extend(cur_frm.cscript, new erpnext.selling.Opportunity({frm: cur_frm}));
|
$.extend(cur_frm.cscript, new erpnext.crm.Opportunity({frm: cur_frm}));
|
||||||
|
|
||||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||||
erpnext.toggle_naming_series();
|
erpnext.toggle_naming_series();
|
||||||
@ -102,7 +102,7 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
|
|||||||
cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
||||||
cur_frm.toggle_display("contact_info", doc.customer || doc.lead);
|
cur_frm.toggle_display("contact_info", doc.customer || doc.lead);
|
||||||
frappe.model.map_current_doc({
|
frappe.model.map_current_doc({
|
||||||
method: "erpnext.selling.doctype.lead.lead.make_opportunity",
|
method: "erpnext.crm.doctype.lead.lead.make_opportunity",
|
||||||
source_name: cur_frm.doc.lead,
|
source_name: cur_frm.doc.lead,
|
||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
});
|
});
|
||||||
@ -391,9 +391,9 @@
|
|||||||
"icon": "icon-info-sign",
|
"icon": "icon-info-sign",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2015-02-05 05:11:41.732687",
|
"modified": "2015-02-16 23:52:23.489259",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "CRM",
|
||||||
"name": "Opportunity",
|
"name": "Opportunity",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
@ -1,10 +1,11 @@
|
|||||||
Accounts
|
Accounts
|
||||||
|
CRM
|
||||||
Buying
|
Buying
|
||||||
HR
|
|
||||||
Manufacturing
|
|
||||||
Projects
|
Projects
|
||||||
Selling
|
Selling
|
||||||
Setup
|
Setup
|
||||||
|
HR
|
||||||
|
Manufacturing
|
||||||
Stock
|
Stock
|
||||||
Support
|
Support
|
||||||
Utilities
|
Utilities
|
||||||
|
|||||||
@ -108,3 +108,5 @@ erpnext.patches.v5_0.remove_shopping_cart_app
|
|||||||
erpnext.patches.v5_0.update_companywise_payment_account
|
erpnext.patches.v5_0.update_companywise_payment_account
|
||||||
erpnext.patches.v5_0.remove_birthday_events
|
erpnext.patches.v5_0.remove_birthday_events
|
||||||
erpnext.patches.v5_0.update_item_name_in_bom
|
erpnext.patches.v5_0.update_item_name_in_bom
|
||||||
|
execute:frappe.reload_doc('crm', 'doctype', 'lead')
|
||||||
|
execute:frappe.reload_doc('crm', 'doctype', 'opportunity')
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
Prospective customer / prospect database. List of all prospects that could be source of business.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
frappe.listview_settings['Lead'] = {
|
|
||||||
add_fields: ["territory", "company_name", "status", "source"],
|
|
||||||
get_indicator: function(doc) {
|
|
||||||
var indicator = [__(doc.status), "darkgrey", "status,=," + doc.status];
|
|
||||||
if(doc.status==="Open") indicator[1] = "red";
|
|
||||||
if(doc.status==="Opportunity") indicator[1] = "green";
|
|
||||||
return indicator;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -1 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
@ -32,7 +32,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
cur_frm.add_custom_button(__('From Opportunity'),
|
cur_frm.add_custom_button(__('From Opportunity'),
|
||||||
function() {
|
function() {
|
||||||
frappe.model.map_current_doc({
|
frappe.model.map_current_doc({
|
||||||
method: "erpnext.selling.doctype.opportunity.opportunity.make_quotation",
|
method: "erpnext.crm.doctype.opportunity.opportunity.make_quotation",
|
||||||
source_doctype: "Opportunity",
|
source_doctype: "Opportunity",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
docstatus: 1,
|
docstatus: 1,
|
||||||
@ -94,7 +94,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
lead: function() {
|
lead: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.selling.doctype.lead.lead.get_lead_details",
|
method: "erpnext.crm.doctype.lead.lead.get_lead_details",
|
||||||
args: { "lead": this.frm.doc.lead },
|
args: { "lead": this.frm.doc.lead },
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(r.message) {
|
if(r.message) {
|
||||||
|
|||||||
@ -149,7 +149,7 @@ def _make_customer(source_name, ignore_permissions=False):
|
|||||||
customer_name = frappe.db.get_value("Customer", {"lead_name": lead_name},
|
customer_name = frappe.db.get_value("Customer", {"lead_name": lead_name},
|
||||||
["name", "customer_name"], as_dict=True)
|
["name", "customer_name"], as_dict=True)
|
||||||
if not customer_name:
|
if not customer_name:
|
||||||
from erpnext.selling.doctype.lead.lead import _make_customer
|
from erpnext.crm.doctype.lead.lead import _make_customer
|
||||||
customer_doclist = _make_customer(lead_name, ignore_permissions=ignore_permissions)
|
customer_doclist = _make_customer(lead_name, ignore_permissions=ignore_permissions)
|
||||||
customer = frappe.get_doc(customer_doclist)
|
customer = frappe.get_doc(customer_doclist)
|
||||||
customer.flags.ignore_permissions = ignore_permissions
|
customer.flags.ignore_permissions = ignore_permissions
|
||||||
|
|||||||
@ -17,7 +17,8 @@ content_sequence = [
|
|||||||
"invoiced_amount", "payables"]],
|
"invoiced_amount", "payables"]],
|
||||||
["Bank Balance", ["bank_balance"]],
|
["Bank Balance", ["bank_balance"]],
|
||||||
["Buying", ["new_purchase_requests", "new_supplier_quotations", "new_purchase_orders"]],
|
["Buying", ["new_purchase_requests", "new_supplier_quotations", "new_purchase_orders"]],
|
||||||
["Selling", ["new_leads", "new_enquiries", "new_quotations", "new_sales_orders"]],
|
["CRM", ["new_leads", "new_enquiries"]],
|
||||||
|
["Selling", ["new_quotations", "new_sales_orders"]],
|
||||||
["Stock", ["new_delivery_notes", "new_purchase_receipts", "new_stock_entries"]],
|
["Stock", ["new_delivery_notes", "new_purchase_receipts", "new_stock_entries"]],
|
||||||
["Support", ["new_communications", "new_support_tickets", "open_tickets"]],
|
["Support", ["new_communications", "new_support_tickets", "open_tickets"]],
|
||||||
["Projects", ["new_projects"]],
|
["Projects", ["new_projects"]],
|
||||||
|
|||||||
@ -8,6 +8,13 @@
|
|||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Master",
|
"document_type": "Master",
|
||||||
"fields": [
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "gs",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "General Settings",
|
||||||
|
"permlevel": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "item_group_name",
|
"fieldname": "item_group_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
@ -20,13 +27,6 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "gs",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"in_list_view": 0,
|
|
||||||
"label": "General Settings",
|
|
||||||
"permlevel": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldname": "parent_item_group",
|
"fieldname": "parent_item_group",
|
||||||
@ -190,7 +190,7 @@
|
|||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"max_attachments": 3,
|
"max_attachments": 3,
|
||||||
"modified": "2015-02-16 05:44:59.435380",
|
"modified": "2015-02-16 23:50:48.113171",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Item Group",
|
"name": "Item Group",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user