mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract: Automatic prices for lines
This commit is contained in:
committed by
Christopher Rogos
parent
f066755e49
commit
52e822f80a
@@ -59,6 +59,20 @@ class TestContract(TestContractBase):
|
||||
with self.assertRaises(ValidationError):
|
||||
self.acct_line.write({'discount': 120})
|
||||
|
||||
def test_automatic_price(self):
|
||||
self.acct_line.automatic_price = True
|
||||
self.product.list_price = 1100
|
||||
self.assertEqual(self.acct_line.price_unit, 1100)
|
||||
# Try to write other price
|
||||
self.acct_line.price_unit = 10
|
||||
self.acct_line.refresh()
|
||||
self.assertEqual(self.acct_line.price_unit, 1100)
|
||||
# Now disable automatic price
|
||||
self.acct_line.automatic_price = False
|
||||
self.acct_line.price_unit = 10
|
||||
self.acct_line.refresh()
|
||||
self.assertEqual(self.acct_line.price_unit, 10)
|
||||
|
||||
def test_contract(self):
|
||||
self.assertAlmostEqual(self.acct_line.price_subtotal, 50.0)
|
||||
res = self.acct_line._onchange_product_id()
|
||||
|
||||
Reference in New Issue
Block a user