Bug Add physical lots
This commit is contained in:
@@ -2332,6 +2332,37 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
self.assertEqual(fee.quantity, Decimal('40.00000'))
|
||||
save.assert_called_once_with([fee])
|
||||
|
||||
def test_shipment_fee_lot_domain_keeps_open_virtual_lots(self):
|
||||
'shipment fee lot domain keeps virtual lots after partial physical add'
|
||||
Fee = Pool().get('fee.fee')
|
||||
fee = Fee()
|
||||
fee.line = None
|
||||
fee.sale_line = None
|
||||
fee.shipment_in = Mock(id=7)
|
||||
fee.shipment_internal = None
|
||||
fee.shipment_out = None
|
||||
physical = Mock(id=2599, lot_type='physic')
|
||||
virtual_a = Mock(id=2666, lot_type='virtual')
|
||||
virtual_b = Mock(id=2623, lot_type='virtual')
|
||||
physical.getVlot_p.return_value = virtual_a
|
||||
Lot = Mock()
|
||||
Lot.search.return_value = [physical]
|
||||
LotQt = Mock()
|
||||
LotQt.search.return_value = [
|
||||
Mock(lot_p=virtual_a),
|
||||
Mock(lot_p=virtual_b),
|
||||
]
|
||||
|
||||
with patch('trytond.modules.purchase_trade.fee.Pool') as PoolMock:
|
||||
PoolMock.return_value.get.side_effect = lambda name: {
|
||||
'lot.lot': Lot,
|
||||
'lot.qt': LotQt,
|
||||
}[name]
|
||||
|
||||
lots = fee.get_lots(None)
|
||||
|
||||
self.assertEqual(lots, [physical, virtual_a, virtual_b])
|
||||
|
||||
def test_fee_ppack_auto_sync_keeps_auto_quantity(self):
|
||||
'per packing auto fee keeps the on-change quantity on save'
|
||||
Fee = Pool().get('fee.fee')
|
||||
|
||||
Reference in New Issue
Block a user