def _dialog_purchase(self, id): from stoqlib.domain.purchase import PurchaseOrder from stoqlib.gui.dialogs.purchasedetails import PurchaseDetailsDialog store = api.new_store() purchase = PurchaseOrder.get(int(id), store) retval = run_dialog(PurchaseDetailsDialog, self.app, store, purchase) if store.confirm(retval): self.refresh() store.close()