03.03.26
This commit is contained in:
@@ -480,6 +480,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||||||
fee.mode = mode
|
fee.mode = mode
|
||||||
fee.currency = curr
|
fee.currency = curr
|
||||||
fee.unit = unit
|
fee.unit = unit
|
||||||
|
fee.quantity = self.get_bales() or 1
|
||||||
fee.product = Product.get_by_name('Reweighing')
|
fee.product = Product.get_by_name('Reweighing')
|
||||||
fee.price = price
|
fee.price = price
|
||||||
Fee.save([fee])
|
Fee.save([fee])
|
||||||
@@ -859,6 +860,12 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||||||
def get_quantity(self,name=None):
|
def get_quantity(self,name=None):
|
||||||
if self.incoming_moves:
|
if self.incoming_moves:
|
||||||
return sum([(e.quantity if e.quantity else 0) for e in 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):
|
def get_unit(self,name=None):
|
||||||
if self.incoming_moves:
|
if self.incoming_moves:
|
||||||
|
|||||||
Reference in New Issue
Block a user