[POS-commit] r3247 - stoq/trunk/stoq/gui/purchase

Evandro Vale Miquelito evandro at async.com.br
Thu Apr 6 19:53:12 BRT 2006


Author: evandro
Date: Thu Apr  6 19:53:12 2006
New Revision: 3247

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

Log:
Fixing a bug: we must send a PurchaseOrder instance to PurchaseWizard


Modified: stoq/trunk/stoq/gui/purchase/purchase.py
==============================================================================
--- stoq/trunk/stoq/gui/purchase/purchase.py	(original)
+++ stoq/trunk/stoq/gui/purchase/purchase.py	Thu Apr  6 19:53:12 2006
@@ -104,12 +104,13 @@
         return order
 
     def _edit_order(self):
-        order = self.orders.get_selected_rows()
-        qty = len(order)
+        selected = self.orders.get_selected_rows()
+        qty = len(selected)
         if qty != 1:
             raise ValueError('You should have only one order selected, '
                              'got %d instead' % qty )
-        self._open_order(order[0], edit_mode=True)
+        order = PurchaseOrder.get(selected[0].id, connection=self.conn)
+        self._open_order(order, edit_mode=True)
         self.searchbar.search_items()
 
     def _run_details_dialog(self, *args):


More information about the POS-commit mailing list