[FIX] procurement_jit, stock: unreservation
We fix two problems with the 'unreserve' function on picking and sale order, When a sale order is edited, we perform 'do_unreserve' on picking, it is not necessary and make us loose the done quantity put on the picking so we remove it. When we unreserve a picking having a package level added through a put in pack or automatically added on reservation, the package level is set back to draft instead of being removed -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr closes odoo/odoo#28188
This commit is contained in:
@@ -14,6 +14,5 @@ class SaleOrderLine(models.Model):
|
||||
for order in orders:
|
||||
reassign = order.picking_ids.filtered(lambda x: x.state=='confirmed' or (x.state in ['waiting', 'assigned'] and not x.printed))
|
||||
if reassign:
|
||||
reassign.do_unreserve()
|
||||
reassign.action_assign()
|
||||
return res
|
||||
|
||||
@@ -682,6 +682,7 @@ class Picking(models.Model):
|
||||
def do_unreserve(self):
|
||||
for picking in self:
|
||||
picking.move_lines._do_unreserve()
|
||||
picking.package_level_ids.filtered(lambda p: not p.move_ids).unlink()
|
||||
|
||||
@api.multi
|
||||
def button_validate(self):
|
||||
|
||||
Reference in New Issue
Block a user