确认接收时,将不追溯的产品的完成数量自动填上

This commit is contained in:
胡尧
2025-05-09 13:43:10 +08:00
parent 18ae46207a
commit bfff4ac440

View File

@@ -96,8 +96,12 @@ class PurchaseOrder(models.Model):
# 'origin': record.name + ',' + replenish.origin,
# })
# replenish.action_replenish()
return super(PurchaseOrder, self).button_confirm()
res = super(PurchaseOrder, self).button_confirm()
for line in self.order_line:
# 将产品不追踪序列号的行项目设置qty_done
if line.move_ids[0].product_id.tracking == 'none':
line.move_ids[0].quantity_done = line.move_ids[0].product_qty
return res
origin_sale_id = fields.Many2one('sale.order', string='销售订单号', store=True, compute='_compute_origin_sale_id')