From 01f09029376f106873f8f4f715a7b509807b8a42 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 8 Nov 2023 17:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B3=A8=E9=87=8A=EF=BC=8C?= =?UTF-8?q?=E5=8F=8A=E4=BF=AE=E6=94=B9=E8=BD=AC=E6=8D=A23d=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=96=87=E4=BB=B6=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {sf_dlm => sf_base}/static/util/stl2gltf.py | 0 sf_manufacturing/models/product_template.py | 2 +- sf_sale/models/quick_easy_order.py | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename {sf_dlm => sf_base}/static/util/stl2gltf.py (100%) diff --git a/sf_dlm/static/util/stl2gltf.py b/sf_base/static/util/stl2gltf.py similarity index 100% rename from sf_dlm/static/util/stl2gltf.py rename to sf_base/static/util/stl2gltf.py diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 58c9f876..b6961fda 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -863,7 +863,7 @@ class ResProductMo(models.Model): # 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') + util_path = get_resource_path('sf_base', 'static/util') cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file) os.system(cmd) # 转base64 diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 238bb5d8..e9f152a8 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -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 @@ -95,7 +95,7 @@ class QuickEasyOrder(models.Model): write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) # 转化为glb output_glb_file = os.path.join('/tmp', str(model_code) + '.glb') - util_path = get_resource_path('sf_dlm', 'static/util') + util_path = get_resource_path('sf_base', 'static/util') cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file) os.system(cmd) # 转base64