修复外协位置
This commit is contained in:
@@ -796,8 +796,8 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
move_out = self.env['stock.move'].search(
|
move_out = self.env['stock.move'].search(
|
||||||
[('location_id', '=', self.env['stock.location'].search(
|
[('location_id', '=', self.env['stock.location'].search(
|
||||||
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
||||||
('location_dest_id', '=', self.env.ref(
|
('location_dest_id', '=', self.env['stock.location'].search(
|
||||||
'sf_manufacturing.stock_location_locations_virtual_outcontract').id),
|
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||||
('origin', '=', self.production_id.name)])
|
('origin', '=', self.production_id.name)])
|
||||||
purchase = self.env['purchase.order'].search([('origin', '=', self.production_id.name)])
|
purchase = self.env['purchase.order'].search([('origin', '=', self.production_id.name)])
|
||||||
if purchase and move_out:
|
if purchase and move_out:
|
||||||
@@ -910,7 +910,9 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
'order_line': order_line_ids,
|
'order_line': order_line_ids,
|
||||||
})
|
})
|
||||||
tem_date_planned_finished = record.date_planned_finished
|
tem_date_planned_finished = record.date_planned_finished
|
||||||
|
logging.info('routing_type:%s' % record.routing_type)
|
||||||
super().button_finish()
|
super().button_finish()
|
||||||
|
logging.info('date_planned_finished:%s' % record.date_planned_finished)
|
||||||
# 表面工艺工单完成不走该修改
|
# 表面工艺工单完成不走该修改
|
||||||
if record.routing_type != '表面工艺':
|
if record.routing_type != '表面工艺':
|
||||||
record.write({
|
record.write({
|
||||||
|
|||||||
@@ -505,8 +505,8 @@ class StockPicking(models.Model):
|
|||||||
move_out = self.env['stock.move'].search(
|
move_out = self.env['stock.move'].search(
|
||||||
[('location_id', '=', self.env['stock.location'].search(
|
[('location_id', '=', self.env['stock.location'].search(
|
||||||
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
||||||
('location_dest_id', '=', self.env.ref(
|
('location_dest_id', '=', self.env['stock.location'].search(
|
||||||
'sf_manufacturing.stock_location_locations_virtual_outcontract').id),
|
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||||
('origin', '=', self.origin)])
|
('origin', '=', self.origin)])
|
||||||
if self.id == move_out.picking_id.id:
|
if self.id == move_out.picking_id.id:
|
||||||
if move_out.move_line_ids.workorder_id.state not in ['progress']:
|
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(
|
move_in = self.env['stock.move'].search(
|
||||||
[('location_dest_id', '=', self.env['stock.location'].search(
|
[('location_dest_id', '=', self.env['stock.location'].search(
|
||||||
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
||||||
('location_id', '=', self.env.ref(
|
('location_id', '=', self.env['stock.location'].search(
|
||||||
'sf_manufacturing.stock_location_locations_virtual_outcontract').id),
|
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||||
('origin', '=', self.origin)])
|
('origin', '=', self.origin)])
|
||||||
if self.location_id == move_in.location_id and self.location_dest_id == move_in.location_dest_id:
|
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:
|
if move_out.origin == move_in.origin:
|
||||||
@@ -531,8 +531,8 @@ class StockPicking(models.Model):
|
|||||||
move_in = self.env['stock.move'].search(
|
move_in = self.env['stock.move'].search(
|
||||||
[('location_dest_id', '=', self.env['stock.location'].search(
|
[('location_dest_id', '=', self.env['stock.location'].search(
|
||||||
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
|
||||||
('location_id', '=', self.env.ref(
|
('location_id', '=', self.env['stock.location'].search(
|
||||||
'sf_manufacturing.stock_location_locations_virtual_outcontract').id),
|
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||||
('origin', '=', self.origin)])
|
('origin', '=', self.origin)])
|
||||||
# purchase = self.env['purchase.order'].search([('origin', '=', self.origin)])
|
# purchase = self.env['purchase.order'].search([('origin', '=', self.origin)])
|
||||||
if move_in:
|
if move_in:
|
||||||
|
|||||||
Reference in New Issue
Block a user