[POS-commit] r5485 - stoqlib/trunk/stoqlib/gui/wizards

Johan Dahlin jdahlin at async.com.br
Thu Dec 14 14:48:12 BRST 2006


Author: jdahlin
Date: Thu Dec 14 14:48:12 2006
New Revision: 5485

Modified:
   stoqlib/trunk/stoqlib/gui/wizards/purchasewizard.py

Log:
#2960: AttributeError: 'bool' object has no attribute 'get_toplevel'

Modified: stoqlib/trunk/stoqlib/gui/wizards/purchasewizard.py
==============================================================================
--- stoqlib/trunk/stoqlib/gui/wizards/purchasewizard.py	(original)
+++ stoqlib/trunk/stoqlib/gui/wizards/purchasewizard.py	Thu Dec 14 14:48:12 2006
@@ -214,9 +214,9 @@
     # XXX: Remove this, we need to add better infrastructure to handle
     #      dialogs with a slave but without a model
     model_name = _('Item')
-    model_type = bool
+    model_type = object
     def create_model(self, conn):
-        return True
+        return ProductEditor
 
 
 class PurchaseItemStep(AbstractItemStep):
@@ -244,6 +244,8 @@
             model = run_dialog(editor, None, self.conn, item)
         else:
             editor = run_dialog(SellableSelectionEditor, None, self.conn)
+            if not editor:
+                return
             model = run_dialog(editor, self, self.conn)
         if not finish_transaction(self.conn, model):
             return


More information about the POS-commit mailing list