From 4467bf9db03851dd71bf96aa8fcf237bcbee632d Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 27 Jan 2009 14:59:29 +0100 Subject: [PATCH] Fix: use sequence on inventory packing creation. --- packing.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packing.py b/packing.py index 42a8a31e1f..bb8115a903 100644 --- a/packing.py +++ b/packing.py @@ -742,6 +742,13 @@ class PackingInternal(OSV): ] self._order[0] = ('id', 'DESC') + def create(self, cursor, user, values, context=None): + values = values.copy() + values['code'] = self.pool.get('ir.sequence').get( + cursor, user, 'stock.packing.internal', context=context) + return super(PackingInternal, self).create( + cursor, user, values, context=context) + def set_state_draft(self, cursor, user, packing_id, context=None): move_obj = self.pool.get('stock.move') packing = self.browse(cursor, user, packing_id, context=context)