同一个销售订单的不同产品的坯料获取方式不一样,生成的采购订单问题

This commit is contained in:
liaodanlong
2025-03-13 09:49:17 +08:00
parent 5b084624df
commit 7c48e6b186

View File

@@ -1574,7 +1574,7 @@ class MrpProduction(models.Model):
vals['picking_type_id'] = picking_type_id
vals['name'] = self.env['stock.picking.type'].browse(picking_type_id).sequence_id.next_by_id()
product_id = self.env['product.product'].browse(vals['product_id'])
is_self_process = product_id.materials_type_id and product_id.materials_type_id.gain_way and product_id.materials_type_id.gain_way != '自加工'
is_self_process = product_id.materials_type_id.gain_way if product_id.materials_type_id else None
is_customer_provided = product_id.is_customer_provided
key = f"{is_self_process}_{is_customer_provided}"
if not is_custemer_group_id.get(key):