Skip to content

Commit

Permalink
fix: consider 0 if rate/qty are null (#35338)
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
ankush authored May 17, 2023
1 parent 0f3230f commit e5c86bc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ def execute():
frappe.reload_doc("manufacturing", "doctype", "work_order")
frappe.reload_doc("manufacturing", "doctype", "work_order_item")

frappe.db.sql("""UPDATE `tabWork Order Item` SET amount = rate * required_qty""")
frappe.db.sql(
"""UPDATE `tabWork Order Item` SET amount = ifnull(rate, 0.0) * ifnull(required_qty, 0.0)"""
)

0 comments on commit e5c86bc

Please sign in to comment.