Skip to content
Snippets Groups Projects
Commit e9da1166 authored by RomainLibert's avatar RomainLibert
Browse files

[FIX] stock: avoid cache miss error in compute

We should check that we have a picking_id before calling a method that
uses `ensure_one`
parent 9e0f200a
Branches
Tags
No related merge requests found
......@@ -15,8 +15,10 @@ class StockOverProcessedTransfer(models.TransientModel):
def _compute_overprocessed_product_name(self):
for wizard in self:
moves = wizard.picking_id._get_overprocessed_stock_moves()
wizard.overprocessed_product_name = moves[0].product_id.display_name
wizard.overprocessed_product_name = False
if wizard.picking_id:
moves = wizard.picking_id._get_overprocessed_stock_moves()
wizard.overprocessed_product_name = moves[0].product_id.display_name
def action_confirm(self):
self.ensure_one()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment