Get amount
This commit is contained in:
@@ -2700,6 +2700,26 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
self.assertEqual(fee.quantity, Decimal('40.00000'))
|
||||
save.assert_called_once_with([fee])
|
||||
|
||||
def test_shipment_per_quantity_fee_amount_uses_fee_lots_quantity(self):
|
||||
'shipment per quantity fee amount ignores unrelated shipment moves'
|
||||
Fee = Pool().get('fee.fee')
|
||||
fee = Fee()
|
||||
fee.mode = 'perqt'
|
||||
fee.price = Decimal('3.14')
|
||||
fee.quantity = Decimal('3000')
|
||||
fee.add_padding = False
|
||||
fee.shipment_in = Mock(id=7)
|
||||
|
||||
with patch.object(
|
||||
fee, '_get_effective_fee_lots_quantity',
|
||||
return_value=Decimal('3000')) as lots_quantity, patch(
|
||||
'trytond.modules.purchase_trade.fee.Pool') as PoolMock:
|
||||
amount = fee.get_amount()
|
||||
|
||||
self.assertEqual(amount, Decimal('9420.00'))
|
||||
lots_quantity.assert_called_once_with()
|
||||
PoolMock.assert_not_called()
|
||||
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user