修复表面工艺外协单状态
This commit is contained in:
@@ -202,6 +202,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
[("programming", "编程"), ("clamping", "返工"), ("cutter", "刀具"), ("operate computer", "操机"),
|
||||
("technology", "工艺"), ("customer redrawing", "客户改图"), ("other", "其他"), ], string="原因", tracking=True)
|
||||
detailed_reason = fields.Text('详细原因')
|
||||
|
||||
# is_send_program_again = fields.Boolean(string='是否重新下发NC程序', default=False)
|
||||
|
||||
@api.onchange('rfid_code')
|
||||
@@ -861,7 +862,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
('location_dest_id', '=', self.env['stock.location'].search(
|
||||
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||
('origin', '=', self.production_id.name)])
|
||||
purchase = self.env['purchase.order'].search([('origin', '=', self.production_id.name)])
|
||||
purchase = self.env['purchase.order'].search([('origin', 'ilike', self.production_id.name)])
|
||||
if purchase and move_out:
|
||||
move_out.write({'state': 'assigned'})
|
||||
self.env['stock.move.line'].create(move_out.get_move_line(purchase, self))
|
||||
@@ -1010,6 +1011,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
workorder.rfid_code_old = rfid_code
|
||||
workorder.rfid_code = ''
|
||||
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
|
||||
logging.info('product_qty:%s' % record.production_id.product_qty)
|
||||
for move_raw_id in record.production_id.move_raw_ids:
|
||||
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
||||
record.process_state = '已完工'
|
||||
|
||||
Reference in New Issue
Block a user