Ver código fonte

[fixes] set lead, contact and company on support ticket

version-14
Nabin Hait 12 anos atrás
pai
commit
fd332e47a2
3 arquivos alterados com 45 adições e 39 exclusões
  1. +10
    -2
      core/doctype/communication/communication.py
  2. +34
    -37
      core/doctype/communication/communication.txt
  3. +1
    -0
      public/js/wn/views/communication.js

+ 10
- 2
core/doctype/communication/communication.py Ver arquivo

@@ -39,11 +39,10 @@ def get_customer_supplier(args=None):

@webnotes.whitelist()
def make(doctype=None, name=None, content=None, subject=None,
sender=None, recipients=None, contact=None, lead=None,
sender=None, recipients=None, contact=None, lead=None, company=None,
communication_medium="Email", send_email=False, print_html=None,
attachments='[]', send_me_a_copy=False, set_lead=True, date=None):
# add to Communication

sent_via = None
d = webnotes.doc('Communication')
@@ -53,6 +52,7 @@ def make(doctype=None, name=None, content=None, subject=None,
d.recipients = recipients
d.lead = lead
d.contact = contact
d.company = company
if date:
d.creation = date
if doctype:
@@ -113,6 +113,14 @@ def set_lead_and_contact(d):
if not d.lead:
d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr[1]},
"name") or None
if not d.company:
if d.lead:
company = webnotes.conn.get_value("Lead", d.lead, "company")
elif d.contact:
company = webnotes.conn.get_value("Contact", d.contact, "company")
d.company = company or webnotes.conn.get_default("company")

class DocType():
def __init__(self, doc, doclist=[]):


+ 34
- 37
core/doctype/communication/communication.txt Ver arquivo

@@ -1,8 +1,8 @@
[
{
"creation": "2013-01-28 17:06:59",
"creation": "2013-01-29 10:47:14",
"docstatus": 0,
"modified": "2013-01-28 15:29:13",
"modified": "2013-05-21 12:19:45",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,14 +26,14 @@
"permlevel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Communication",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"submit": 0,
"write": 1
},
{
@@ -53,7 +53,6 @@
"doctype": "DocField",
"fieldname": "subject",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Subject",
"reqd": 1
},
@@ -175,14 +174,12 @@
"doctype": "DocField",
"fieldname": "recipients",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Recipients"
},
{
"doctype": "DocField",
"fieldname": "sender",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Sender"
},
{
@@ -233,6 +230,13 @@
"fieldtype": "Column Break",
"label": "On"
},
{
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company"
},
{
"default": "Today",
"doctype": "DocField",
@@ -250,53 +254,46 @@
"print_hide": 1
},
{
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"role": "Support Team"
},
{
"create": 1,
"amend": 0,
"cancel": 1,
"doctype": "DocPerm",
"permlevel": 0,
"role": "Sales Manager"
"report": 1,
"role": "Support Team",
"submit": 0
},
{
"create": 1,
"amend": 0,
"cancel": 1,
"doctype": "DocPerm",
"permlevel": 0,
"role": "Sales User"
"report": 1,
"role": "Sales Manager",
"submit": 0
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"cancel": 1,
"doctype": "DocPerm",
"match": "",
"permlevel": 1,
"role": "Sales Manager"
"report": 1,
"role": "Sales User",
"submit": 0
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"cancel": 1,
"doctype": "DocPerm",
"match": "",
"permlevel": 1,
"role": "Support Manager"
"report": 1,
"role": "Support Manager",
"submit": 0
},
{
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"role": "Support Manager"
"report": 1,
"role": "System Manager",
"submit": 0
},
{
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"role": "System Manager"
"match": "owner",
"role": "Sales Representative"
}
]

+ 1
- 0
public/js/wn/views/communication.js Ver arquivo

@@ -229,6 +229,7 @@ wn.views.CommunicationComposer = Class.extend({
name: me.doc.name,
lead: me.doc.lead,
contact: me.doc.contact,
company: me.doc.company || sys_defaults.company,
send_me_a_copy: form_values.send_me_a_copy,
send_email: form_values.send_email,
print_html: print_html,


Carregando…
Cancelar
Salvar