Accept Merge Request #873: (feature/修复质检接口 -> develop)
Merge Request: 修复质检接口和产品页面相关模型的访问权限 Created By: @杨金灵 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/873?initial=true
This commit is contained in:
@@ -37,7 +37,6 @@ access_sf_cutting_tool_type_admin,sf_cutting_tool_type_admin,model_sf_cutting_to
|
||||
access_sf_cutting_tool_type_group_purchase_director,sf_cutting_tool_type_group_purchase_director,model_sf_cutting_tool_type,sf_base.group_purchase_director,1,1,0,0
|
||||
access_sf_cutting_tool_type_group_sale_director,sf_cutting_tool_type_group_sale_director,model_sf_cutting_tool_type,sf_base.group_sale_director,1,1,0,0
|
||||
access_sf_cutting_tool_type_group_plan_director,sf_cutting_tool_type_group_plan_director,model_sf_cutting_tool_type,sf_base.group_plan_director,1,1,0,0
|
||||
|
||||
access_sf_functional_cutting_tool,sf_functional_cutting_tool,model_sf_functional_cutting_tool,base.group_user,1,1,1,0
|
||||
access_sf_functional_cutting_tool_admin,sf_functional_cutting_tool_admin,model_sf_functional_cutting_tool,base.group_system,1,1,1,0
|
||||
access_sf_functional_cutting_tool_model,sf_functional_cutting_tool_model,model_sf_functional_cutting_tool_model,base.group_user,1,1,1,0
|
||||
@@ -117,47 +116,35 @@ access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,s
|
||||
access_sf_sync_common,sf_sync_common,model_sf_sync_common,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_international_standards,sf_international_standards,model_sf_international_standards,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_material_apply,material_apply,model_material_apply,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
|
||||
access_sf_cutting_tool_standard_library_group_sf_mrp_user,sf_cutting_tool_standard_library_group_sf_mrp_user,model_sf_cutting_tool_standard_library,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_tool_standard_library_group_purchase_director,sf_cutting_tool_standard_library_group_purchase_director,model_sf_cutting_tool_standard_library,sf_base.group_purchase_director,1,0,1,0
|
||||
access_sf_cutting_tool_standard_library_group_plan_director,sf_cutting_tool_standard_library_group_plan_director,model_sf_cutting_tool_standard_library,sf_base.group_plan_director,1,0,1,0
|
||||
access_sf_cutting_tool_standard_library_group_sale_director,sf_cutting_tool_standard_library_group_sale_director,model_sf_cutting_tool_standard_library,sf_base.group_sale_director,1,0,1,0
|
||||
|
||||
access_sf_tool_groups,sf_tool_groups,model_sf_tool_groups,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_tool_materials_basic_parameters_group_sale_director,sf_tool_materials_basic_parameters_group_sale_director,model_sf_tool_materials_basic_parameters,sf_base.group_sale_director,1,0,1,0
|
||||
access_sf_tool_materials_basic_parameters_group_plan_director,sf_tool_materials_basic_parameters_group_plan_director,model_sf_tool_materials_basic_parameters,sf_base.group_plan_director,1,0,1,0
|
||||
access_sf_tool_materials_basic_parameters_group_purchase_director,sf_tool_materials_basic_parameters_group_purchase_director,model_sf_tool_materials_basic_parameters,sf_base.group_purchase_director,1,0,1,0
|
||||
|
||||
access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_speed_group_purchase,sf_cutting_speed_group_purchase,model_sf_cutting_speed,sf_base.group_purchase,1,0,0,0
|
||||
access_sf_cutting_speed_group_sale_salemanager,sf_cutting_speed_group_sale_salemanager,model_sf_cutting_speed,sf_base.group_sale_salemanager,1,0,0,0
|
||||
|
||||
|
||||
access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_feed_per_tooth_group_purchase,sf_feed_per_tooth_group_purchase,model_sf_feed_per_tooth,sf_base.group_purchase,1,0,0,0
|
||||
access_sf_ramping_angle,sf_ramping_angle,model_sf_ramping_angle,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_ramping_angle_group_purchase,sf_ramping_angle_group_purchase,model_sf_ramping_angle,sf_base.group_purchase,1,0,0,0
|
||||
access_sf_cutting_width_depth,sf_cutting_width_depth,model_sf_cutting_width_depth,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_width_depth_group_purchase,sf_cutting_width_depth_group_purchase,model_sf_cutting_width_depth,sf_base.group_purchase,1,0,0,0
|
||||
|
||||
access_maintenance_equipment_image,maintenance_equipment_image,model_maintenance_equipment_image,base.group_user,1,1,1,1
|
||||
access_purchase_order_group_purchase,access_purchase_order_group_purchase,purchase.model_purchase_order,sf_base.group_purchase,1,1,1,0
|
||||
access_purchase_order_group_purchase_director,access_purchase_order_group_purchase_director,purchase.model_purchase_order,sf_base.group_purchase_director,1,1,1,0
|
||||
access_purchase_order_line_group_purchase,access_purchase_order_line_group_purchase,purchase.model_purchase_order_line,sf_base.group_purchase,1,1,1,0
|
||||
access_purchase_order_line_group_purchase_director,access_purchase_order_line_group_purchase_director,purchase.model_purchase_order_line,sf_base.group_purchase_director,1,1,1,0
|
||||
access_spindle_taper_type,spindle_taper_type,model_spindle_taper_type,base.group_user,1,1,1,1
|
||||
|
||||
access_sf_tool_groups_group_plan_dispatch,sf_tool_groups,model_sf_tool_groups,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_tool_groups_group_sf_tool_user,sf_tool_groups,model_sf_tool_groups,sf_base.group_sf_tool_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
access_purchase_order,purchase.order,purchase.model_purchase_order,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_res_partner,res.partner,base.model_res_partner,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_purchase_order_line,purchase.order.line,purchase.model_purchase_order_line,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_account_move_line,account.move.line,account.model_account_move_line,sf_base.group_plan_dispatch,1,0,0,0
|
||||
|
||||
|
||||
access_sf_machine_tool,sf_machine_tool,model_sf_machine_tool,sf_base.group_sf_mrp_user,1,1,0,0
|
||||
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,sf_base.group_sf_mrp_user,1,1,0,0
|
||||
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,sf_base.group_sf_mrp_user,1,1,0,0
|
||||
@@ -180,10 +167,18 @@ access_sf_fixture_material,sf_fixture_material,model_sf_fixture_material,sf_base
|
||||
access_sf_fixture_materials_basic_parameters,sf_fixture_materials_basic_parameters,model_sf_fixture_materials_basic_parameters,sf_base.group_sf_mrp_user,1,1,0,0
|
||||
access_mrp_production_group_sale_salemanager,mrp_production_group_sale_salemanager,mrp.model_mrp_production,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_mrp_production_group_sale_director,mrp_production_group_sale_director,mrp.model_mrp_production,sf_base.group_sale_director,1,0,0,0
|
||||
|
||||
|
||||
access_material_apply_group_plan_dispatch,material_apply,model_material_apply,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_machine_brand_tags_group_plan_dispatch,sf_machine_brand_tags,model_sf_machine_brand_tags,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_ir_actions_act_window_group_plan_dispatch,ir.actions.act_window,base.model_ir_actions_act_window,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_ir_actions_act_window_view_group_plan_dispatch,ir.actions.act_window.view,base.model_ir_actions_act_window_view,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_supplier_sort_group_plan_dispatch,sf.supplier.sort,model_sf_supplier_sort,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_international_standards_group_sale_salemanager,sf_international_standards_group_sale_salemanager,model_sf_international_standards,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_sf_international_standards_group_sale_director,sf_international_standards_group_sale_director,model_sf_international_standards,sf_base.group_sale_director,1,0,0,0
|
||||
access_sf_international_standards_group_plan_director,sf_international_standards_group_plan_director,model_sf_international_standards,sf_base.group_plan_director,1,0,0,0
|
||||
access_sf_international_standards_group_purchase,sf_international_standards_group_purchase,model_sf_international_standards,sf_base.group_purchase,1,0,0,0
|
||||
access_sf_international_standards_group_purchase_director,sf_international_standards_group_purchase_director,model_sf_international_standards,sf_base.group_purchase_director,1,0,0,0
|
||||
access_sf_machine_brand_tags_group_sale_salemanager,sf_machine_brand_tags_group_sale_salemanager,model_sf_machine_brand_tags,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_sf_machine_brand_tags_group_sale_director,sf_machine_brand_tags_group_sale_director,model_sf_machine_brand_tags,sf_base.group_sale_director,1,0,0,0
|
||||
access_sf_machine_brand_tags_group_plan_director,sf_machine_brand_tags_group_plan_director,model_sf_machine_brand_tags,sf_base.group_plan_director,1,0,0,0
|
||||
access_sf_machine_brand_tags_group_purchase,sf_machine_brand_tags_group_purchase,model_sf_machine_brand_tags,sf_base.group_purchase,1,0,0,0
|
||||
access_sf_machine_brand_tags_group_purchase_director,sf_machine_brand_tags_group_purchase_director,model_sf_machine_brand_tags,sf_base.group_purchase_director,1,0,0,0
|
||||
|
||||
|
@@ -16,7 +16,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
:return:
|
||||
"""
|
||||
res = {'status': 1, 'factory_order_no': ''}
|
||||
logging.info('get_bfm_process_order_list:%s' % kw)
|
||||
logging.info('get_bfm_process_order_list:%s' % kw['order_number'])
|
||||
try:
|
||||
product_id = request.env.ref('sf_dlm.product_template_sf').sudo()
|
||||
self_machining_id = request.env.ref('sf_dlm.product_embryo_sf_self_machining').sudo()
|
||||
@@ -157,4 +157,3 @@ class jdElcp(http.Controller):
|
||||
if aa:
|
||||
aa.schedule_status = 'received'
|
||||
return json.dumps({'statusCode': 200, 'statusMessage': '修改成功'}, ensure_ascii=False)
|
||||
|
||||
|
||||
@@ -17,31 +17,32 @@
|
||||
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('model_file', '=', False)]}"/>
|
||||
<field name='cutting_tool_type' invisible="1"/>
|
||||
<field name="fixture_material_type" invisible="1"/>
|
||||
<field name="embryo_model_type_id" string="模型类型"
|
||||
<field name="embryo_model_type_id" string="模型类型" options="{'no_create': True}"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '坯料'),('categ_type', '=', False)],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="materials_id" string="材料" placeholder="请选择"
|
||||
<field name="materials_id" string="材料" placeholder="请选择" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="materials_type_id" string="型号" placeholder="请选择"
|
||||
<field name="materials_type_id" string="型号" placeholder="请选择" options="{'no_create': True}"
|
||||
domain="[('materials_id', '=', materials_id)]"
|
||||
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="server_product_process_parameters_id" string="表面工艺参数"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
||||
<field name="cutting_tool_material_id"
|
||||
<field name="cutting_tool_material_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('id', '!=', False)]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="cutting_tool_model_id" placeholder="请选择"
|
||||
<field name="cutting_tool_model_id" placeholder="请选择" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('id', '!=', False)]}"
|
||||
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
||||
<field name="specification_id" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('id', '!=', False)]}"
|
||||
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
||||
placeholder="请选择" options="{'no_create': True}"/>
|
||||
<field name="fixture_model_id" string="型号" placeholder="请选择" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '夹具')],'required': [('categ_type', '=', '夹具')]}"
|
||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||
<field name="specification_fixture_id" string="规格" placeholder="请选择"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
domain="[('fixture_model_id','=',fixture_model_id)]"/>
|
||||
</field>
|
||||
|
||||
@@ -631,13 +631,14 @@ class ResMrpWorkOrder(models.Model):
|
||||
# 将FTP的检测报告文件下载到临时目录
|
||||
def download_reportfile_tmp(self, workorder, reportpath):
|
||||
logging.info('reportpath:%s' % reportpath)
|
||||
production_no = reportpath.split('/')
|
||||
production_no_ftp = reportpath.split('/')
|
||||
production_no = workorder.production_id.name.replace('/', '_')
|
||||
# ftp地址
|
||||
remotepath = os.path.join('/', production_no[1], 'detection')
|
||||
remotepath = os.path.join('/', production_no_ftp[1], 'detection')
|
||||
logging.info('ftp地址:%s' % remotepath)
|
||||
if remotepath in reportpath:
|
||||
if reportpath.find(production_no) != -1:
|
||||
# 服务器内临时地址
|
||||
serverdir = os.path.join('/tmp', production_no, 'detection')
|
||||
serverdir = os.path.join('/tmp', production_no_ftp[1], 'detection')
|
||||
ftp_resconfig = self.env['res.config.settings'].get_values()
|
||||
ftp = FtpController(str(ftp_resconfig['ftp_host']), int(ftp_resconfig['ftp_port']),
|
||||
ftp_resconfig['ftp_user'],
|
||||
@@ -650,13 +651,16 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# 根据中控系统提供的检测文件地址去ftp里对应的制造订单里获取
|
||||
def get_detection_file(self, workorder, reportPath):
|
||||
serverdir = os.path.join('/tmp', reportPath).replace('//', '/')
|
||||
if reportPath.startswith('/'):
|
||||
reportPath = reportPath[1:]
|
||||
serverdir = os.path.join('/tmp', reportPath)
|
||||
logging.info('get_detection_file-serverdir:%s' % serverdir)
|
||||
for root, dirs, files in os.walk(serverdir):
|
||||
for f in files:
|
||||
if f in reportPath:
|
||||
workorder.detection_report = base64.b64encode(
|
||||
open(serverdir, 'rb').read())
|
||||
for filename in files:
|
||||
if filename == os.path.basename(reportPath):
|
||||
report_file_path = os.path.join(root, filename)
|
||||
logging.info('get_detection_file-report_file_path:%s' % report_file_path)
|
||||
workorder.detection_report = base64.b64encode(open(report_file_path, 'rb').read())
|
||||
return True
|
||||
|
||||
|
||||
|
||||
@@ -49,16 +49,16 @@ class FtpController():
|
||||
target_dir1 = target_dir.split('/')
|
||||
logging.info('目录1:%s' % target_dir1[1])
|
||||
self.ftp.cwd(target_dir1[1]) # 切换工作路径
|
||||
logging.info('目录2:%s' % target_dir[2])
|
||||
self.ftp.cwd(target_dir[2]) # 切换工作路径
|
||||
logging.info('目录2:%s' % target_dir1[2])
|
||||
self.ftp.cwd(target_dir1[2]) # 切换工作路径
|
||||
remotenames = self.ftp.nlst()
|
||||
logging.info('FTP目录检测报告文件:%s' % remotenames)
|
||||
for file in remotenames:
|
||||
server = os.path.join(serverdir, file)
|
||||
if file.find(reportpath) != -1:
|
||||
logging.info('server' % server)
|
||||
self.download_file(server, file)
|
||||
return 1
|
||||
for filename in remotenames:
|
||||
if os.path.basename(filename) == os.path.basename(reportpath):
|
||||
server = os.path.join(serverdir, filename)
|
||||
logging.info('server%s' % server)
|
||||
self.download_file(server, filename)
|
||||
return 1
|
||||
except Exception:
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user