Shipment Pnl
This commit is contained in:
@@ -1814,27 +1814,11 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
return lot_ids
|
||||
|
||||
def get_pnl_lines(self, name=None):
|
||||
lot_ids = self._pnl_lot_ids()
|
||||
if not lot_ids and not self.id:
|
||||
if not self.id:
|
||||
return []
|
||||
ValuationLine = Pool().get('valuation.valuation.line')
|
||||
if self.id and lot_ids:
|
||||
domain = ['OR',
|
||||
[('shipment_in', '=', self.id)],
|
||||
[
|
||||
('shipment_in', '=', None),
|
||||
('lot', 'in', lot_ids),
|
||||
],
|
||||
]
|
||||
elif self.id:
|
||||
domain = [('shipment_in', '=', self.id)]
|
||||
else:
|
||||
domain = [
|
||||
('shipment_in', '=', None),
|
||||
('lot', 'in', lot_ids),
|
||||
]
|
||||
lines = ValuationLine.search(
|
||||
domain,
|
||||
[('shipment_in', '=', self.id)],
|
||||
order=[('date', 'DESC'), ('id', 'DESC')])
|
||||
return [line.id for line in lines]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user