Allow for 0 valuation rate in Stock Reconciliation (#15313)

Currently, a valuation rate of 0 gets treated the same as an omitted
valuation rate, and gets overwritten during validation. This hotfix
allows a Stock Reconciliation Item's valuation rate to be set to 0.
This commit is contained in:
johnhkelley1 2018-09-05 00:13:28 -06:00 committed by Nabin Hait
parent fba985d49d
commit 431b4fba72

View File

@ -109,7 +109,7 @@ class StockReconciliation(StockController):
self.validation_messages.append(_get_msg(row_num,
_("Negative Valuation Rate is not allowed")))
if row.qty and not row.valuation_rate:
if row.qty and row.valuation_rate in ["", None]:
row.valuation_rate = get_stock_balance(row.item_code, row.warehouse,
self.posting_date, self.posting_time, with_valuation_rate=True)[1]
if not row.valuation_rate: