mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-02 18:14:50 +00:00
fix: update the modified date in for SLEs and GLs after rename
(cherry picked from commit dc5a5ef258)
This commit is contained in:
committed by
Mergify
parent
55ac96ff09
commit
8801584c8d
@@ -7,7 +7,7 @@ from frappe import _
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.model.meta import get_field_precision
|
from frappe.model.meta import get_field_precision
|
||||||
from frappe.model.naming import set_name_from_naming_options
|
from frappe.model.naming import set_name_from_naming_options
|
||||||
from frappe.utils import flt, fmt_money
|
from frappe.utils import flt, fmt_money, now
|
||||||
|
|
||||||
import erpnext
|
import erpnext
|
||||||
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
||||||
@@ -405,7 +405,7 @@ def rename_temporarily_named_docs(doctype):
|
|||||||
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
|
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
|
||||||
newname = doc.name
|
newname = doc.name
|
||||||
frappe.db.sql(
|
frappe.db.sql(
|
||||||
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0 where name = %s",
|
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0, modified = %s where name = %s",
|
||||||
(newname, oldname),
|
(newname, now(), oldname),
|
||||||
auto_commit=True,
|
auto_commit=True,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user