Accept Merge Request #1354: (feature/销售和排程添加消息推送 -> develop)
Merge Request: 工单已下发通知 Created By: @管欢 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @管欢 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1354
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
import logging
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
|
||||
class SFMessagePurchase(models.Model):
|
||||
_name = 'purchase.order'
|
||||
_inherit = ['purchase.order', 'jikimo.message.dispatch']
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
res = super(SFMessagePurchase, self).create(vals_list)
|
||||
if res:
|
||||
try:
|
||||
res.add_queue('坯料采购提醒')
|
||||
except Exception as e:
|
||||
logging.info('add_queue error:%s' % e)
|
||||
return res
|
||||
_inherit = ['purchase.order', 'jikimo.message.dispatch']
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
|
||||
@@ -21,6 +22,18 @@ class SFMessageSale(models.Model):
|
||||
if res is True:
|
||||
try:
|
||||
self.add_queue('确认接单')
|
||||
picking_ids = self.mrp_production_ids
|
||||
purchase_order_id = []
|
||||
if picking_ids:
|
||||
for picking_id in picking_ids:
|
||||
purchase_order_ids = (
|
||||
picking_id.procurement_group_id.stock_move_ids.created_purchase_line_id.order_id |
|
||||
picking_id.procurement_group_id.stock_move_ids.move_orig_ids.purchase_line_id.order_id).ids
|
||||
purchase_order_id.extend(purchase_order_ids)
|
||||
if purchase_order_id:
|
||||
purchase_order_list = self.env['purchase.order'].search([('id', 'in', purchase_order_id)])
|
||||
for purchase_order_info in purchase_order_list:
|
||||
purchase_order_info.add_queue('坯料采购提醒')
|
||||
except Exception as e:
|
||||
logging.info('add_queue error:%s' % e)
|
||||
return res
|
||||
|
||||
@@ -43,7 +43,7 @@ class SFMessageStockPicking(models.Model):
|
||||
'{{number}}', str(i)).replace('{{request_url}}', url)
|
||||
product_id.append(mrp_production_info.product_id.id)
|
||||
contents.append(content)
|
||||
return contents
|
||||
else:
|
||||
res = super(SFMessageStockPicking, self)._get_message(message_queue_id)
|
||||
contents.append(res)
|
||||
return contents
|
||||
return res
|
||||
|
||||
@@ -8,8 +8,9 @@ class SFMessageWork(models.Model):
|
||||
@api.depends('production_availability', 'blocked_by_workorder_ids.state')
|
||||
def _compute_state(self):
|
||||
super(SFMessageWork, self)._compute_state()
|
||||
if self.state == 'ready' and self.routing_type == '装夹预调':
|
||||
self.add_queue('工单已下发通知')
|
||||
for workorder in self:
|
||||
if workorder.state == 'ready' and workorder.routing_type == '装夹预调':
|
||||
workorder.add_queue('工单已下发通知')
|
||||
|
||||
def _get_message(self, message_queue_ids):
|
||||
contents = []
|
||||
|
||||
Reference in New Issue
Block a user