bemade_stock_quant_valuation: update to calculate 0 difference when no counted quantity is present on the quant.

This commit is contained in:
Marc Durepos 2023-09-19 15:23:37 -04:00
parent 538aac89c3
commit 180b37869b

View file

@ -16,6 +16,5 @@ class StockQuant(models.Model):
@api.depends('inventory_diff_quantity', 'value_unit')
def _compute_difference_value(self):
for rec in self:
rec.value_difference = (rec.value_unit * rec.inventory_diff_quantity
if rec.inventory_diff_quantity is not None else None)
for rec in self.filtered(lambda r: r.inventory_quantity is not None):
rec.value_difference = rec.value_unit * rec.inventory_diff_quantity