1.工单新增rfid字段
2.修改中控对接的工单接口 3.快速订单材料,型号,客户修改为可选择
This commit is contained in:
@@ -21,6 +21,7 @@ class Http(models.AbstractModel):
|
|||||||
def _auth_method_sf_token(cls):
|
def _auth_method_sf_token(cls):
|
||||||
# 从headers.environ中获取对方传过来的token,timestamp,加密的校验字符串
|
# 从headers.environ中获取对方传过来的token,timestamp,加密的校验字符串
|
||||||
datas = request.httprequest.headers.environ
|
datas = request.httprequest.headers.environ
|
||||||
|
logging.info(datas)
|
||||||
if 'HTTP_TOKEN' in datas:
|
if 'HTTP_TOKEN' in datas:
|
||||||
_logger.info('token:%s' % datas['HTTP_TOKEN'])
|
_logger.info('token:%s' % datas['HTTP_TOKEN'])
|
||||||
# 查询密钥
|
# 查询密钥
|
||||||
@@ -40,6 +41,7 @@ class Http(models.AbstractModel):
|
|||||||
raise AuthenticationError('请求已过期')
|
raise AuthenticationError('请求已过期')
|
||||||
check_str = '%s%s%s' % (datas['HTTP_TOKEN'], post_time, factory_secret.sf_secret_key)
|
check_str = '%s%s%s' % (datas['HTTP_TOKEN'], post_time, factory_secret.sf_secret_key)
|
||||||
check_sf_str = hashlib.sha1(check_str.encode('utf-8')).hexdigest()
|
check_sf_str = hashlib.sha1(check_str.encode('utf-8')).hexdigest()
|
||||||
|
_logger.info('check_str:%s' % check_sf_str)
|
||||||
if check_sf_str != datas['HTTP_CHECKSTR']:
|
if check_sf_str != datas['HTTP_CHECKSTR']:
|
||||||
raise AuthenticationError('数据校验不通过')
|
raise AuthenticationError('数据校验不通过')
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
res = {'Succeed': True, 'Datas': []}
|
res = {'Succeed': True, 'Datas': []}
|
||||||
datas = request.httprequest.data
|
datas = request.httprequest.data
|
||||||
ret = json.loads(datas)
|
ret = json.loads(datas)
|
||||||
logging.info('RfidCode:%s' % ret)
|
logging.info('RfidCode:%s' % ret['RfidCode'])
|
||||||
workorder = request.env['mrp.workorder'].sudo().search(
|
workorder = request.env['mrp.workorder'].sudo().search(
|
||||||
[('production_id.name', '=', 'WH/MO/00071'), ('routing_type', '=', '装夹')])
|
[('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', '装夹预调')])
|
||||||
if workorder:
|
if workorder:
|
||||||
for item in workorder:
|
for item in workorder:
|
||||||
res['Datas'].append({
|
res['Datas'].append({
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
preset_program_information = fields.Char(string="预调程序信息")
|
preset_program_information = fields.Char(string="预调程序信息")
|
||||||
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')
|
||||||
|
|
||||||
@api.onchange('is_ok')
|
@api.onchange('is_ok')
|
||||||
def _onchange_inspection_user_id(self):
|
def _onchange_inspection_user_id(self):
|
||||||
|
|||||||
@@ -176,6 +176,8 @@
|
|||||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
<field name="functional_fixture_type_id" force_save="1"
|
<field name="functional_fixture_type_id" force_save="1"
|
||||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
|
<field name="rfid_code"
|
||||||
|
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
</group>
|
</group>
|
||||||
<group attrs='{"invisible": [("routing_type","=","获取CNC加工程序")]}'>
|
<group attrs='{"invisible": [("routing_type","=","获取CNC加工程序")]}'>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ class QuickEasyOrder(models.Model):
|
|||||||
('0.03', '±0.03mm'),
|
('0.03', '±0.03mm'),
|
||||||
('0.02', '±0.02mm'),
|
('0.02', '±0.02mm'),
|
||||||
('0.01', '±0.01mm')], string='加工精度', default='0.10')
|
('0.01', '±0.01mm')], string='加工精度', default='0.10')
|
||||||
material_id = fields.Many2one('sf.production.materials', '材料', compute='_compute_material_model', store=True)
|
material_id = fields.Many2one('sf.production.materials', '材料')
|
||||||
material_model_id = fields.Many2one('sf.materials.model', '型号', compute='_compute_material_model', store=True)
|
material_model_id = fields.Many2one('sf.materials.model', '型号')
|
||||||
# process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
# process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
||||||
parameter_ids = fields.Many2many('sf.production.process.parameter', 'process_item_order_rel', string='可选参数')
|
parameter_ids = fields.Many2many('sf.production.process.parameter', 'process_item_order_rel', string='可选参数')
|
||||||
quantity = fields.Integer('数量', default=1)
|
quantity = fields.Integer('数量', default=1)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="customer_id" readonly="1" force_save="1"/>
|
<field name="customer_id" />
|
||||||
<field name="material_id"/>
|
<field name="material_id"/>
|
||||||
<field name="material_model_id"/>
|
<field name="material_model_id"/>
|
||||||
<!-- <field name="process_id"/>-->
|
<!-- <field name="process_id"/>-->
|
||||||
|
|||||||
Reference in New Issue
Block a user