mrs为名的更改为sf

This commit is contained in:
jinling.yang
2022-11-22 10:20:18 +08:00
parent bf5f8fd326
commit 3cbd1140bb
8 changed files with 20 additions and 20 deletions

View File

@@ -13,16 +13,16 @@ class Common(models.Model):
def get_headers(self,token,mrs_secret_key): def get_headers(self,token, secret_key):
''' '''
获取requests中的heardes参数 获取requests中的heardes参数
''' '''
timestamp = int(time.time()) timestamp = int(time.time())
check_str = '%s%s%s' % (token, timestamp, mrs_secret_key) check_str = '%s%s%s' % (token, timestamp, secret_key)
check_mrs_str = hashlib.sha1(check_str.encode('utf-8')).hexdigest() check_sf_str = hashlib.sha1(check_str.encode('utf-8')).hexdigest()
headers = {'TOKEN': token, headers = {'TOKEN': token,
'TIMESTAMP': str(timestamp), 'TIMESTAMP': str(timestamp),
'checkstr': check_mrs_str} 'checkstr': check_sf_str}
return headers return headers

View File

@@ -66,7 +66,7 @@ class MrsProcessingOrder(models.Model):
processing_technology_ids = fields.Many2many('sf.processing.technology', 'sf_associated_processes', processing_technology_ids = fields.Many2many('sf.processing.technology', 'sf_associated_processes',
index=True, string='加工工艺') index=True, string='加工工艺')
production_process_id = fields.Many2one('mrs.production.process', string="表面工艺") production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
class Tray(models.Model): class Tray(models.Model):

View File

@@ -12,7 +12,7 @@
'website': 'https://www.sf.jikimo.com', 'website': 'https://www.sf.jikimo.com',
'depends': ['product', 'base'], 'depends': ['product', 'base'],
'data': [ 'data': [
# 'data/product_data.xml', 'data/product_data.xml',
'views/product_template_view.xml' 'views/product_template_view.xml'
], ],
'demo': [ 'demo': [

View File

@@ -49,9 +49,9 @@ class ResProductTemplate(models.Model):
[('materials_no', '=', item['texture_code'])]).id, [('materials_no', '=', item['texture_code'])]).id,
'materials_type_id': self.env['sf.materials.model'].search( 'materials_type_id': self.env['sf.materials.model'].search(
[('materials_no', '=', item['texture_type_code'])]).id, [('materials_no', '=', item['texture_type_code'])]).id,
# 'model_surface_process_id': self.env['mrs.production.process'].search( # 'model_surface_process_id': self.env['sf.production.process'].search(
# [('process_encode', '=', item['surface_process_code'])]).id, # [('process_encode', '=', item['surface_process_code'])]).id,
# 'model_process_parameters_id': self.env['mrs.processing.technology'].search( # 'model_process_parameters_id': self.env['sf.processing.technology'].search(
# [('process_encode', '=', item['process_parameters_code'])]).id, # [('process_encode', '=', item['process_parameters_code'])]).id,
'model_remark': item['remark'], 'model_remark': item['remark'],
'default_code': '%s-%s' % (order_number, i), 'default_code': '%s-%s' % (order_number, i),

View File

@@ -6,11 +6,11 @@
<field name="model">product.template</field> <field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/> <field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="invoice_policy" position="after"> <!-- <field name="invoice_policy" position="after">-->
<field name="materials_id" string="材料"/> <!-- <field name="materials_id" string="材料"/>-->
<field name="materials_type_id" string="型号" <!-- <field name="materials_type_id" string="型号"-->
domain="[('materials_id', '=', materials_id)]"/> <!-- domain="[('materials_id', '=', materials_id)]"/>-->
</field> <!-- </field>-->
<xpath expr="//label[@for='volume']" position="before"> <xpath expr="//label[@for='volume']" position="before">
<label for="long" string="尺寸" <label for="long" string="尺寸"

View File

@@ -5,7 +5,7 @@ from odoo.addons.resource.models.resource import Intervals
class ResWorkcenter(models.Model): class ResWorkcenter(models.Model):
_inherit = "mrp.workcenter" _inherit = "mrp.workcenter"
machine_tool_id = fields.Many2one('mrs.machine_tool', '机床') machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
equipment_ids = fields.One2many( equipment_ids = fields.One2many(
'maintenance.equipment', 'workcenter_id', string="Maintenance Equipment", 'maintenance.equipment', 'workcenter_id', string="Maintenance Equipment",
@@ -13,7 +13,7 @@ class ResWorkcenter(models.Model):
def action_work_order(self): def action_work_order(self):
if not self.env.context.get('desktop_list_view', False): if not self.env.context.get('desktop_list_view', False):
action = self.env["ir.actions.actions"]._for_xml_id("sf_route_workcenter.mrp_workorder_action_tablet") action = self.env["ir.actions.actions"]._for_xml_id("sf_manufacturing.mrp_workorder_action_tablet")
return action return action
else: else:
return super(MrpWorkcenter, self).action_work_order() return super(MrpWorkcenter, self).action_work_order()

View File

@@ -199,9 +199,9 @@ class ResMrpWorkOrder(models.Model):
def fetchCNC(self): def fetchCNC(self):
res = [{'model_code': self.product_id.barcode, 'production_no': self.production_id.name, res = [{'model_code': self.product_id.barcode, 'production_no': self.production_id.name,
'machine_tool_code': self.workcenter_id.machine_tool_id.code, 'machine_tool_code': self.workcenter_id.machine_tool_id.code,
'material_code': self.env['mrs.production.materials'].search( 'material_code': self.env['sf.production.materials'].search(
[('id', '=', self.product_id.materials_id.id)]).materials_no, [('id', '=', self.product_id.materials_id.id)]).materials_no,
'material_type_code': self.env['mrs.materials.model'].search( 'material_type_code': self.env['sf.materials.model'].search(
[('id', '=', self.product_id.materials_type_id.id)]).materials_no, [('id', '=', self.product_id.materials_type_id.id)]).materials_no,
'embryo_long': self.product_id.bom_ids.bom_line_ids.product_id.long, 'embryo_long': self.product_id.bom_ids.bom_line_ids.product_id.long,
'embryo_height': self.product_id.bom_ids.bom_line_ids.product_id.height, 'embryo_height': self.product_id.bom_ids.bom_line_ids.product_id.height,
@@ -209,9 +209,9 @@ class ResMrpWorkOrder(models.Model):
# 'factory_code': self.env.user.company_id.partner_id. # 'factory_code': self.env.user.company_id.partner_id.
}] }]
configsettings = self.env['res.config.settings'].get_values() configsettings = self.env['res.config.settings'].get_values()
config_header = Common.get_headers(self, configsettings['token'], configsettings['mrs_secret_key']) config_header = Common.get_headers(self, configsettings['token'], configsettings['sf_secret_key'])
url = '/api/intelligent_programming/create' url = '/api/intelligent_programming/create'
config_url = configsettings['mrs_url'] + url config_url = configsettings['sf_url'] + url
res_str = json.dumps(res) res_str = json.dumps(res)
ret = requests.post(config_url, json={"result": res_str}, data=None, headers=config_header) ret = requests.post(config_url, json={"result": res_str}, data=None, headers=config_header)
ret = ret.json() ret = ret.json()

View File

@@ -22,6 +22,6 @@ class Sf_Mrs_Connect(http.Controller):
ret = json.loads(datas) ret = json.loads(datas)
ret = json.loads(ret['result']) ret = json.loads(ret['result'])
for obj in ret: for obj in ret:
request.env['cnc.processing'].with_user(request.env.ref("base.user_admin")).CNCprocessing_create(obj) request.env['sf.cnc.processing'].with_user(request.env.ref("base.user_admin")).CNCprocessing_create(obj)
except Exception as e: except Exception as e:
logging.info('get_cnc_processing_create error:%s' % e) logging.info('get_cnc_processing_create error:%s' % e)