added naming series for campaign #1413
This commit is contained in:
parent
c635875765
commit
e8b0402a10
@ -1,2 +1,9 @@
|
|||||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
// License: GNU General Public License v3. See license.txt
|
// License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on("Campaign", "refresh", function(frm) {
|
||||||
|
erpnext.hide_naming_series();
|
||||||
|
if(frappe.boot.sysdefaults.campaign_naming_by!="Naming Series") {
|
||||||
|
hide_field("naming_series");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"allow_print": null,
|
"allow_print": null,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"allow_trash": null,
|
"allow_trash": null,
|
||||||
"autoname": "field:campaign_name",
|
"autoname": "naming_series:",
|
||||||
"change_log": null,
|
"change_log": null,
|
||||||
"client_script": null,
|
"client_script": null,
|
||||||
"client_script_core": null,
|
"client_script_core": null,
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"hidden": null,
|
"hidden": null,
|
||||||
"ignore_restrictions": null,
|
"ignore_restrictions": null,
|
||||||
"in_filter": null,
|
"in_filter": null,
|
||||||
"in_list_view": 1,
|
"in_list_view": 0,
|
||||||
"label": "Campaign",
|
"label": "Campaign",
|
||||||
"no_column": null,
|
"no_column": null,
|
||||||
"no_copy": null,
|
"no_copy": null,
|
||||||
@ -51,34 +51,6 @@
|
|||||||
"trigger": null,
|
"trigger": null,
|
||||||
"width": null
|
"width": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "naming_series",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"hidden": null,
|
|
||||||
"ignore_restrictions": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Naming Series",
|
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": null,
|
|
||||||
"oldfieldtype": null,
|
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
"allow_on_submit": null,
|
||||||
"default": null,
|
"default": null,
|
||||||
@ -107,6 +79,34 @@
|
|||||||
"trigger": null,
|
"trigger": null,
|
||||||
"width": null
|
"width": null
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": null,
|
||||||
|
"default": null,
|
||||||
|
"depends_on": null,
|
||||||
|
"description": null,
|
||||||
|
"fieldname": "naming_series",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"hidden": null,
|
||||||
|
"ignore_restrictions": null,
|
||||||
|
"in_filter": null,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Naming Series",
|
||||||
|
"no_column": null,
|
||||||
|
"no_copy": null,
|
||||||
|
"oldfieldname": null,
|
||||||
|
"oldfieldtype": null,
|
||||||
|
"options": "Campaign-.####",
|
||||||
|
"permlevel": 0,
|
||||||
|
"print_hide": null,
|
||||||
|
"print_width": null,
|
||||||
|
"read_only": null,
|
||||||
|
"report_hide": null,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": null,
|
||||||
|
"set_only_once": null,
|
||||||
|
"trigger": null,
|
||||||
|
"width": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
"allow_on_submit": null,
|
||||||
"default": null,
|
"default": null,
|
||||||
@ -148,7 +148,7 @@
|
|||||||
"istable": null,
|
"istable": null,
|
||||||
"max_attachments": null,
|
"max_attachments": null,
|
||||||
"menu_index": null,
|
"menu_index": null,
|
||||||
"modified": "2014-04-16 12:19:51.541872",
|
"modified": "2014-04-16 12:36:34.606593",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Campaign",
|
"name": "Campaign",
|
||||||
|
@ -5,10 +5,11 @@ 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 make_autoname
|
||||||
|
|
||||||
class Campaign(Document):
|
class Campaign(Document):
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
if frappe.defaults.get_global_default('campaign_naming_by') == 'Campaign Name':
|
if frappe.defaults.get_global_default('campaign_naming_by') != 'Naming Series':
|
||||||
self.name = self.campaign_name
|
self.name = self.campaign_name
|
||||||
else:
|
else:
|
||||||
self.name = make_autoname(self.naming_series+'.#####')
|
self.name = make_autoname(self.naming_series+'.#####')
|
||||||
|
@ -9,12 +9,12 @@ import frappe
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class SellingSettings(Document):
|
class SellingSettings(Document):
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
for key in ["cust_master_name", "customer_group", "territory", "maintain_same_sales_rate",
|
for key in ["cust_master_name", "campaign_naming_by", "customer_group", "territory",
|
||||||
"editable_price_list_rate", "selling_price_list"]:
|
"maintain_same_sales_rate", "editable_price_list_rate", "selling_price_list"]:
|
||||||
frappe.db.set_default(key, self.get(key, ""))
|
frappe.db.set_default(key, self.get(key, ""))
|
||||||
|
|
||||||
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
|
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
|
||||||
set_by_naming_series("Customer", "customer_name",
|
set_by_naming_series("Customer", "customer_name",
|
||||||
self.get("cust_master_name")=="Naming Series", hide_name_field=False)
|
self.get("cust_master_name")=="Naming Series", hide_name_field=False)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user