diff --git a/sf_sale/models/auto_quatotion_common.py b/sf_sale/models/auto_quatotion_common.py index 09ea3f0f..2d34a76e 100644 --- a/sf_sale/models/auto_quatotion_common.py +++ b/sf_sale/models/auto_quatotion_common.py @@ -2,7 +2,7 @@ import logging from odoo.modules import get_resource_path from odoo import fields, models, api -from quatotion import readSql, feature_recognize, auto_quatotion +#from quatotion import readSql, feature_recognize, auto_quatotion __author__ = 'jinling.yang' _logger = logging.getLogger(__name__) @@ -24,14 +24,14 @@ class AutoQuatotion(models.Model): def get_process_time_db_path(self): return get_resource_path('sf_sale', 'models', 'process_time.db') - def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code): - ''' - 通过打包好的.so库, - 以调用autoQuatotion库中Quatotion类, - 初始化后调用类的analyseShape方法对模型文件进行价格预测 - ''' - # 初始化自动报价类(输入特征数据库和加工时间数据库) - reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path) - # 获取价格、加工时间、尺寸、XYZ、翻面次数 - feature_info = reader.analyseShape(stp_url, InfoJson={}) - return feature_info + # def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code): + # ''' + # 通过打包好的.so库, + # 以调用autoQuatotion库中Quatotion类, + # 初始化后调用类的analyseShape方法对模型文件进行价格预测 + # ''' + # # 初始化自动报价类(输入特征数据库和加工时间数据库) + # reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path) + # # 获取价格、加工时间、尺寸、XYZ、翻面次数 + # feature_info = reader.analyseShape(stp_url, InfoJson={}) + # return feature_info diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index b81c3b5e..0ce0b6d1 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -120,16 +120,16 @@ class QuickEasyOrder(models.Model): model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest() logging.info("模型编码: %s" % model_code) item.model_file = self.transition_glb_file(report_path, model_code) - ret = self.feature_recognition(report_path, model_code) - logging.info("自动报价返回值: %s" % ret) - boxshape = ret['boxshape'].tolist() - logging.info("自动报价boxshape: %s" % boxshape) - logging.info('自动报价feature_infos:%s' % ret['feature_infos']) - item.model_length = boxshape[0] # 长 单位mm - item.model_width = boxshape[1] # 宽 - item.model_height = boxshape[2] # 高 - item.model_volume = boxshape[0] * boxshape[1] * boxshape[2] - item.model_feature = json.dumps(ret['feature_infos'], ensure_ascii=False) + # ret = self.feature_recognition(report_path, model_code) + # logging.info("自动报价返回值: %s" % ret) + # boxshape = ret['boxshape'].tolist() + # logging.info("自动报价boxshape: %s" % boxshape) + # logging.info('自动报价feature_infos:%s' % ret['feature_infos']) + # item.model_length = boxshape[0] # 长 单位mm + # item.model_width = boxshape[1] # 宽 + # item.model_height = boxshape[2] # 高 + # item.model_volume = boxshape[0] * boxshape[1] * boxshape[2] + # item.model_feature = json.dumps(ret['feature_infos'], ensure_ascii=False) # self._get_price(item) else: item.model_file = False @@ -237,7 +237,7 @@ class QuickEasyOrder(models.Model): product_bom_purchase.bom_create_line_has(purchase_embryo) order_id.with_user(self.env.ref("base.user_admin")).sale_order_create_line(product, item) except Exception as e: - self.cr.rollback() + # self.cr.rollback() return UserError('工厂创建销售订单和产品失败,请联系管理员')