Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造代码优化

This commit is contained in:
mgw
2024-05-18 15:14:38 +08:00
8 changed files with 313 additions and 277 deletions

View File

@@ -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,10 +910,14 @@ 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()
record.write({
'date_planned_finished': tem_date_planned_finished # 保持原值
})
logging.info('date_planned_finished:%s' % record.date_planned_finished)
# 表面工艺工单完成不走该修改
if record.routing_type != '表面工艺':
record.write({
'date_planned_finished': tem_date_planned_finished # 保持原值
})
is_production_id = True
for workorder in record.production_id.workorder_ids:
if workorder.state != 'done':