工艺外协代码

This commit is contained in:
liaodanlong
2025-05-07 11:00:32 +08:00
parent 0863238819
commit efc4ae31c9
9 changed files with 50 additions and 6 deletions

View File

@@ -119,7 +119,7 @@ class PurchaseOrder(models.Model):
total_qty = sum(quants.mapped('quantity')) # 计算该位置的总库存量
is_available = total_qty > 0
if not is_available:
continue
raise UserError('请先完成坯料入库')
for production_id in productions:
work_ids = production_id.workorder_ids.filtered(
lambda wk: wk.state not in ['done', 'rework', 'cancel'])