修复表面工艺工单完成时对应库存(stock.move)的状态为完成并跳过标记完成方法的检查

This commit is contained in:
jinling.yang
2024-05-18 19:52:58 +08:00
parent 1bcd1f2e33
commit f9cca591bb
3 changed files with 9 additions and 5 deletions

View File

@@ -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)