Skip to content

Commit

Permalink
fix: wrong qty of remaining work orders to be created when using "Cre…
Browse files Browse the repository at this point in the history
…ate" > "Work Order" (#34726)

fix: wrong qty of remaining work orders to be created when using "Create" > "Work Order" (#34726)

* fix: convert asynchronous field update to synchronous

* fix: wrong qty of remaining work orders to be created when using "Create" > "Work Order"

(cherry picked from commit 189b020)

Co-authored-by: danjeremynavarro <[email protected]>
  • Loading branch information
mergify[bot] and danjeremynavarro authored Apr 25, 2023
1 parent 878d747 commit 47df41f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions erpnext/selling/doctype/sales_order/sales_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,9 @@ def get_work_order_items(sales_order, for_raw_material_request=0):
.select(Sum(wo.qty))
.where(
(wo.production_item == i.item_code)
& (wo.sales_order == so.name) * (wo.sales_order_item == i.name)
& (wo.docstatus.lte(2))
& (wo.sales_order == so.name)
& (wo.sales_order_item == i.name)
& (wo.docstatus.lt(2))
)
.run()[0][0]
)
Expand Down

0 comments on commit 47df41f

Please sign in to comment.