Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化
This commit is contained in:
@@ -11,8 +11,8 @@ access_sf_machine_control_system,sf_machine_control_system,model_sf_machine_cont
|
|||||||
access_sf_machine_control_system_admin,sf_machine_control_system_admin,model_sf_machine_control_system,base.group_system,1,1,1,0
|
access_sf_machine_control_system_admin,sf_machine_control_system_admin,model_sf_machine_control_system,base.group_system,1,1,1,0
|
||||||
access_sf_production_process_group_sale_director,sf_production_process_group_sale_director,model_sf_production_process,sf_base.group_sale_director,1,0,0,0
|
access_sf_production_process_group_sale_director,sf_production_process_group_sale_director,model_sf_production_process,sf_base.group_sale_director,1,0,0,0
|
||||||
access_sf_production_process_group_sale_salemanager,sf_production_process_group_sale_salemanager,model_sf_production_process,sf_base.group_sale_salemanager,1,0,0,0
|
access_sf_production_process_group_sale_salemanager,sf_production_process_group_sale_salemanager,model_sf_production_process,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
access_res_partner_category_group_sale_salemanager,res_partner_category_group_sale_salemanager,base.model_res_partner_category,sf_base.group_sale_salemanager,1,0,1,0
|
access_res_partner_category_group_sale_salemanager,res_partner_category_group_sale_salemanager,base.model_res_partner_category,sf_base.group_sale_salemanager,1,1,1,0
|
||||||
access_res_partner_category_group_sale_director,res_partner_category_group_sale_director,base.model_res_partner_category,sf_base.group_sale_director,1,0,1,0
|
access_res_partner_category_group_sale_director,res_partner_category_group_sale_director,base.model_res_partner_category,sf_base.group_sale_director,1,1,1,0
|
||||||
access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,0
|
access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,0
|
||||||
access_sf_production_process_admin,sf_production_process_admin,model_sf_production_process,base.group_system,1,1,1,0
|
access_sf_production_process_admin,sf_production_process_admin,model_sf_production_process,base.group_system,1,1,1,0
|
||||||
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,0
|
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,0
|
||||||
|
|||||||
|
@@ -27,6 +27,7 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='production_id']" position="before">
|
<xpath expr="//field[@name='production_id']" position="before">
|
||||||
<field name="product_tmpl_name"/>
|
<field name="product_tmpl_name"/>
|
||||||
|
<field name="rfid_code"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -318,15 +318,15 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
[('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', 'CNC加工')])
|
[('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', 'CNC加工')])
|
||||||
if workorder:
|
if workorder:
|
||||||
for item in workorder.cmm_ids:
|
for item in workorder.cmm_ids:
|
||||||
if item.program_date is not False:
|
if item.program_create_date is not False:
|
||||||
program_date = item.program_date.strftime("%Y-%m-%d %H:%M:%S")
|
program_create_date = item.program_create_date.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
program_date_str = request.env['sf.sync.common'].sudo().get_add_time(program_date)
|
program_date_str = request.env['sf.sync.common'].sudo().get_add_time(program_create_date)
|
||||||
res['Datas'].append({
|
res['Datas'].append({
|
||||||
'CraftId': workorder.id,
|
'CraftId': workorder.id,
|
||||||
'CraftKey': workorder.name,
|
'CraftKey': workorder.name,
|
||||||
'ProgramDate': '' if not item.program_date else program_date_str,
|
'ProgramDate': '' if not item.program_create_date else program_date_str,
|
||||||
'ProgramPath': item.program_path,
|
'ProgramPath': item.program_path,
|
||||||
'PostProcessing': item.post_processing_name,
|
'PostProcessing': item.program_name,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '暂无工单及对应的CNC程序数据'}
|
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '暂无工单及对应的CNC程序数据'}
|
||||||
|
|||||||
@@ -227,9 +227,6 @@
|
|||||||
<!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> -->
|
<!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> -->
|
||||||
<!-- <field name="functional_fixture_type_id" -->
|
<!-- <field name="functional_fixture_type_id" -->
|
||||||
<!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> -->
|
<!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> -->
|
||||||
<field name="rfid_code" force_save="1" readonly="1" cache="True"
|
|
||||||
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
|
||||||
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
|
||||||
</group>
|
</group>
|
||||||
<!-- <group>-->
|
<!-- <group>-->
|
||||||
<!-- <div>-->
|
<!-- <div>-->
|
||||||
|
|||||||
@@ -28,15 +28,11 @@ class FtpController():
|
|||||||
logging.info("dirname:%s" % os.path.dirname(path))
|
logging.info("dirname:%s" % os.path.dirname(path))
|
||||||
directories = os.path.normpath(path).split(os.path.sep)
|
directories = os.path.normpath(path).split(os.path.sep)
|
||||||
# 切换到上级目录
|
# 切换到上级目录
|
||||||
current_dir = '/'
|
|
||||||
for directory in directories:
|
for directory in directories:
|
||||||
if directory:
|
if directory:
|
||||||
# 检查目录是否存在
|
# 检查目录是否存在
|
||||||
if (directory in ['NC']) or (directory not in ['home', 'ftp', 'ftp_root', 'NC']):
|
if (directory in ['NC']) or (directory not in ['home', 'ftp', 'ftp_root', 'NC']):
|
||||||
self.ftp.cwd(directory)
|
self.ftp.cwd(directory)
|
||||||
if directory not in ['home', 'ftp', 'ftp_root', 'NC']:
|
|
||||||
# 切换到新的目录
|
|
||||||
self.ftp.cwd(directory)
|
|
||||||
return os.path.basename(path)
|
return os.path.basename(path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error checking file: {e}")
|
logging.error(f"Error checking file: {e}")
|
||||||
@@ -69,6 +65,9 @@ class FtpController():
|
|||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
finally:
|
||||||
|
self.ftp.quit()
|
||||||
|
logging.info("ftp已关闭")
|
||||||
|
|
||||||
# # 检测字符串的编码
|
# # 检测字符串的编码
|
||||||
# def detect_encoding(self, s):
|
# def detect_encoding(self, s):
|
||||||
|
|||||||
Reference in New Issue
Block a user