[FIX] stock: return wizard in multi location

In `_create_returns`, the code creates a picking using
`self.location_id` as destination location.

When the multi location group is not active, the user has no possibility
to change this field and it is correctly initialized. When the multi
location groups is active, the user has this possibility.

If the user empties out this field and tries to validate the return,
he's faced with an error. We make this field required in the view to
prevent any issues.

Task-1986294
Fixes 24207

closes odoo/odoo#33463

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Jinal Patel
2019-05-22 12:48:11 +00:00
committed by Simon Lejeune
parent 3418f8c4c4
commit 84e2c85b93
@@ -27,7 +27,7 @@
<group>
<field name="parent_location_id" invisible="1"/>
<field name="original_location_id" invisible="1"/>
<field name="location_id" options="{'no_create': True, 'no_open': True}" groups="stock.group_stock_multi_locations"/>
<field name="location_id" options="{'no_create': True, 'no_open': True}" groups="stock.group_stock_multi_locations" required="1"/>
</group>
<footer>
<button name="create_returns" string="Return" type="object" class="btn-primary"/>