[FIX] stock{,_picking_batch}: correct public method return value

This commit is contained in:
Christophe Simonis
2017-12-01 10:49:32 +01:00
parent 42264d8dcb
commit 676c982eda
2 changed files with 3 additions and 2 deletions
@@ -37,4 +37,4 @@ class StockImmediateTransfer(models.TransientModel):
pick_to_do.action_done()
if pick_to_backorder:
return pick_to_backorder.action_generate_backorder_wizard()
return True
return False
@@ -11,10 +11,11 @@ class StockImmediateTransfer(models.TransientModel):
def process(self):
backorder_wizard_dict = super(StockImmediateTransfer, self).process()
# If the immediate transfer wizard process all our picking but with some back order maybe needed we want to add the backorder already passed to the wizard.
if backorder_wizard_dict is not None:
if backorder_wizard_dict:
backorder_wizard = self.env['stock.backorder.confirmation'].browse(backorder_wizard_dict.get('res_id', False))
backorder_wizard.write({'pick_ids': [(4, p.id) for p in self.pick_to_backorder_ids]})
return backorder_wizard_dict
# If there is no backorder returned by the immediate transfer basic function we still wanted to process those manually given
elif self.pick_to_backorder_ids:
return self.pick_to_backorder_ids.action_generate_backorder_wizard()
return False