Skip to content
Snippets Groups Projects
Commit 5b2b28a8 authored by niyasraphy's avatar niyasraphy
Browse files

[FIX] stock: allow cancelling picking with no move lines


before this commit, trying to cancel a picking with no move lines, will not move the picking to the cancel state.

* create a new picking
* keep move lines empty
* click on the cancel button
* picking will remain in the draft state

after this commit, on cancelling a picking with empty lines, will move the picking to the cancel state.

closes odoo/odoo#112417

X-original-commit: 4a4ae318
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent eee0a776
No related branches found
No related tags found
No related merge requests found
......@@ -823,6 +823,7 @@ class Picking(models.Model):
def action_cancel(self):
self.mapped('move_lines')._action_cancel()
self.write({'is_locked': True})
self.filtered(lambda x: not x.move_lines).state = 'cancel'
return True
def _action_done(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment