fix: not able to make stock entry (backport #36759) (#36767)

fix: not able to make stock entry (#36759)

(cherry picked from commit 873ee384a1f0832faf84015167f7bdc697f1dc46)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot] 2023-08-22 17:36:56 +05:30 committed by GitHub
parent 87e2309e8e
commit 611c2bf775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -656,7 +656,10 @@ def make_stock_entry(source_name, target_doc=None):
"job_card_item": "job_card_item",
},
"postprocess": update_item,
"condition": lambda doc: doc.ordered_qty < doc.stock_qty,
"condition": lambda doc: (
flt(doc.ordered_qty, doc.precision("ordered_qty"))
< flt(doc.stock_qty, doc.precision("ordered_qty"))
),
},
},
target_doc,