-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added assignee email field in asset maintenance log
- Loading branch information
1 parent
c671a6c
commit 5911934
Showing
5 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
erpnext/patches/v15_0/update_task_assignee_email_field_in_asset_maintenance_log.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import frappe | ||
from frappe.query_builder import DocType | ||
|
||
|
||
def execute(): | ||
if frappe.db.has_column("Asset Maintenance Log", "task_assignee_email"): | ||
asset_maintenance_log = DocType("Asset Maintenance Log") | ||
asset_maintenance_task = DocType("Asset Maintenance Task") | ||
try: | ||
( | ||
frappe.qb.update(asset_maintenance_log) | ||
.set(asset_maintenance_log.task_assignee_email, asset_maintenance_task.assign_to) | ||
.join(asset_maintenance_task) | ||
.on(asset_maintenance_log.task == asset_maintenance_task.name) | ||
.run() | ||
) | ||
except Exception: | ||
frappe.log_error("Failed to update Task Assignee Email Field.") |