Permalink
Browse files

[IMP]

  • Loading branch information...
kic-odoo committed Feb 7, 2019
1 parent 64927dd commit 34367158dc6c0e539d8b22676c15d504215e59ec
Showing with 5 additions and 4 deletions.
  1. +5 −4 addons/stock/models/stock_move.py
@@ -1149,7 +1149,7 @@ def _action_done(self, cancel_backorder=False):

# split moves
for move in moves_todo:
move.split_mts()
move._split_mts()

return moves_todo

@@ -1160,9 +1160,10 @@ def unlink(self):
self.mapped('move_line_ids').unlink()
return super(StockMove, self).unlink()

def split_mts(self):
total_org = sum(qty for qty in self.move_dest_ids.mapped('move_orig_ids.product_uom_qty'))
total_dest = sum(qty for qty in self.move_dest_ids.mapped('product_uom_qty'))
def _split_mts(self):
self.ensure_one()
total_org = sum(self.move_dest_ids.mapped('move_orig_ids.product_uom_qty'))
total_dest = sum(self.move_dest_ids.mapped('product_uom_qty'))
if total_org < total_dest:
for dest_move in self.move_dest_ids:
if dest_move.procure_method == 'make_to_order':

0 comments on commit 3436715

Please sign in to comment.