采购刀具产品反注册接口新增图片字段,3d模型代码放开
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
import logging
|
||||
import base64
|
||||
import hashlib
|
||||
@@ -732,9 +732,9 @@ class ResProductMo(models.Model):
|
||||
|
||||
# 将attach的datas内容转为glb文件
|
||||
def transition_glb_file(self, report_path, code):
|
||||
# shapes = read_step_file(report_path)
|
||||
shapes = read_step_file(report_path)
|
||||
output_file = os.path.join('/tmp', str(code) + '.stl')
|
||||
# write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
# 转化为glb
|
||||
output_glb_file = os.path.join('/tmp', str(code) + '.glb')
|
||||
util_path = get_resource_path('sf_dlm', 'static/util')
|
||||
|
||||
@@ -513,6 +513,7 @@ class ReStockMove(models.Model):
|
||||
'inner_diameter': item.product_id.cutting_tool_inner_diameter,
|
||||
'cooling_suit_type_ids': item.product_id.cooling_suit_type_ids,
|
||||
'er_size_model': item.product_id.cutting_tool_er_size_model,
|
||||
'image': '' if not item.product_id.image_1920 else base64.b64encode(item.product_id.image_1920).decode('utf-8'),
|
||||
}
|
||||
try:
|
||||
if item.product_id.industry_code:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from datetime import datetime
|
||||
@@ -87,10 +87,10 @@ class QuickEasyOrder(models.Model):
|
||||
|
||||
# 将attach的datas内容转为glb文件
|
||||
def transition_glb_file(self, report_path, model_code):
|
||||
# shapes = read_step_file(report_path)
|
||||
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')
|
||||
# write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user