1、优化调拨单验证方法;2、隐藏请购明细列表视图字段

This commit is contained in:
yuxianghui
2025-03-31 15:55:37 +08:00
parent 5914e4ca6e
commit e7cb100ab1
2 changed files with 17 additions and 6 deletions

View File

@@ -88,6 +88,16 @@ class StockPicking(models.Model):
self.send_to_bfm()
return info
def _action_done(self):
"""处理创建欠单时,新单据验证序列号无法使用问题"""
todo_moves = self.move_ids.filtered(
lambda self: self.state in ['draft', 'waiting', 'partially_available', 'assigned', 'confirmed'])
res = super(StockPicking, self)._action_done()
todo_move = todo_moves.filtered(lambda mv: mv.quantity_done == 0)
if todo_move:
todo_move.move_line_nosuggest_ids.write({'qty_done': 1})
return res
def deal_move_ids(self, send_move_ids, send_move_line_ids):
move_ids = [] # 本次发货单
move_line_ids = [] # 本次发货单行