From f5c509ab3f7b38ee65bef778fbddd86a28a11234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 26 Jan 2009 17:11:04 +0100 Subject: [PATCH] Reset from and to location for internal packing in state waiting --- packing.py | 12 ++++++------ packing.xml | 9 ++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) 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"/>