扫码执行一键合并下发按钮已完成
This commit is contained in:
@@ -561,21 +561,48 @@ class SfWorkOrderBarcodes(models.Model):
|
||||
def on_barcode_scanned(self, barcode):
|
||||
workorder = self.env['mrp.workorder'].browse(self.ids)
|
||||
if "*" not in barcode:
|
||||
tray_code = self.env['sf.tray'].search([('code', '=', barcode)])
|
||||
self.tray_code = tray_code.code
|
||||
self.tray_id = workorder.gettray_auto(barcode)
|
||||
if self.routing_type == '装夹':
|
||||
tray_code = self.env['sf.tray'].search([('code', '=', barcode)])
|
||||
self.tray_code = tray_code.code
|
||||
self.tray_id = workorder.gettray_auto(barcode)
|
||||
elif self.routing_type == '前置三元定位检测':
|
||||
print('我是前置三元检测')
|
||||
logging.info('我是前置三元检测')
|
||||
elif self.routing_type == 'CNC加工':
|
||||
if barcode == 'UP-ALL':
|
||||
print("我是一键合并下发")
|
||||
logging.info('我是一键合并下发')
|
||||
self.up_merge_all()
|
||||
else:
|
||||
print('CNC加工')
|
||||
# print(barcode)
|
||||
# a = self.env['sf.tray'].search([('code', '=', barcode)])
|
||||
# print(a)
|
||||
# # workorder_obj = self.env['mrp.workorder'].search([('tray_code', '=', barcode)], limit=1)
|
||||
# workorder_obj = self.env['mrp.workorder'].search([('tray_code', '=', barcode)])
|
||||
# e = workorder_obj.id
|
||||
# print(workorder_obj)
|
||||
# action = {
|
||||
# 'name': '工单',
|
||||
# 'type': 'ir.actions.act_window',
|
||||
# # 'view_type': 'form',
|
||||
# 'view_mode': 'form',
|
||||
# 'res_model': 'mrp.workorder',
|
||||
# 'view_id': self.env.ref('mrp.mrp_production_workorder_form_view_inherit').id,
|
||||
# # 'res_id': workorder_obj.id,
|
||||
# 'res_id': 1023,
|
||||
# 'target': 'current',
|
||||
# # 'context': self.env.context,
|
||||
# # 'flags': {'initial_mode': 'edit'},
|
||||
# }
|
||||
# return action
|
||||
|
||||
elif self.routing_type == '后置三元质量检测':
|
||||
print('后置三元检测')
|
||||
elif self.routing_type == '解除装夹':
|
||||
print("我是解除装夹")
|
||||
else:
|
||||
pass
|
||||
|
||||
else:
|
||||
self.pro_code_ok = workorder.pro_code_is_ok(barcode)
|
||||
|
||||
|
||||
|
||||
# return {
|
||||
# 'type': 'ir.actions.act_window',
|
||||
# 'name': '工单',
|
||||
# 'res_model': 'mrp.workorder',
|
||||
# 'view_mode': 'form',
|
||||
# 'context': {'active_id': self.id},
|
||||
# # 'target': 'current',
|
||||
# }
|
||||
|
||||
|
||||
self.pro_code_ok = workorder.pro_code_is_ok(barcode)
|
||||
Reference in New Issue
Block a user