From 939aa974e66b7f7b617e7f766fbf0c2a65bf72d8 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Sat, 18 May 2024 11:17:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=96=E5=8D=8F=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 6 ++++-- sf_manufacturing/models/stock.py | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 02b64bc6..bb474ab6 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -796,8 +796,8 @@ class ResMrpWorkOrder(models.Model): move_out = self.env['stock.move'].search( [('location_id', '=', self.env['stock.location'].search( [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id), - ('location_dest_id', '=', self.env.ref( - 'sf_manufacturing.stock_location_locations_virtual_outcontract').id), + ('location_dest_id', '=', self.env['stock.location'].search( + [('barcode', 'ilike', 'VL-SPOC')]).id), ('origin', '=', self.production_id.name)]) purchase = self.env['purchase.order'].search([('origin', '=', self.production_id.name)]) if purchase and move_out: @@ -910,7 +910,9 @@ class ResMrpWorkOrder(models.Model): 'order_line': order_line_ids, }) tem_date_planned_finished = record.date_planned_finished + logging.info('routing_type:%s' % record.routing_type) super().button_finish() + logging.info('date_planned_finished:%s' % record.date_planned_finished) # 表面工艺工单完成不走该修改 if record.routing_type != '表面工艺': record.write({ diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index f6198f02..e486f13b 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -505,8 +505,8 @@ class StockPicking(models.Model): move_out = self.env['stock.move'].search( [('location_id', '=', self.env['stock.location'].search( [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id), - ('location_dest_id', '=', self.env.ref( - 'sf_manufacturing.stock_location_locations_virtual_outcontract').id), + ('location_dest_id', '=', self.env['stock.location'].search( + [('barcode', 'ilike', 'VL-SPOC')]).id), ('origin', '=', self.origin)]) if self.id == move_out.picking_id.id: if move_out.move_line_ids.workorder_id.state not in ['progress']: @@ -516,8 +516,8 @@ class StockPicking(models.Model): move_in = self.env['stock.move'].search( [('location_dest_id', '=', self.env['stock.location'].search( [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id), - ('location_id', '=', self.env.ref( - 'sf_manufacturing.stock_location_locations_virtual_outcontract').id), + ('location_id', '=', self.env['stock.location'].search( + [('barcode', 'ilike', 'VL-SPOC')]).id), ('origin', '=', self.origin)]) if self.location_id == move_in.location_id and self.location_dest_id == move_in.location_dest_id: if move_out.origin == move_in.origin: @@ -531,8 +531,8 @@ class StockPicking(models.Model): move_in = self.env['stock.move'].search( [('location_dest_id', '=', self.env['stock.location'].search( [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id), - ('location_id', '=', self.env.ref( - 'sf_manufacturing.stock_location_locations_virtual_outcontract').id), + ('location_id', '=', self.env['stock.location'].search( + [('barcode', 'ilike', 'VL-SPOC')]).id), ('origin', '=', self.origin)]) # purchase = self.env['purchase.order'].search([('origin', '=', self.origin)]) if move_in: