mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 06:22:12 +00:00
fix: bom cost update is not working (#43155)
(cherry picked from commit 05f9015c0b)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@ from frappe import _
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.query_builder import DocType, Interval
|
from frappe.query_builder import DocType, Interval
|
||||||
from frappe.query_builder.functions import Now
|
from frappe.query_builder.functions import Now
|
||||||
from frappe.utils import cint, cstr
|
from frappe.utils import cint, cstr, date_diff, today
|
||||||
|
|
||||||
from erpnext.manufacturing.doctype.bom_update_log.bom_updation_utils import (
|
from erpnext.manufacturing.doctype.bom_update_log.bom_updation_utils import (
|
||||||
get_leaf_boms,
|
get_leaf_boms,
|
||||||
@@ -88,10 +88,12 @@ class BOMUpdateLog(Document):
|
|||||||
|
|
||||||
wip_log = frappe.get_all(
|
wip_log = frappe.get_all(
|
||||||
"BOM Update Log",
|
"BOM Update Log",
|
||||||
{"update_type": "Update Cost", "status": ["in", ["Queued", "In Progress"]]},
|
fields=["name", "modified"],
|
||||||
|
filters={"update_type": "Update Cost", "status": ["in", ["Queued", "In Progress"]]},
|
||||||
limit_page_length=1,
|
limit_page_length=1,
|
||||||
)
|
)
|
||||||
if wip_log:
|
|
||||||
|
if wip_log and date_diff(today(), wip_log[0].modified) < 1:
|
||||||
log_link = frappe.utils.get_link_to_form("BOM Update Log", wip_log[0].name)
|
log_link = frappe.utils.get_link_to_form("BOM Update Log", wip_log[0].name)
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_("BOM Updation already in progress. Please wait until {0} is complete.").format(log_link),
|
_("BOM Updation already in progress. Please wait until {0} is complete.").format(log_link),
|
||||||
|
|||||||
Reference in New Issue
Block a user