From 6591e663b658cdb46795727d9741ddb3686c51fb Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Mon, 23 Sep 2024 10:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BE=85=E6=8E=92=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 ++-- sf_message/models/sf_message_sale.py | 8 ++------ sf_sale/models/quick_easy_order.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 209c694e..48cabaf7 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError 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 class ResProductMo(models.Model): diff --git a/sf_message/models/sf_message_sale.py b/sf_message/models/sf_message_sale.py index 1a9fe70b..fb9d5976 100644 --- a/sf_message/models/sf_message_sale.py +++ b/sf_message/models/sf_message_sale.py @@ -27,6 +27,7 @@ class SFMessageSale(models.Model): # 继承并重写jikimo.message.dispatch的_get_message() def _get_message(self, message_queue_ids): + res = super(SFMessageSale, self)._get_message(message_queue_ids) if message_queue_ids.message_template_id.bussiness_node_id.name == '确认接单': # sale_order = self.env['sale.order'].search([('id', '=', message_queue_ids.model.res_id)]) sale_order_line = self.env['sale.order.line'].search([('order_id', '=', int(message_queue_ids.res_id))]) @@ -34,10 +35,5 @@ class SFMessageSale(models.Model): product = sale_order_line[0].product_id.name elif len(sale_order_line) > 1: product = '%s...' % sale_order_line[0].product_id.name - res = super(SFMessageSale, self)._get_message(message_queue_ids) - if res: - try: - res.add_queue('待排程') - except Exception as e: - logging.info('_get_message error:%s' % e) + res[0] = res[0].replace('{{product_id}}', product) return res diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index cb1886a1..081807a4 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -# 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 import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 9bd61132..4756a2c5 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -# 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.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path