Merge pull request #26272 from anupamvs/campaign-module
fix: moving campaign from selling to CRM
This commit is contained in:
commit
1ec7ccd749
0
erpnext/crm/doctype/campaign/__init__.py
Normal file
0
erpnext/crm/doctype/campaign/__init__.py
Normal file
17
erpnext/crm/doctype/campaign/campaign.js
Normal file
17
erpnext/crm/doctype/campaign/campaign.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('Campaign', {
|
||||||
|
refresh: function(frm) {
|
||||||
|
erpnext.toggle_naming_series();
|
||||||
|
|
||||||
|
if (frm.doc.__islocal) {
|
||||||
|
frm.toggle_display("naming_series", frappe.boot.sysdefaults.campaign_naming_by=="Naming Series");
|
||||||
|
} else {
|
||||||
|
cur_frm.add_custom_button(__("View Leads"), function() {
|
||||||
|
frappe.route_options = {"source": "Campaign", "campaign_name": frm.doc.name};
|
||||||
|
frappe.set_route("List", "Lead");
|
||||||
|
}, "fa fa-list", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
@ -39,17 +40,9 @@
|
|||||||
"set_only_once": 1
|
"set_only_once": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "description",
|
"fieldname": "campaign_schedules_section",
|
||||||
"fieldtype": "Text",
|
"fieldtype": "Section Break",
|
||||||
"in_list_view": 1,
|
"label": "Campaign Schedules"
|
||||||
"label": "Description",
|
|
||||||
"oldfieldname": "description",
|
|
||||||
"oldfieldtype": "Text",
|
|
||||||
"width": "300px"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "description_section",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "campaign_schedules",
|
"fieldname": "campaign_schedules",
|
||||||
@ -58,16 +51,25 @@
|
|||||||
"options": "Campaign Email Schedule"
|
"options": "Campaign Email Schedule"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "campaign_schedules_section",
|
"fieldname": "description_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break"
|
||||||
"label": "Campaign Schedules"
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "description",
|
||||||
|
"fieldtype": "Text",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Description",
|
||||||
|
"oldfieldname": "description",
|
||||||
|
"oldfieldtype": "Text",
|
||||||
|
"width": "300px"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-bullhorn",
|
"icon": "fa fa-bullhorn",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"modified": "2019-07-22 12:03:39.832342",
|
"links": [],
|
||||||
|
"modified": "2021-06-30 18:05:06.412712",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "CRM",
|
||||||
"name": "Campaign",
|
"name": "Campaign",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
@ -1,9 +1,7 @@
|
|||||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
# License: GNU General Public License v3. See license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.model.naming import set_name_by_naming_series
|
from frappe.model.naming import set_name_by_naming_series
|
||||||
|
|
8
erpnext/crm/doctype/campaign/test_campaign.py
Normal file
8
erpnext/crm/doctype/campaign/test_campaign.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
|
||||||
|
# import frappe
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class TestCampaign(unittest.TestCase):
|
||||||
|
pass
|
@ -1 +0,0 @@
|
|||||||
Sales campaign / promotion, like special discount, exhibition, newsletter etc.
|
|
@ -1 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
@ -1,15 +0,0 @@
|
|||||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
|
||||||
// License: GNU General Public License v3. See license.txt
|
|
||||||
|
|
||||||
frappe.ui.form.on("Campaign", "refresh", function(frm) {
|
|
||||||
erpnext.toggle_naming_series();
|
|
||||||
if(frm.doc.__islocal) {
|
|
||||||
frm.toggle_display("naming_series", frappe.boot.sysdefaults.campaign_naming_by=="Naming Series");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
cur_frm.add_custom_button(__("View Leads"), function() {
|
|
||||||
frappe.route_options = {"source": "Campaign","campaign_name": frm.doc.name}
|
|
||||||
frappe.set_route("List", "Lead");
|
|
||||||
}, "fa fa-list", true);
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,17 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
from frappe import _
|
|
||||||
|
|
||||||
def get_data():
|
|
||||||
return {
|
|
||||||
'fieldname': 'campaign_name',
|
|
||||||
'transactions': [
|
|
||||||
{
|
|
||||||
'label': _('Email Campaigns'),
|
|
||||||
'items': ['Email Campaign']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'label': _('Social Media Campaigns'),
|
|
||||||
'items': ['Social Media Post']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
|
||||||
# License: GNU General Public License v3. See license.txt
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
|
|
||||||
import frappe
|
|
||||||
test_records = frappe.get_test_records('Campaign')
|
|
@ -1,10 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"campaign_name": "_Test Campaign",
|
|
||||||
"doctype": "Campaign"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"campaign_name": "_Test Campaign 1",
|
|
||||||
"doctype": "Campaign"
|
|
||||||
}
|
|
||||||
]
|
|
Loading…
x
Reference in New Issue
Block a user