This commit is contained in:
2026-03-13 14:47:13 +01:00
parent cc5f4da38c
commit b20b0c8df6
2 changed files with 8 additions and 6 deletions

View File

@@ -510,15 +510,17 @@ class Lot(ModelSQL, ModelView):
# else:
# return self.get_virtual_diff()
def get_current_quantity_converted(self,state_id=0,name=None):
def get_current_quantity_converted(self,state_id=0,unit=None):
Uom = Pool().get('product.uom')
unit = self.line.unit if self.line else self.sale_line.unit
if not unit:
unit = self.line.unit if self.line else self.sale_line.unit
qt, gross_qt = self.get_hist_quantity(state_id)
return round(Decimal(Uom.compute_qty(self.lot_unit_line, float(qt), unit)),5)
def get_current_gross_quantity_converted(self,state_id=0,name=None):
def get_current_gross_quantity_converted(self,state_id=0,unit=None):
Uom = Pool().get('product.uom')
unit = self.line.unit if self.line else self.sale_line.unit
if not unit:
unit = self.line.unit if self.line else self.sale_line.unit
qt, gross_qt = self.get_hist_quantity(state_id)
return round(Decimal(Uom.compute_qty(self.lot_unit_line, float(gross_qt), unit)),5)