表面工艺采购单确认订单进行限制

This commit is contained in:
liaodanlong
2024-12-31 17:08:38 +08:00
parent 37476bcc88
commit 701decb38f
3 changed files with 19 additions and 123 deletions

View File

@@ -50,12 +50,6 @@ class PurchaseOrder(models.Model):
for workorder in workorders:
if workorder.routing_type == '表面工艺' and workorder.is_subcontract is True:
move_out = workorder.move_subcontract_workorder_ids[1]
# move_out = self.env['stock.move'].search(
# [('location_id', '=', self.env['stock.location'].search(
# [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
# ('location_dest_id', '=', self.env['stock.location'].search(
# [('barcode', 'ilike', 'VL-SPOC')]).id),
# ('origin', '=', self.production_id.name), ('state', 'not in', ['cancel', 'done'])])
for mo in move_out:
if mo.state != 'done':
mo.write({'state': 'assigned', 'production_id': False})