From 5fb7165306434f551387a41139c2436adb27edc1 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 26 Sep 2024 09:22:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=8B=A8=E5=85=A5=E5=BA=93=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_message/__manifest__.py | 4 ++-- sf_message/models/sf_message_stock_picking.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sf_message/__manifest__.py b/sf_message/__manifest__.py index 0f032a6d..f9dfd741 100644 --- a/sf_message/__manifest__.py +++ b/sf_message/__manifest__.py @@ -11,9 +11,9 @@ """, 'category': 'sf', 'website': 'https://www.sf.jikimo.com', - 'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify','stock'], + 'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify','stock','sf_tool_management'], 'data': [ - 'data/bussiness_node.xml' + 'data/bussiness_node.xml', ], 'test': [ ], diff --git a/sf_message/models/sf_message_stock_picking.py b/sf_message/models/sf_message_stock_picking.py index 0c3045cb..95225948 100644 --- a/sf_message/models/sf_message_stock_picking.py +++ b/sf_message/models/sf_message_stock_picking.py @@ -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):