[POS-commit] r3277 - stoq/trunk/stoq/gui/warehouse

Evandro Vale Miquelito evandro at async.com.br
Mon Apr 10 18:45:43 BRT 2006


Author: evandro
Date: Mon Apr 10 18:45:43 2006
New Revision: 3277

Modified:
   stoq/trunk/stoq/gui/warehouse/warehouse.py

Log:
Using finish_transaction where its needed


Modified: stoq/trunk/stoq/gui/warehouse/warehouse.py
==============================================================================
--- stoq/trunk/stoq/gui/warehouse/warehouse.py	(original)
+++ stoq/trunk/stoq/gui/warehouse/warehouse.py	Mon Apr 10 18:45:43 2006
@@ -29,7 +29,8 @@
 import gtk
 from kiwi.ui.widgets.list import Column, SummaryLabel
 from stoqlib.exceptions import DatabaseInconsistency
-from stoqlib.database import rollback_and_begin
+from stoqlib.database import finish_transaction
+from stoqlib.lib.runtime import new_transaction
 from stoqlib.lib.defaults import ALL_ITEMS_INDEX, ALL_BRANCHES
 from stoqlib.lib.parameters import sysparam
 from stoqlib.gui.wizards.receiving import ReceivingOrderWizard
@@ -136,10 +137,9 @@
         self._update_widgets()
 
     def _on_receive_action_clicked(self, *args):
-        model = self.run_dialog(ReceivingOrderWizard, self.conn)
-        if not model:
-            rollback_and_begin(self.conn)
-        self.conn.commit()
+        conn = new_transaction()
+        model = self.run_dialog(ReceivingOrderWizard, conn)
+        finish_transaction(conn, model)
 
     def on_stock_transfer_action_clicked(self, *args):
         # TODO To be implemented


More information about the POS-commit mailing list