mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-19 09:35:03 +00:00
Merge pull request #41945 from frappe/mergify/bp/version-15-hotfix/pr-41421
fix: migrate lead notes (backport #41421)
This commit is contained in:
@@ -9,15 +9,13 @@ def execute():
|
||||
|
||||
dt = frappe.qb.DocType(doctype)
|
||||
records = (
|
||||
frappe.qb.from_(dt)
|
||||
.select(dt.name, dt.notes, dt.modified_by, dt.modified)
|
||||
.where(dt.notes.isnotnull() & dt.notes != "")
|
||||
frappe.qb.from_(dt).select(dt.name, dt.notes).where(dt.notes.isnotnull() & dt.notes != "")
|
||||
).run(as_dict=True)
|
||||
|
||||
for d in records:
|
||||
if strip_html(cstr(d.notes)).strip():
|
||||
doc = frappe.get_doc(doctype, d.name)
|
||||
doc.append("notes", {"note": d.notes, "added_by": d.modified_by, "added_on": d.modified})
|
||||
doc.append("notes", {"note": d.notes})
|
||||
doc.update_child_table("notes")
|
||||
|
||||
frappe.db.sql_ddl(f"alter table `tab{doctype}` drop column `notes`")
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
{% for(var i=0, l=notes.length; i<l; i++) { %}
|
||||
<div class="comment-content p-3 row" name="{{ notes[i].name }}">
|
||||
<div class="mb-2 head col-xs-3">
|
||||
{% if (notes[i].added_by && notes[i].added_on) %}
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
{{ frappe.avatar(notes[i].added_by) }}
|
||||
@@ -25,6 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% } %}
|
||||
</div>
|
||||
<div class="content col-xs-8">
|
||||
{{ notes[i].note }}
|
||||
|
||||
Reference in New Issue
Block a user