diff --git a/packing.py b/packing.py
index fa011f3a00..6577e6046d 100644
--- a/packing.py
+++ b/packing.py
@@ -816,12 +816,12 @@ class PackingInternal(OSV):
def set_state_waiting(self, cursor, user, packing_id, context=None):
move_obj = self.pool.get('stock.move')
packing = self.browse(cursor, user, packing_id, context=context)
- move_obj.write(
- cursor, user, [m.id for m in packing.moves], {'state': 'draft'},
- context=context)
- move_obj.write(
- cursor, user, [m.id for m in packing.moves],
- {'planned_date': packing.planned_date}, context=context)
+ move_obj.write(cursor, user, [m.id for m in packing.moves], {
+ 'from_location': packing.from_location.id,
+ 'to_location': packing.to_location.id,
+ 'state': 'draft',
+ 'planned_date': packing.planned_date,
+ }, context=context)
self.write(
cursor, user, packing_id, {'state': 'waiting'}, context=context)
diff --git a/packing.xml b/packing.xml
index d99c1a7dde..3fbe29d740 100644
--- a/packing.xml
+++ b/packing.xml
@@ -388,7 +388,7 @@ this repository contains the full copyright notices and license terms. -->
states="{'invisible': '''state != 'waiting' ''', 'readonly': '''%(group_stock)d not in groups'''}"
icon="tryton-go-previous"/>
+ states="{'invisible': '''state not in ('assigned', 'waiting', 'draft')''', 'readonly': '''%(group_stock)d not in groups''', 'icon': '''state == 'assigned' and 'tryton-go-previous' or state == 'waiting' and 'tryton-clear' or state == 'draft' and 'tryton-go-next' or False'''}"/>