Bug Add physical lots
This commit is contained in:
@@ -290,21 +290,35 @@ class Fee(ModelSQL,ModelView):
|
||||
else:
|
||||
return self.unit
|
||||
|
||||
def get_lots(self, name):
|
||||
logger.info("GET_LOTS_LINE:%s",self.line)
|
||||
logger.info("GET_LOTS_SHIPMENT_IN:%s",self.shipment_in)
|
||||
Lot = Pool().get('lot.lot')
|
||||
if self.line:
|
||||
return self.line.lots
|
||||
if self.shipment_in:
|
||||
lots = Lot.search([('lot_shipment_in','=',self.shipment_in.id)])
|
||||
logger.info("LOTSDOMAIN:%s",lots)
|
||||
if lots:
|
||||
return lots + [lots[0].getVlot_p()]
|
||||
if self.shipment_internal:
|
||||
return Lot.search([('lot_shipment_internal','=',self.shipment_internal.id)])
|
||||
if self.shipment_out:
|
||||
return Lot.search([('lot_shipment_out','=',self.shipment_out.id)])
|
||||
def get_lots(self, name):
|
||||
logger.info("GET_LOTS_LINE:%s",self.line)
|
||||
logger.info("GET_LOTS_SHIPMENT_IN:%s",self.shipment_in)
|
||||
Lot = Pool().get('lot.lot')
|
||||
if self.line:
|
||||
return self.line.lots
|
||||
if self.shipment_in:
|
||||
LotQt = Pool().get('lot.qt')
|
||||
lots = Lot.search([('lot_shipment_in','=',self.shipment_in.id)])
|
||||
logger.info("LOTSDOMAIN:%s",lots)
|
||||
domain_lots = []
|
||||
seen = set()
|
||||
for lot in lots:
|
||||
lot_id = getattr(lot, 'id', None)
|
||||
if lot_id not in seen:
|
||||
domain_lots.append(lot)
|
||||
seen.add(lot_id)
|
||||
for lqt in LotQt.search(['lot_shipment_in','=',self.shipment_in.id]):
|
||||
lot = getattr(lqt, 'lot_p', None)
|
||||
lot_id = getattr(lot, 'id', None)
|
||||
if lot and lot_id not in seen:
|
||||
domain_lots.append(lot)
|
||||
seen.add(lot_id)
|
||||
if domain_lots:
|
||||
return domain_lots
|
||||
if self.shipment_internal:
|
||||
return Lot.search([('lot_shipment_internal','=',self.shipment_internal.id)])
|
||||
if self.shipment_out:
|
||||
return Lot.search([('lot_shipment_out','=',self.shipment_out.id)])
|
||||
|
||||
return Lot.search(['id','>',0])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user