From 3f16e5f19da9c5ea276785c1a4e9e5d867bbc527 Mon Sep 17 00:00:00 2001 From: nie Date: Mon, 7 Dec 2020 14:58:55 +0000 Subject: [PATCH] [FIX] stock: action should be a dict Steps: - Install Inventory - Go to Inventory > Configuration > Settings - Enable Warehouse > Storage Locations - Go to Inventory > Internal Transfers - Create a transfer with a product and add done quantity to the product - Come back to the list - Select the Ready transfers - Click Actions > Validate Bug: Traceback here: https://github.com/odoo/odoo/blob/7e9d052beabe15d932e5d403f8ca2f4837c7d24f/addons/web/controllers/main.py#L328 AttributeError: 'bool' object has no attribute 'setdefault' Explanation: `button_validate()` can return `True`. https://github.com/odoo/odoo/blob/7e9d052beabe15d932e5d403f8ca2f4837c7d24f/addons/stock/models/stock_picking.py#L861-L931 Therefore, a `True` action can be propagated up to the traceback point. Another solution could be to only accept dict actions when calling `clean_action()` closes odoo/odoo#63016 X-original-commit: 85bf2a3c322436808dbc46f6e0f8a68bf40f1b6c Signed-off-by: backspac --- addons/stock/views/stock_picking_views.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml index 267f25a2c40..5d74aa256cc 100644 --- a/addons/stock/views/stock_picking_views.xml +++ b/addons/stock/views/stock_picking_views.xml @@ -515,7 +515,8 @@ if records: res = records.button_validate() - action = res + if isinstance(res, dict): + action = res