Correction cron faircot

This commit is contained in:
2026-04-21 14:33:12 +02:00
parent 280cff5fdb
commit 4013f9d74c
3 changed files with 37 additions and 24 deletions

View File

@@ -258,6 +258,17 @@ class PurchaseTradeTestCase(ModuleTestCase):
line.compute_unit_price(),
Decimal('123.45'))
def test_sale_line_linked_unit_factor_keeps_currency_factor_without_product(self):
'linked price conversion does not crash when automation builds a sale line before setting product'
SaleLine = Pool().get('sale.line')
line = SaleLine()
line.enable_linked_currency = True
line.linked_currency = Mock(factor=Decimal('2'))
line.linked_unit = Mock()
line.unit = None
self.assertEqual(line._get_linked_unit_factor(), Decimal('2'))
def test_purchase_line_default_pricing_rule_comes_from_configuration(self):
'purchase line pricing_rule defaults to the purchase_trade singleton value'
PurchaseLine = Pool().get('purchase.line')