更新制造订单生成工单时的工序字段

This commit is contained in:
gqh
2022-11-17 17:27:05 +08:00
parent 4f0df9f2bd
commit 057ec915d9
23 changed files with 792 additions and 148 deletions

View File

@@ -22,11 +22,9 @@ class Sf_Bf_Connect(http.Controller):
datas = request.httprequest.data
ret = json.loads(datas)
ret = json.loads(ret['result'])
product_id = request.env.ref('sf_base.product_template_sf').sudo()
product_id = request.env.ref('sf_bpm_api.product_template_sf').sudo()
company_id = request.env.ref('base.main_company').sudo()
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(
company_id, ret['delivery_name'], ret['delivery_telephone'], ret['delivery_address'],
ret['delivery_end_date'])
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(ret['delivery_end_date'], company_id)
i = 1
for item in ret['bfm_process_order_list']:
product = request.env['product.template'].sudo().product_create(product_id, item, order_id,

View File

@@ -23,18 +23,18 @@ class Http(models.AbstractModel):
# 查询密钥
factory_secret = request.env['res.partner'].sudo().search(
[('sf_token', '=', datas['HTTP_TOKEN'])], limit=1)
# if not factory_secret:
# raise AuthenticationError('无效的token')
# timestamp_str = int(time.time())
# # 设置API接口请求时间,不能超过5秒
# deltime = datetime.timedelta(seconds=60)
# if abs(int(datas['HTTP_TIMESTAMP'])-timestamp_str) > deltime.seconds:
# raise AuthenticationError('请求已过期')
# # 获得sha1_str加密字符串
# post_time = int(datas['HTTP_TIMESTAMP'])
# 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()
# if check_sf_str != datas['HTTP_CHECKSTR']:
# raise AuthenticationError('数据校验不通过')
if not factory_secret:
raise AuthenticationError('无效的token')
timestamp_str = int(time.time())
# 设置API接口请求时间,不能超过5秒
deltime = datetime.timedelta(seconds=60)
if abs(int(datas['HTTP_TIMESTAMP'])-timestamp_str) > deltime.seconds:
raise AuthenticationError('请求已过期')
# 获得sha1_str加密字符串
post_time = int(datas['HTTP_TIMESTAMP'])
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()
if check_sf_str != datas['HTTP_CHECKSTR']:
raise AuthenticationError('数据校验不通过')
else:
raise AuthenticationError('请求参数中无token')

View File

@@ -1,6 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sf_model_type,sf_model_type,model_sf_model_type,base.group_user,1,1,1,1
access_sf_model_type_routing_sort,sf_model_type_routing_sort,model_sf_model_type_routing_sort,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_sf_model_type sf_model_type model_sf_model_type base.group_user 1 1 1 1
access_sf_model_type_routing_sort sf_model_type_routing_sort model_sf_model_type_routing_sort base.group_user 1 1 1 1
2
3
4