修复待排程的消息推送
This commit is contained in:
@@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError
|
|||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|
||||||
|
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class SFMessageSale(models.Model):
|
|||||||
|
|
||||||
# 继承并重写jikimo.message.dispatch的_get_message()
|
# 继承并重写jikimo.message.dispatch的_get_message()
|
||||||
def _get_message(self, message_queue_ids):
|
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 == '确认接单':
|
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 = 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))])
|
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
|
product = sale_order_line[0].product_id.name
|
||||||
elif len(sale_order_line) > 1:
|
elif len(sale_order_line) > 1:
|
||||||
product = '%s...' % sale_order_line[0].product_id.name
|
product = '%s...' % sale_order_line[0].product_id.name
|
||||||
res = super(SFMessageSale, self)._get_message(message_queue_ids)
|
res[0] = res[0].replace('{{product_id}}', product)
|
||||||
if res:
|
|
||||||
try:
|
|
||||||
res.add_queue('待排程')
|
|
||||||
except Exception as e:
|
|
||||||
logging.info('_get_message error:%s' % e)
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from datetime import datetime
|
|||||||
import requests
|
import requests
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo.exceptions import ValidationError, UserError
|
from odoo.exceptions import ValidationError, UserError
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from stl import mesh
|
from stl import mesh
|
||||||
# from OCC.Core.GProp import GProp_GProps
|
# from OCC.Core.GProp import GProp_GProps
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|||||||
Reference in New Issue
Block a user