Compare commits
4 Commits
feature/sy
...
release/re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76902bee9a | ||
|
|
94bcfc0543 | ||
|
|
34ecb648ef | ||
|
|
b4d31c7c4b |
@@ -114,7 +114,10 @@ class PurchaseRequestLine(models.Model):
|
||||
|
||||
def _compute_qty_to_buy(self):
|
||||
for pr in self:
|
||||
qty_to_buy = sum(pr.mapped("product_qty")) - sum(pr.mapped("qty_done")) - sum(pr.mapped("qty_in_progress"))
|
||||
qty_to_buy = sum(pr.mapped("product_qty"))
|
||||
if pr.purchase_count > 0:
|
||||
qty_to_buy -= sum(pr.mapped("purchase_lines").filtered(lambda po: po.state != 'cancel').mapped(
|
||||
"product_qty"))
|
||||
pr.qty_to_buy = qty_to_buy > 0.0
|
||||
pr.pending_qty_to_receive = qty_to_buy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user