Merge pull request #26272 from anupamvs/campaign-module

fix: moving campaign from selling to CRM
This commit is contained in:
Jannat Patel 2021-07-27 17:34:31 +05:30 committed by GitHub
commit 1ec7ccd749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 45 additions and 71 deletions

View File

View 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);
}
}
});

View File

@ -1,4 +1,5 @@
{
"actions": [],
"allow_import": 1,
"allow_rename": 1,
"autoname": "naming_series:",
@ -39,17 +40,9 @@
"set_only_once": 1
},
{
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
"width": "300px"
},
{
"fieldname": "description_section",
"fieldtype": "Section Break"
"fieldname": "campaign_schedules_section",
"fieldtype": "Section Break",
"label": "Campaign Schedules"
},
{
"fieldname": "campaign_schedules",
@ -58,16 +51,25 @@
"options": "Campaign Email Schedule"
},
{
"fieldname": "campaign_schedules_section",
"fieldtype": "Section Break",
"label": "Campaign Schedules"
"fieldname": "description_section",
"fieldtype": "Section Break"
},
{
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
"width": "300px"
}
],
"icon": "fa fa-bullhorn",
"idx": 1,
"modified": "2019-07-22 12:03:39.832342",
"links": [],
"modified": "2021-06-30 18:05:06.412712",
"modified_by": "Administrator",
"module": "Selling",
"module": "CRM",
"name": "Campaign",
"owner": "Administrator",
"permissions": [

View File

@ -1,9 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.model.naming import set_name_by_naming_series

View 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

View File

@ -1 +0,0 @@
Sales campaign / promotion, like special discount, exhibition, newsletter etc.

View File

@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@ -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);
}
})

View File

@ -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']
}
]
}

View File

@ -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')

View File

@ -1,10 +0,0 @@
[
{
"campaign_name": "_Test Campaign",
"doctype": "Campaign"
},
{
"campaign_name": "_Test Campaign 1",
"doctype": "Campaign"
}
]