坯料采购提醒
This commit is contained in:
@@ -6,12 +6,4 @@ class SFMessagePurchase(models.Model):
|
|||||||
_name = 'purchase.order'
|
_name = 'purchase.order'
|
||||||
_inherit = ['purchase.order', 'jikimo.message.dispatch']
|
_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
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import logging
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
|
|
||||||
|
|
||||||
@@ -21,6 +22,17 @@ class SFMessageSale(models.Model):
|
|||||||
if res is True:
|
if res is True:
|
||||||
try:
|
try:
|
||||||
self.add_queue('确认接单')
|
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:
|
except Exception as e:
|
||||||
logging.info('add_queue error:%s' % e)
|
logging.info('add_queue error:%s' % e)
|
||||||
return res
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user