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: