消息推送
This commit is contained in:
18
sf_message/models/sf_message_functional_tool_dismantle.py
Normal file
18
sf_message/models/sf_message_functional_tool_dismantle.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class SFMessagefunctionalToolDismantle(models.Model):
|
||||
_name = 'sf.functional.tool.dismantle'
|
||||
_description = "刀具拆解单"
|
||||
_inherit = ['sf.functional.tool.dismantle', 'jikimo.message.dispatch']
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
result = super(SFMessagefunctionalToolDismantle, self).create(vals)
|
||||
is_dismantle = False
|
||||
for obj in result:
|
||||
if obj.dismantle_cause in ['寿命到期报废', '崩刀报废']and obj.state=='待拆解':
|
||||
is_dismantle = True
|
||||
if is_dismantle:
|
||||
self.add_queue('功能刀具寿命到期')
|
||||
return result
|
||||
Reference in New Issue
Block a user