修复待排程的消息推送

This commit is contained in:
jinling.yang
2024-09-23 10:26:53 +08:00
parent bad5c8d489
commit 6591e663b6
4 changed files with 8 additions and 12 deletions

View File

@@ -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):

View File

@@ -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

View File

@@ -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

View File

@@ -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