From 0badd92265eec2a54ebdc88e312d4277f807e040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 13 May 2008 17:42:23 +0200 Subject: [PATCH] Fix workflow (remove signal_) Remove unused rpc_allowed function Add lock on move table when assigning --- packing.py | 18 +++++++++--------- packing.xml | 37 ++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/packing.py b/packing.py index d992070205..0cbc17af5f 100644 --- a/packing.py +++ b/packing.py @@ -265,15 +265,8 @@ class PackingOut(OSV): def __init__(self): super(PackingOut, self).__init__() self._rpc_allowed += [ - 'set_state_done', - 'set_state_waiting', - 'set_state_draft', - 'set_state_cancel', - 'set_state_assigned', - 'set_state_ready', - 'assign_try', - 'assign_force', - ] + 'button_draft', + ] self._order[0] = ('id', 'DESC') def default_state(self, cursor, user, context=None): @@ -480,6 +473,8 @@ class PackingOut(OSV): if context is None: context = {} + cursor.execute('LOCK TABLE stock_move') + packing = self.browse(cursor, user, id, context=context) parent_to_locations = {} inventory_moves = [] @@ -566,6 +561,11 @@ class PackingOut(OSV): {'state':'assigned'}) return True + def button_draft(self, cursor, user, ids, context=None): + workflow_service = LocalService('workflow') + for packing in self.browse(cursor, user, ids, context=context): + workflow_service.trg_create(user, self._name, packing.id, cursor) + PackingOut() diff --git a/packing.xml b/packing.xml index fb7a16ed52..69be873e3e 100644 --- a/packing.xml +++ b/packing.xml @@ -175,7 +175,7 @@ form +