Pricing linked

This commit is contained in:
2026-06-16 15:35:12 +02:00
parent 38af948374
commit 8eba0cd066
4 changed files with 19 additions and 7 deletions

View File

@@ -2537,9 +2537,20 @@ class PurchaseTradeTestCase(ModuleTestCase):
self.assertEqual(fee.on_change_with_quantity(), Decimal('25'))
def test_fee_currency_is_required(self):
'fee currency is required for every fee mode'
self.assertTrue(fee_module.Fee.currency.required)
def test_fee_currency_is_conditionally_required_for_linked_currency(self):
'fee currency does not block linked currency draft saves'
self.assertFalse(fee_module.Fee.currency.required)
self.assertIn('required', fee_module.Fee.currency.states)
self.assertEqual(
fee_module.Fee.currency.states['required'],
~Eval('enable_linked_currency'))
for field in (
fee_module.Fee.linked_price,
fee_module.Fee.linked_currency,
fee_module.Fee.linked_unit):
self.assertFalse(field.required)
self.assertNotIn('required', field.states)
def test_fee_get_non_cog_returns_zero_without_move_lines(self):
'fee non-cog amount is zero before any accounting move line exists'