调拨入库消息推送

This commit is contained in:
liaodanlong
2024-09-26 09:22:02 +08:00
parent c569b60d5c
commit 5fb7165306
2 changed files with 10 additions and 7 deletions

View File

@@ -7,11 +7,14 @@ class SFMessageStockPicking(models.Model):
_description = "库存调拨"
_inherit = ['stock.picking', 'jikimo.message.dispatch']
def button_validate(self):
res = super(SFMessageStockPicking, self).button_validate()
if self.location_id.name == 'Vendors' and self.location_dest_id.name == '进货':
self.add_queue('调拨入库')
return res
@api.model_create_multi
def create(self, vals):
result = super(SFMessageStockPicking, self).create(vals)
for obj in result:
if obj.location_id.name == '进货' and obj.location_dest_id.name == '刀具房':
obj.add_queue('调拨入库')
return result
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
def _compute_state(self):