Skip to content

Commit

Permalink
Fix broken variable reference in stock move pricing
Browse files Browse the repository at this point in the history
Previously, inconsistent variable naming (`price_unit` vs `price`) caused incorrect behavior in price calculation and updates. This change ensures consistent usage of the `price` variable to avoid potential errors.
  • Loading branch information
dhongu committed Jan 27, 2025
1 parent 1cab111 commit a6f2b86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions l10n_ro_stock_account/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def _get_price_unit(self):

if self._is_in:
if self.price_unit:
return self.price_unit
return price_unit
elif not self._is_out():
return price_unit

Expand Down Expand Up @@ -868,8 +868,8 @@ def _get_price_unit(self):
self.env.cr.execute(sql, param)
res = self.env.cr.dictfetchone()
if res and res["quantity"]:
price_unit = res["value"] / res["quantity"]
self.write({"price_unit": price_unit})
price = res["value"] / res["quantity"]
self.write({"price_unit": price})
return price_unit

def _get_out_svl_vals(self, forced_quantity):
Expand Down

0 comments on commit a6f2b86

Please sign in to comment.