Faircot cron

This commit is contained in:
2026-07-19 19:30:28 +02:00
parent b2bd777ec8
commit facd627f5e
5 changed files with 41 additions and 3 deletions

View File

@@ -9223,6 +9223,26 @@ description</t></is></c>
patch.object(lot_module.LotQt, 'search', return_value=[]):
lot_module.LotQt.match_lots([purchase_lot], [])
def test_physical_lot_tolerance_warning_can_be_skipped_by_context(self):
'physical lot tolerance warning can be skipped for automation cron'
line = Mock(
purchase=Mock(number='P-1'),
sale=None,
id=12,
quantity_theorical=Decimal('100'),
tol_max=Decimal('0'),
inherit_tol=False,
unit=None,
lots=[],
)
lqt = Mock(lot_p=Mock(line=line), lot_s=None)
physical_lot = Mock(lot_quantity=Decimal('120'), lot_unit_line=None)
with Transaction().set_context(
_purchase_trade_skip_physical_lot_tolerance_warning=True):
lot_module.LotQt._warn_physical_lot_tolerance(
lqt, [physical_lot])
def test_lot_matching_gauge_uses_entered_quantity_to_match(self):
'go to matching gauge projects tolerance from qt to match'
matching_lot = lot_module.LotMatchingLot()