mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
[minor] fixes to crm patch
This commit is contained in:
@@ -69,12 +69,14 @@ class StatusUpdater(DocListController):
|
|||||||
if self.doc.get("__islocal"):
|
if self.doc.get("__islocal"):
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.doc.doctype in status_map.keys():
|
if self.doc.doctype in status_map:
|
||||||
for s in status_map[self.doc.doctype].reverse():
|
sl = status_map[self.doc.doctype][:]
|
||||||
|
sl.reverse()
|
||||||
|
for s in sl:
|
||||||
if not s[1]:
|
if not s[1]:
|
||||||
self.doc.status = s[0]
|
self.doc.status = s[0]
|
||||||
break
|
break
|
||||||
elif s[1].startwith("eval:"):
|
elif s[1].startswith("eval:"):
|
||||||
if eval(s[1][5:]):
|
if eval(s[1][5:]):
|
||||||
self.doc.status = s[0]
|
self.doc.status = s[0]
|
||||||
break
|
break
|
||||||
@@ -89,14 +91,14 @@ class StatusUpdater(DocListController):
|
|||||||
self.set_status(update=True)
|
self.set_status(update=True)
|
||||||
|
|
||||||
def communication_received(self):
|
def communication_received(self):
|
||||||
last_comm = self.doclist.get({"doctype":"Communication"})[-1]
|
last_comm = self.doclist.get({"doctype":"Communication"})
|
||||||
if last_comm:
|
if last_comm:
|
||||||
return last_comm.sent_or_received == "Received"
|
return last_comm[-1].sent_or_received == "Received"
|
||||||
|
|
||||||
def communication_sent(self):
|
def communication_sent(self):
|
||||||
last_comm = self.doclist.get({"doctype":"Communication"})[-1]
|
last_comm = self.doclist.get({"doctype":"Communication"})
|
||||||
if last_comm:
|
if last_comm:
|
||||||
return last_comm.sent_or_received == "Sent"
|
return last_comm[-1].sent_or_received == "Sent"
|
||||||
|
|
||||||
def validate_qty(self):
|
def validate_qty(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
webnotes.reload_doc("stock", "doctype", "delivery_note_item")
|
||||||
webnotes.conn.sql("""update `tabDelivery Note Item` set against_sales_order=prevdoc_docname
|
webnotes.conn.sql("""update `tabDelivery Note Item` set against_sales_order=prevdoc_docname
|
||||||
where prevdoc_doctype='Sales Order' """)
|
where prevdoc_doctype='Sales Order' """)
|
||||||
|
|
||||||
|
|||||||
@@ -30,3 +30,18 @@ def execute():
|
|||||||
["To Reply", "Open"],
|
["To Reply", "Open"],
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for dt, opts in change_map.items():
|
||||||
|
for status in opts:
|
||||||
|
webnotes.conn.sql("""update `tab%s` set status=%s where status=%s""" % \
|
||||||
|
(dt, "%s", "%s"), (status[1], status[0]))
|
||||||
|
|
||||||
|
# for dt in ["Lead", "Opportunity"]:
|
||||||
|
# for name in webnotes.conn.sql_list("""select name from `tab%s`""" % dt):
|
||||||
|
# bean = webnotes.bean(dt, name)
|
||||||
|
# before_status = bean.doc.status
|
||||||
|
# bean.get_controller().set_status()
|
||||||
|
#
|
||||||
|
# if bean.doc.status != before_status:
|
||||||
|
# webnotes.conn.sql("""update `tab%s` set status=%s where name=%s""" % (dt, "%s", "%s"),
|
||||||
|
# (bean.doc.status, name))
|
||||||
|
|||||||
Reference in New Issue
Block a user