Lot invoicing + Fee padding
This commit is contained in:
@@ -3095,6 +3095,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
fee.mode = 'pprice'
|
||||
fee.price = Decimal('2')
|
||||
fee.add_padding = True
|
||||
fee.state = 'not invoiced'
|
||||
fee.unit = unit
|
||||
fee.quantity = Decimal('5')
|
||||
fee.line = None
|
||||
@@ -3131,6 +3132,8 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
with patch.object(
|
||||
fee, '_get_effective_fee_lots', return_value=[lot]):
|
||||
self.assertEqual(fee.get_amount(), Decimal('14.00'))
|
||||
fee.state = 'invoiced'
|
||||
self.assertEqual(fee.get_amount(), Decimal('10.00'))
|
||||
with Transaction().set_context(
|
||||
_purchase_trade_ignore_fee_padding=True):
|
||||
self.assertEqual(fee.get_amount(), Decimal('10.00'))
|
||||
|
||||
Reference in New Issue
Block a user