修复日计划工单接口和http
This commit is contained in:
@@ -46,7 +46,7 @@ class Http(models.AbstractModel):
|
|||||||
_logger.info('check_sf_str:%s' % check_sf_str)
|
_logger.info('check_sf_str:%s' % check_sf_str)
|
||||||
_logger.info('check_str:%s' % check_str)
|
_logger.info('check_str:%s' % check_str)
|
||||||
_logger.info('sf_secret_key:%s' % factory_secret.sf_secret_key)
|
_logger.info('sf_secret_key:%s' % factory_secret.sf_secret_key)
|
||||||
# if check_sf_str != datas['HTTP_CHECKSTR']:
|
if check_sf_str != datas['HTTP_CHECKSTR']:
|
||||||
# raise AuthenticationError('数据校验不通过')
|
raise AuthenticationError('数据校验不通过')
|
||||||
else:
|
else:
|
||||||
raise AuthenticationError('请求参数中无token')
|
raise AuthenticationError('请求参数中无token')
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
ret = json.loads(datas)
|
ret = json.loads(datas)
|
||||||
logging.info('RfidCode:%s' % ret['RfidCode'])
|
logging.info('RfidCode:%s' % ret['RfidCode'])
|
||||||
if 'RfidCode' in ret:
|
if 'RfidCode' in ret:
|
||||||
workorder = request.env['mrp.workorder'].sudo().search(
|
workorder = request.env['mrp.workorder'].sudo().search([('rfid_code', '=', ret['RfidCode'])])
|
||||||
[('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', '装夹预调')])
|
|
||||||
if workorder:
|
if workorder:
|
||||||
for item in workorder:
|
for item in workorder:
|
||||||
res['Datas'].append({
|
res['Datas'].append({
|
||||||
|
|||||||
@@ -135,6 +135,8 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
|
workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
|
||||||
is_delivery = fields.Boolean('是否配送完成', default=False)
|
is_delivery = fields.Boolean('是否配送完成', default=False)
|
||||||
rfid_code = fields.Char('RFID')
|
rfid_code = fields.Char('RFID')
|
||||||
|
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
|
||||||
|
string='生产线')
|
||||||
|
|
||||||
def get_plan_workorder(self, production_line):
|
def get_plan_workorder(self, production_line):
|
||||||
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")
|
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")
|
||||||
@@ -875,5 +877,3 @@ class CMMprogram(models.Model):
|
|||||||
post_processing_name = fields.Char('后处理名称')
|
post_processing_name = fields.Char('后处理名称')
|
||||||
program_date = fields.Datetime('程序日期')
|
program_date = fields.Datetime('程序日期')
|
||||||
workorder_id = fields.Many2one('mrp.workorder', string="工单")
|
workorder_id = fields.Many2one('mrp.workorder', string="工单")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user