Merge pull request #35015 from rohitwaghchaure/incorrect-or-cond-delivery-note-issue

fix: incorrect OR condition causing timeout error (For more than 50 line items)
This commit is contained in:
rohitwaghchaure
2023-04-24 18:06:59 +05:30
committed by GitHub

View File

@@ -1445,6 +1445,7 @@ def get_next_stock_reco(kwargs):
(
CombineDatetime(sle.posting_date, sle.posting_time)
> CombineDatetime(kwargs.get("posting_date"), kwargs.get("posting_time"))
)
| (
(
CombineDatetime(sle.posting_date, sle.posting_time)
@@ -1454,7 +1455,6 @@ def get_next_stock_reco(kwargs):
)
)
)
)
.orderby(CombineDatetime(sle.posting_date, sle.posting_time))
.orderby(sle.creation)
.limit(1)