This commit is contained in:
2026-02-04 21:20:34 +01:00
parent 0a88b26160
commit a69a9dcb57
3 changed files with 11 additions and 10 deletions

View File

@@ -503,9 +503,9 @@ class Lot(ModelSQL, ModelView):
physic_sum += round(Decimal(Uom.compute_qty(Uom(l.lot_unit_line),float(l.get_current_quantity()),l.line.unit)),5)
return line.quantity_theorical - physic_sum
def get_current_quantity(self,state_id=0,name=None):
def get_current_quantity(self,name=None):
# if self.lot_type == 'physic':
qt, gross_qt = self.get_hist_quantity(state_id)
qt, gross_qt = self.get_hist_quantity()
return qt
# else:
# return self.get_virtual_diff()
@@ -513,11 +513,12 @@ class Lot(ModelSQL, ModelView):
def get_current_quantity_converted(self,state_id=0,name=None):
Uom = Pool().get('product.uom')
unit = self.line.unit if self.line else self.sale_line.unit
return round(Decimal(Uom.compute_qty(self.lot_unit_line, float(self.get_current_quantity(state_id)), unit)),5)
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(self,state_id=0,name=None):
def get_current_gross_quantity(self,name=None):
if self.lot_type == 'physic':
qt, gross_qt = self.get_hist_quantity(state_id)
qt, gross_qt = self.get_hist_quantity()
return gross_qt
else:
return None