修复表面工艺工单完成时对应库存(stock.move)的状态为完成并跳过标记完成方法的检查
This commit is contained in:
@@ -500,7 +500,8 @@ class MrpProduction(models.Model):
|
||||
|
||||
# 修改标记已完成方法
|
||||
def button_mark_done1(self):
|
||||
self._button_mark_done_sanity_checks()
|
||||
if not self.workorder_ids.filtered(lambda w: w.routing_type not in ['表面工艺']):
|
||||
self._button_mark_done_sanity_checks()
|
||||
|
||||
if not self.env.context.get('button_mark_done_production_ids'):
|
||||
self = self.with_context(button_mark_done_production_ids=self.ids)
|
||||
|
||||
@@ -907,6 +907,12 @@ class ResMrpWorkOrder(models.Model):
|
||||
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
||||
record.process_state = '已完工'
|
||||
record.production_id.process_state = '已完工'
|
||||
if record.routing_type in ['表面工艺']:
|
||||
raw_move = self.env['stock.move'].sudo().search(
|
||||
[('origin', '=', record.production_id.name), ('procure_method', '=', 'make_to_order'),
|
||||
('state', '!=', 'done')])
|
||||
if raw_move:
|
||||
raw_move.write({'state': 'done'})
|
||||
record.production_id.button_mark_done1()
|
||||
# self.production_id.state = 'done'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user