mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 05:09:11 +00:00
Merge branch 'wsgi' of https://github.com/webnotes/erpnext into i18n
Conflicts: accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js public/js/complete_setup.js selling/doctype/opportunity/opportunity.js selling/doctype/quotation/quotation.js
This commit is contained in:
@@ -29,7 +29,7 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
|
||||
parent_name = contact_name or lead_name
|
||||
|
||||
message = make(content=content, sender=sender, subject=subject,
|
||||
doctype = parent_doctype, name = parent_name, date=date)
|
||||
doctype = parent_doctype, name = parent_name, date=date, sent_or_received="Received")
|
||||
|
||||
if mail:
|
||||
# save attachments to parent if from mail
|
||||
|
||||
@@ -33,7 +33,7 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
|
||||
var doc = this.frm.doc;
|
||||
erpnext.hide_naming_series();
|
||||
this.frm.clear_custom_buttons();
|
||||
|
||||
|
||||
this.frm.__is_customer = this.frm.__is_customer || this.frm.doc.__is_customer;
|
||||
if(!this.frm.doc.__islocal && !this.frm.__is_customer) {
|
||||
this.frm.add_custom_button(wn._("Create Customer"), this.create_customer);
|
||||
|
||||
@@ -7,7 +7,6 @@ from webnotes import _
|
||||
from webnotes.utils import cstr, validate_email_add, cint, extract_email_id
|
||||
from webnotes import session, msgprint
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
from controllers.selling_controller import SellingController
|
||||
|
||||
@@ -27,24 +26,9 @@ class DocType(SellingController):
|
||||
customer = webnotes.conn.get_value("Customer", {"lead_name": self.doc.name})
|
||||
if customer:
|
||||
self.doc.fields["__is_customer"] = customer
|
||||
|
||||
def on_communication(self, comm):
|
||||
if comm.sender == self.get_sender(comm) or \
|
||||
webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
|
||||
status = "Replied"
|
||||
else:
|
||||
status = "Open"
|
||||
|
||||
webnotes.conn.set(self.doc, 'status', status)
|
||||
|
||||
def check_status(self):
|
||||
chk = sql("select status from `tabLead` where name=%s", self.doc.name)
|
||||
chk = chk and chk[0][0] or ''
|
||||
return cstr(chk)
|
||||
|
||||
def validate(self):
|
||||
if self.doc.status == 'Lead Lost' and not self.doc.order_lost_reason:
|
||||
webnotes.throw("Please Enter Lost Reason under More Info section")
|
||||
self.set_status()
|
||||
|
||||
if self.doc.source == 'Campaign' and not self.doc.campaign_name and session['user'] != 'Guest':
|
||||
webnotes.throw("Please specify campaign name")
|
||||
@@ -76,14 +60,18 @@ class DocType(SellingController):
|
||||
webnotes.msgprint(_("""Email Id must be unique, already exists for: """) + \
|
||||
", ".join(items), raise_exception=True)
|
||||
|
||||
def get_sender(self, comm):
|
||||
return webnotes.conn.get_value('Sales Email Settings',None,'email_id')
|
||||
|
||||
def on_trash(self):
|
||||
webnotes.conn.sql("""update `tabSupport Ticket` set lead='' where lead=%s""",
|
||||
self.doc.name)
|
||||
|
||||
self.delete_events()
|
||||
|
||||
def has_customer(self):
|
||||
return webnotes.conn.get_value("Customer", {"lead_name": self.doc.name})
|
||||
|
||||
def has_opportunity(self):
|
||||
return webnotes.conn.get_value("Opportunity", {"lead": self.doc.name, "docstatus": 1,
|
||||
"status": ["!=", "Lost"]})
|
||||
|
||||
@webnotes.whitelist()
|
||||
def make_customer(source_name, target_doclist=None):
|
||||
@@ -133,4 +121,4 @@ def make_opportunity(source_name, target_doclist=None):
|
||||
}
|
||||
}}, target_doclist)
|
||||
|
||||
return [d.fields for d in doclist]
|
||||
return [d if isinstance(d, dict) else d.fields for d in doclist]
|
||||
@@ -2,11 +2,12 @@
|
||||
{
|
||||
"creation": "2013-04-10 11:45:37",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-09-26 16:30:36",
|
||||
"modified": "2013-10-09 15:27:54",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "naming_series:",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
@@ -101,7 +102,7 @@
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "Open",
|
||||
"default": "Lead",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
@@ -111,7 +112,7 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "status",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nOpen\nReplied\nAttempted to Contact\nContact in Future\nContacted\nOpportunity Made\nInterested\nNot interested\nLead Lost\nConverted\nPassive",
|
||||
"options": "Lead\nOpen\nReplied\nOpportunity\nInterested\nConverted\nDo Not Contact",
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
@@ -174,19 +175,6 @@
|
||||
"options": "Profile",
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"description": "Date on which the lead was last contacted",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "last_contact_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Last Contact Date",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "last_contact_date",
|
||||
"oldfieldtype": "Date",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "col_break123",
|
||||
@@ -236,8 +224,7 @@
|
||||
"fieldtype": "HTML",
|
||||
"label": "Communication HTML",
|
||||
"oldfieldname": "follow_up",
|
||||
"oldfieldtype": "Table",
|
||||
"print_hide": 1
|
||||
"oldfieldtype": "Table"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
@@ -390,18 +377,6 @@
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"depends_on": "eval:doc.status == 'Lead Lost'",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "order_lost_reason",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Lost Reason",
|
||||
"oldfieldname": "order_lost_reason",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Quotation Lost Reason"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company",
|
||||
@@ -430,8 +405,7 @@
|
||||
"fieldtype": "Table",
|
||||
"hidden": 1,
|
||||
"label": "Communications",
|
||||
"options": "Communication",
|
||||
"print_hide": 1
|
||||
"options": "Communication"
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
|
||||
Reference in New Issue
Block a user