Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: consider zero valuation rate for serial nos (backport #44532) #44534

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions erpnext/stock/serial_batch_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def calculate_stock_value_change(self):
serial_nos = self.get_serial_nos()
for serial_no in serial_nos:
incoming_rate = self.get_incoming_rate_from_bundle(serial_no)
if not incoming_rate:
if incoming_rate is None:
continue

self.stock_value_change += incoming_rate
Expand Down Expand Up @@ -553,7 +553,7 @@ def get_incoming_rate_from_bundle(self, serial_no) -> float:
query = query.where(timestamp_condition)

incoming_rate = query.run()
return flt(incoming_rate[0][0]) if incoming_rate else 0.0
return flt(incoming_rate[0][0]) if incoming_rate else None

def get_serial_nos(self):
if self.sle.get("serial_nos"):
Expand Down
Loading