Merge branch 'master' into perpetual
This commit is contained in:
commit
20a6f93612
10
docs/dev/docs.dev.client_script.md
Normal file
10
docs/dev/docs.dev.client_script.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
{
|
||||||
|
"_label": "Client Scripts: Custoimzing ERPNext"
|
||||||
|
|
||||||
|
}
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
|||||||
"docs.dev.install",
|
"docs.dev.install",
|
||||||
"docs.dev.quickstart",
|
"docs.dev.quickstart",
|
||||||
"docs.dev.framework",
|
"docs.dev.framework",
|
||||||
"docs.dev.api",
|
|
||||||
"docs.dev.modules",
|
"docs.dev.modules",
|
||||||
|
"docs.dev.client_script",
|
||||||
|
"docs.dev.api",
|
||||||
"docs.dev.translate",
|
"docs.dev.translate",
|
||||||
"docs.dev.docs"
|
"docs.dev.docs"
|
||||||
]
|
]
|
@ -16,7 +16,7 @@ cur_frm.cscript = {
|
|||||||
},
|
},
|
||||||
make_listing: function(doc) {
|
make_listing: function(doc) {
|
||||||
cur_frm.communication_view = new wn.views.CommunicationList({
|
cur_frm.communication_view = new wn.views.CommunicationList({
|
||||||
list: wn.model.get("Communication", {"job_applicant": doc.name}),
|
list: wn.model.get("Communication", {"parent": doc.name, "parenttype": "Job Applicant"}),
|
||||||
parent: cur_frm.fields_dict['thread_html'].wrapper,
|
parent: cur_frm.fields_dict['thread_html'].wrapper,
|
||||||
doc: doc,
|
doc: doc,
|
||||||
recipients: doc.email_id
|
recipients: doc.email_id
|
||||||
|
@ -7,4 +7,9 @@ def execute():
|
|||||||
set parenttype=%s, parentfield='communications',
|
set parenttype=%s, parentfield='communications',
|
||||||
parent=`%s`
|
parent=`%s`
|
||||||
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
|
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
|
||||||
|
|
||||||
|
webnotes.reload_doc("core", "doctype", "communication")
|
||||||
|
|
||||||
|
webnotes.conn.sql("""update tabCommunication set communication_date = creation where
|
||||||
|
ifnull(communication_date, '')='' """)
|
||||||
|
|
@ -12,9 +12,6 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
|
|||||||
lead_name = webnotes.conn.get_value("Lead", {"email_id": sender})
|
lead_name = webnotes.conn.get_value("Lead", {"email_id": sender})
|
||||||
contact_name = webnotes.conn.get_value("Contact", {"email_id": sender})
|
contact_name = webnotes.conn.get_value("Contact", {"email_id": sender})
|
||||||
|
|
||||||
parent_doctype = "Contact" if contact_name else "Lead"
|
|
||||||
parent_name = contact_name or lead_name
|
|
||||||
|
|
||||||
if not (lead_name or contact_name):
|
if not (lead_name or contact_name):
|
||||||
# none, create a new Lead
|
# none, create a new Lead
|
||||||
lead = webnotes.bean({
|
lead = webnotes.bean({
|
||||||
@ -28,6 +25,9 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
|
|||||||
lead.insert()
|
lead.insert()
|
||||||
lead_name = lead.doc.name
|
lead_name = lead.doc.name
|
||||||
|
|
||||||
|
parent_doctype = "Contact" if contact_name else "Lead"
|
||||||
|
parent_name = contact_name or lead_name
|
||||||
|
|
||||||
message = make(content=content, sender=sender, subject=subject,
|
message = make(content=content, sender=sender, subject=subject,
|
||||||
doctype = parent_doctype, name = parent_name, date=date)
|
doctype = parent_doctype, name = parent_name, date=date)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.communication_view = new wn.views.CommunicationList({
|
cur_frm.communication_view = new wn.views.CommunicationList({
|
||||||
list: wn.model.get("Communication", {"lead": this.frm.doc.name}),
|
list: wn.model.get("Communication", {"parenttype": "Lead", "parent":this.frm.doc.name}),
|
||||||
parent: this.frm.fields_dict.communication_html.wrapper,
|
parent: this.frm.fields_dict.communication_html.wrapper,
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
recipients: this.frm.doc.email_id
|
recipients: this.frm.doc.email_id
|
||||||
|
@ -46,16 +46,12 @@ $.extend(cur_frm.cscript, {
|
|||||||
make_listing: function(doc) {
|
make_listing: function(doc) {
|
||||||
var wrapper = cur_frm.fields_dict['thread_html'].wrapper;
|
var wrapper = cur_frm.fields_dict['thread_html'].wrapper;
|
||||||
|
|
||||||
var comm_list = wn.model.get("Communication", {"support_ticket": doc.name})
|
var comm_list = wn.model.get("Communication", {"parent": doc.name, "parenttype":"Support Ticket"})
|
||||||
|
|
||||||
var sortfn = function (a, b) { return (b.creation > a.creation) ? 1 : -1; }
|
|
||||||
comm_list = comm_list.sort(sortfn);
|
|
||||||
|
|
||||||
if(!comm_list.length || (comm_list[comm_list.length - 1].sender != doc.raised_by)) {
|
if(!comm_list.length) {
|
||||||
comm_list.push({
|
comm_list.push({
|
||||||
"sender": doc.raised_by,
|
"sender": doc.raised_by,
|
||||||
"creation": doc.creation,
|
"creation": doc.creation,
|
||||||
"modified": doc.creation,
|
|
||||||
"content": doc.description});
|
"content": doc.description});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class TransactionBase(StatusUpdater):
|
|||||||
if self.meta.get_field(fieldname):
|
if self.meta.get_field(fieldname):
|
||||||
self.doc.fields[fieldname] = val
|
self.doc.fields[fieldname] = val
|
||||||
|
|
||||||
if self.meta.get_field("sales_team"):
|
if self.meta.get_field("sales_team") and self.doc.customer:
|
||||||
self.set_sales_team_for_customer()
|
self.set_sales_team_for_customer()
|
||||||
|
|
||||||
def set_sales_team_for_customer(self):
|
def set_sales_team_for_customer(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user