Skip to content
Browse files

[REM] mrp: remove _decrease_reserved_quanity

As `_do_unreserve` was rewrited, the `_decrease_reserved_quanity` method
isn't useful since its purpose was to avoid to unlink all stock moves
and it is what `_do_unreserve` cares about.

See fe5f3eb
  • Loading branch information
svs-odoo committed Jan 10, 2020
1 parent ee6b04f commit 0dd78512d256d386d1c2248a9eb196b6a1e7ffc5
Showing with 1 addition and 20 deletions.
  1. +1 −2 addons/mrp/models/
  2. +0 −18 addons/mrp/models/
@@ -654,9 +654,8 @@ def _update_raw_move(self, bom_line, line_data):
old_qty = move[0].product_uom_qty
remaining_qty = move[0].raw_material_production_id.product_qty - move[0].raw_material_production_id.qty_produced
if quantity > 0:
move[0].with_context(do_not_unreserve=True).write({'product_uom_qty': quantity})
move[0].unit_factor = remaining_qty and (quantity - move[0].quantity_done) / remaining_qty or 1.0
return move[0], old_qty, quantity
@@ -206,24 +206,6 @@ def _action_cancel(self):
return res

def _decrease_reserved_quanity(self, quantity):
""" Decrease the reservation on move lines but keeps the
all other data.
move_line_to_unlink = self.env['stock.move.line']
for move in self:
reserved_quantity = quantity
for move_line in self.move_line_ids:
if move_line.product_uom_qty > reserved_quantity:
move_line.product_uom_qty = reserved_quantity
move_line.product_uom_qty = 0
reserved_quantity -= move_line.product_uom_qty
if not move_line.product_uom_qty and not move_line.qty_done:
move_line_to_unlink |= move_line
return True

def _prepare_phantom_move_values(self, bom_line, product_qty, quantity_done):
return {
'picking_id': if self.picking_id else False,

0 comments on commit 0dd7851

Please sign in to comment.
You can’t perform that action at this time.