产品模板的型号手动输入时型号对象的编码,联装类型,夹具物料字段的值显示
This commit is contained in:
@@ -82,13 +82,13 @@ class QuickEasyOrder(models.Model):
|
||||
# 将attach的datas内容转为glb文件
|
||||
def transition_glb_file(self, report_path, model_code):
|
||||
shapes = read_step_file(report_path)
|
||||
output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
|
||||
# output_file = os.path.join('/tmp', str(model_code) + '.stl')
|
||||
#output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
|
||||
output_file = os.path.join('/tmp', str(model_code) + '.stl')
|
||||
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
# 转化为glb
|
||||
output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
|
||||
# output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
|
||||
util_path = get_resource_path('mrs_base', 'static/util')
|
||||
#output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
|
||||
output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
|
||||
util_path = get_resource_path('sf_dlm', 'static/util')
|
||||
cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
|
||||
os.system(cmd)
|
||||
# 转base64
|
||||
@@ -138,7 +138,7 @@ class QuickEasyOrder(models.Model):
|
||||
:return:
|
||||
"""
|
||||
web_base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', default='')
|
||||
logging.info("自动报价返回值: %s" % ret)
|
||||
logging.info("web_base_url: %s" % web_base_url)
|
||||
url = '/api/bfm_process_order/list'
|
||||
res = {'order_number': obj.name, 'delivery_end_date': str(datetime.now()),
|
||||
'delivery_name': 'XXXXX', 'delivery_telephone': 'XXXXX',
|
||||
@@ -153,10 +153,10 @@ class QuickEasyOrder(models.Model):
|
||||
barcode = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||
logging.info('model_file-size: %s' % len(item.model_file))
|
||||
val = {
|
||||
'model_long': 100,
|
||||
'model_width': 100,
|
||||
'model_height': 100,
|
||||
'model_volume': 300,
|
||||
'model_long': item.model_length,
|
||||
'model_width': item.model_width,
|
||||
'model_height': item.model_height,
|
||||
'model_volume': item.model_volume,
|
||||
'model_machining_precision': item.machining_precision,
|
||||
'model_name': attachment.name,
|
||||
'model_data': base64_datas,
|
||||
@@ -203,7 +203,7 @@ class QuickEasyOrder(models.Model):
|
||||
def model_coloring(self):
|
||||
url = '/api/library_of_models/create'
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
config_header = Common.get_headers(self, config['sf_token'], config['sf_key_secret'])
|
||||
config_header = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
order = self.search([('id', '=', self.id)])
|
||||
logging.info('order: %s' % order.name)
|
||||
if order:
|
||||
@@ -240,16 +240,15 @@ class QuickEasyOrder(models.Model):
|
||||
|
||||
# 自动报价
|
||||
def _get_price(self, order):
|
||||
|
||||
url = '/api/automatic_quotes'
|
||||
config = self.env['res.config.settings'].sudo().get_values()
|
||||
config_header = Common.get_headers(self, config['sf_token'], config['sf_key_secret'])
|
||||
config_header = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
logging.info("报价接口..........% s" % order.name)
|
||||
try:
|
||||
if order:
|
||||
vals = {}
|
||||
# mrs合作伙伴token
|
||||
vals['token'] = config['sf_token']
|
||||
vals['token'] = config['token']
|
||||
vals['accuracy'] = order.machining_precision
|
||||
vals['number'] = order.quantity
|
||||
vals['process_code'] = 0
|
||||
|
||||
Reference in New Issue
Block a user