坯料自加工的切割工序状态也判断了编程状态

This commit is contained in:
mgw
2025-02-26 09:09:26 +08:00
parent e2e9637dbf
commit def9bd2c6e
3 changed files with 25 additions and 4 deletions

View File

@@ -265,6 +265,23 @@ class MrpProduction(models.Model):
part_name = fields.Char(string='零件名称', related='product_id.part_name', readonly=True)
# 判断制造的产品类型
production_product_type = fields.Selection([
('成品', '成品'),
('坯料', '坯料'),
('其他', '其他')
], string='产品类型', default='成品')
@api.onchange('product_id')
def onchange_product_id(self):
for record in self:
if record.product_id.categ_id.type == '成品':
record.production_product_type = '成品'
elif record.product_id.categ_id.type == '坯料':
record.production_product_type = '坯料'
else:
record.production_product_type = '其他'
@api.depends('product_id.manual_quotation')
def _compute_manual_quotation(self):
for item in self:

View File

@@ -1210,6 +1210,7 @@ class ResMrpWorkOrder(models.Model):
# ================= 如果制造订单制造类型为【人工线下加工】==========================
if (workorder.production_id.production_type == '人工线下加工'
and workorder.production_id.schedule_state == '已排'
and workorder.routing_type == '人工线下加工'
and len(workorder.production_id.picking_ids.filtered(
lambda w: w.state not in ['done', 'cancel'])) == 0
and workorder.production_id.programming_state == '已编程'):