feat(configurator): per-line lot pricing (derive unit price, keep qty)
This commit is contained in:
@@ -44,3 +44,13 @@ class TestChargeTaxLot(TransactionCase):
|
||||
self.assertEqual(wiz.total_subtotal, 50.0)
|
||||
self.assertAlmostEqual(wiz.total_tax, 19.5, places=2)
|
||||
self.assertAlmostEqual(wiz.total_amount, 169.5, places=2)
|
||||
|
||||
# ----- Task 4: lot pricing -----
|
||||
def test_lot_onchange_derives_unit_price(self):
|
||||
wiz = self._make_wizard()
|
||||
line = self.env['fp.direct.order.line'].new({
|
||||
'wizard_id': wiz.id, 'quantity': 500, 'lot_total': 1000.0,
|
||||
'is_lot_priced': True,
|
||||
})
|
||||
line._onchange_lot_pricing()
|
||||
self.assertEqual(line.unit_price, 2.0)
|
||||
|
||||
Reference in New Issue
Block a user