Skip to content

Commit 53dcba6

Browse files
committed
[IMP] consider forced qty in when preparing stock move creation values
1 parent 3f19eda commit 53dcba6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

s6r_purchase_received_forced_qty/models/purchase_order_line.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,12 @@ def _compute_qty_received(self):
1717
for line in self:
1818
line.qty_received += line.qty_received_forced
1919
return
20+
21+
# when stock moves are created, quantity is computed from already existing stock moves
22+
# so we need to adjust this quantity depending on the qty_received_forced field.
23+
def _get_qty_procurement(self):
24+
qty = super()._get_qty_procurement()
25+
26+
if self.qty_received_forced:
27+
qty += self.qty_received_forced
28+
return qty

0 commit comments

Comments
 (0)