Test actual quantity against None for processed quantity in Blanket Agreement

Closes #13865
This commit is contained in:
Maxime Richez
2025-02-11 13:32:57 +01:00
parent 96de1ae302
commit 76cdf889a2
4 changed files with 16 additions and 8 deletions
+4 -1
View File
@@ -359,8 +359,11 @@ class LineBlanketAgreement(metaclass=PoolMeta):
quantity = super().quantity_for_blanket_agreement(line, round=round)
if (self.secondary_unit
and self.secondary_unit.category == line.unit.category):
purchase_line_quantity = (
self.actual_quantity if self.actual_quantity is not None
else self.quantity)
quantity = Uom.compute_qty(
self.unit, (self.actual_quantity or self.quantity), line.unit,
self.unit, purchase_line_quantity, line.unit,
factor=self.secondary_uom_factor,
rate=self.secondary_uom_rate,
round=round)