diff --git a/jikimo_purchase_request/views/purchase_request_view.xml b/jikimo_purchase_request/views/purchase_request_view.xml index db88a4e2..9976b52a 100644 --- a/jikimo_purchase_request/views/purchase_request_view.xml +++ b/jikimo_purchase_request/views/purchase_request_view.xml @@ -2,7 +2,7 @@ purchase.request.sf.form purchase.request - + 重置草稿 @@ -21,19 +21,20 @@ purchase.request.line.sf.tree purchase.request.line - + - + + True True - + 采购数量 @@ -44,7 +45,7 @@ - + @@ -52,7 +53,7 @@ purchase.request.line.sf.search purchase.request.line - + diff --git a/sf_stock/models/stock_picking.py b/sf_stock/models/stock_picking.py index 4623c4ed..d4453d51 100644 --- a/sf_stock/models/stock_picking.py +++ b/sf_stock/models/stock_picking.py @@ -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 = [] # 本次发货单行