This commit is contained in:
2026-03-03 13:23:19 +01:00
parent 7f0400400c
commit af89743b40

View File

@@ -480,6 +480,7 @@ class ShipmentIn(metaclass=PoolMeta):
fee.mode = mode
fee.currency = curr
fee.unit = unit
fee.quantity = self.get_bales() or 1
fee.product = Product.get_by_name('Reweighing')
fee.price = price
Fee.save([fee])
@@ -859,6 +860,12 @@ class ShipmentIn(metaclass=PoolMeta):
def get_quantity(self,name=None):
if self.incoming_moves:
return sum([(e.quantity if e.quantity else 0) for e in self.incoming_moves])
def get_bales(self,name=None):
Lot = Pool().get('lot.lot')
lots = Lot.search(['lot_shipment_in','=',self.id])
if lots:
return sum([l.lot_qt for l in lots])
def get_unit(self,name=None):
if self.incoming_moves: