mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
communication
This commit is contained in:
@@ -17,6 +17,7 @@ def execute():
|
|||||||
def move_customizations():
|
def move_customizations():
|
||||||
import webnotes.model.doc
|
import webnotes.model.doc
|
||||||
import webnotes.model.doctype
|
import webnotes.model.doctype
|
||||||
|
|
||||||
res = webnotes.conn.sql("""\
|
res = webnotes.conn.sql("""\
|
||||||
delete from `tabProperty Setter`
|
delete from `tabProperty Setter`
|
||||||
where property='previous_field'
|
where property='previous_field'
|
||||||
@@ -28,15 +29,14 @@ def move_customizations():
|
|||||||
for r in res:
|
for r in res:
|
||||||
d = webnotes.model.doc.Document('Custom Field', r[0])
|
d = webnotes.model.doc.Document('Custom Field', r[0])
|
||||||
d.dt = 'Communication'
|
d.dt = 'Communication'
|
||||||
d.validate()
|
|
||||||
d.save()
|
d.save()
|
||||||
d.on_update()
|
from webnotes.model.db_schema import updatedb
|
||||||
|
updatedb('Communication')
|
||||||
|
|
||||||
res = webnotes.conn.sql("""\
|
res = webnotes.conn.sql("""\
|
||||||
select field_name from `tabProperty Setter`
|
select field_name from `tabProperty Setter`
|
||||||
where doc_type='Communication Log' and field_name is not null""")
|
where doc_type='Communication Log' and field_name is not null""")
|
||||||
|
|
||||||
|
|
||||||
doclist = webnotes.model.doctype.get('Communication', 0)
|
doclist = webnotes.model.doctype.get('Communication', 0)
|
||||||
field_list = [d.fieldname for d in doclist if d.doctype=='DocField']
|
field_list = [d.fieldname for d in doclist if d.doctype=='DocField']
|
||||||
for r in res:
|
for r in res:
|
||||||
@@ -50,15 +50,25 @@ def move_customizations():
|
|||||||
delete from `tabProperty Setter`
|
delete from `tabProperty Setter`
|
||||||
where doc_type='Communication Log'""")
|
where doc_type='Communication Log'""")
|
||||||
|
|
||||||
|
from webnotes.utils.cache import CacheItem
|
||||||
|
CacheItem('Communication').clear()
|
||||||
|
|
||||||
def remove_communication_log():
|
def remove_communication_log():
|
||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.model
|
import webnotes.model
|
||||||
import webnotes.model.doc
|
import webnotes.model.doc
|
||||||
|
import webnotes.model.doctype
|
||||||
|
|
||||||
|
webnotes.conn.auto_commit_on_many_writes = True
|
||||||
|
|
||||||
# get all communication log records
|
# get all communication log records
|
||||||
comm_log_list = webnotes.conn.sql("select * from `tabCommunication Log`",
|
comm_log_list = webnotes.conn.sql("select * from `tabCommunication Log`",
|
||||||
as_dict=1)
|
as_dict=1)
|
||||||
|
|
||||||
|
field_list = [d.fieldname for d in \
|
||||||
|
webnotes.model.doctype.get('Communication', 0) \
|
||||||
|
if d.doctype=='DocField']
|
||||||
|
|
||||||
# copy it to communication
|
# copy it to communication
|
||||||
for comm_log in comm_log_list:
|
for comm_log in comm_log_list:
|
||||||
d = webnotes.model.doc.Document('Communication')
|
d = webnotes.model.doc.Document('Communication')
|
||||||
@@ -68,9 +78,10 @@ def remove_communication_log():
|
|||||||
d.fields[key] = comm_log[key]
|
d.fields[key] = comm_log[key]
|
||||||
|
|
||||||
parenttype = (comm_log.get('parenttype') or '').lower()
|
parenttype = (comm_log.get('parenttype') or '').lower()
|
||||||
if parenttype in d.fields.keys():
|
if parenttype in field_list:
|
||||||
d.fields[parenttype] = comm_log.get('parent')
|
d.fields[parenttype] = comm_log.get('parent')
|
||||||
|
|
||||||
|
d.naming_series = 'COMM-'
|
||||||
d.subject = 'Follow Up'
|
d.subject = 'Follow Up'
|
||||||
d.content = comm_log.get('notes') or ''
|
d.content = comm_log.get('notes') or ''
|
||||||
d.medium = comm_log.get('follow_up_type') or ''
|
d.medium = comm_log.get('follow_up_type') or ''
|
||||||
@@ -78,7 +89,7 @@ def remove_communication_log():
|
|||||||
d.communication_date = comm_log.get('date')
|
d.communication_date = comm_log.get('date')
|
||||||
d.category = 'Miscellaneous'
|
d.category = 'Miscellaneous'
|
||||||
d.action = 'No Action'
|
d.action = 'No Action'
|
||||||
d.save()
|
d.save(ignore_fields=1)
|
||||||
|
|
||||||
# delete records with parent type "Customer", "Lead", "Supplier"
|
# delete records with parent type "Customer", "Lead", "Supplier"
|
||||||
webnotes.conn.sql("""\
|
webnotes.conn.sql("""\
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ wn.doclistviews['Communication'] = wn.views.ListView.extend({
|
|||||||
|
|
||||||
if(data.content && data.content.length > 50) {
|
if(data.content && data.content.length > 50) {
|
||||||
data.content = '<span title="'+data.content+'">' +
|
data.content = '<span title="'+data.content+'">' +
|
||||||
data.description.substr(0,50) + '...</span>';
|
data.content.substr(0,50) + '...</span>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
<br>
|
<br>
|
||||||
<h4><a href="#!List/Maintenance Visit">Maintenance Visit</a></h4>
|
<h4><a href="#!List/Maintenance Visit">Maintenance Visit</a></h4>
|
||||||
<p class="help">Visit report for maintenance visit</p>
|
<p class="help">Visit report for maintenance visit</p>
|
||||||
|
<br>
|
||||||
|
<h4><a href="#!List/Communication">Communication</a></h4>
|
||||||
|
<p class="help">Communication Log</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 48%; float: right;">
|
<div style="width: 48%; float: right;">
|
||||||
<h4><a href="#!List/Serial No">Serial No</a></h4>
|
<h4><a href="#!List/Serial No">Serial No</a></h4>
|
||||||
<p class="help">Single unit of an Item</p>
|
<p class="help">Single unit of an Item</p>
|
||||||
<br>
|
|
||||||
<h4><a href="#!List/Communication">Communication</a></h4>
|
|
||||||
<p class="help">Communication Log</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both"></div>
|
<div style="clear: both"></div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
Reference in New Issue
Block a user