采购申请数量修改
This commit is contained in:
@@ -114,7 +114,9 @@ class PurchaseRequestLine(models.Model):
|
|||||||
|
|
||||||
def _compute_qty_to_buy(self):
|
def _compute_qty_to_buy(self):
|
||||||
for pr in 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.product_qty"))
|
||||||
pr.qty_to_buy = qty_to_buy > 0.0
|
pr.qty_to_buy = qty_to_buy > 0.0
|
||||||
pr.pending_qty_to_receive = qty_to_buy
|
pr.pending_qty_to_receive = qty_to_buy
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user