diff options
| author | nie <nie@odoo.com> | 2020-12-07 14:58:55 +0000 |
|---|---|---|
| committer | nie <nie@odoo.com> | 2020-12-07 14:58:55 +0000 |
| commit | 85bf2a3c322436808dbc46f6e0f8a68bf40f1b6c (patch) | |
| tree | 67639f2b7162dedbbf8b7e6fef5c288852e10c68 | |
| parent | e31819bccec604ba61c053015304abebdd189690 (diff) | |
[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#62969
Signed-off-by: backspac <backspac@users.noreply.github.com>
| -rw-r--r-- | addons/stock/views/stock_picking_views.xml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml index 475f305bf49..ad5ce05022e 100644 --- a/addons/stock/views/stock_picking_views.xml +++ b/addons/stock/views/stock_picking_views.xml @@ -524,7 +524,8 @@ <field name="code"> if records: res = records.button_validate() - action = res + if isinstance(res, dict): + action = res </field> </record> |
