Merge lp:~gergagabriel/stoq/bug4192 into lp:~stoq-dev/stoq/master-old

Proposed by Gabriel Gerga
Status: Merged
Merged at revision: 1623
Proposed branch: lp:~gergagabriel/stoq/bug4192
Merge into: lp:~stoq-dev/stoq/master-old
Diff against target: 32 lines (+8/-0)
1 file modified
stoq/gui/receivable/receivable.py (+8/-0)
To merge this branch: bzr merge lp:~gergagabriel/stoq/bug4192
Reviewer Review Type Date Requested Status
Ronaldo Maia Approve
Review via email: mp+37311@code.launchpad.net

Description of the change

In Receivable:

Bug:
Error when renegotiating payments and no message was appears for user.

Resolution:
Added warning message when renegotiating payments with till opened prior days.

To post a comment you must log in.
Revision history for this message
Ronaldo Maia (romaia) wrote :

certinho. pode aplicar.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stoq/gui/receivable/receivable.py'
2--- stoq/gui/receivable/receivable.py 2010-05-12 17:26:08 +0000
3+++ stoq/gui/receivable/receivable.py 2010-10-01 20:08:48 +0000
4@@ -42,6 +42,8 @@
5 from stoqlib.domain.payment.payment import Payment
6 from stoqlib.domain.payment.views import InPaymentView
7 from stoqlib.domain.sale import SaleView
8+from stoqlib.domain.till import Till
9+from stoqlib.exceptions import TillError
10 from stoqlib.reporting.payment import ReceivablePaymentReport
11 from stoqlib.reporting.receival_receipt import ReceivalReceipt
12 from stoqlib.gui.printing import print_report
13@@ -58,6 +60,7 @@
14 from stoqlib.gui.search.paymentsearch import InPaymentBillCheckSearch
15 from stoqlib.gui.slaves.installmentslave import SaleInstallmentConfirmationSlave
16 from stoqlib.gui.wizards.renegotiationwizard import PaymentRenegotiationWizard
17+from stoqlib.lib.message import warning
18
19 from stoq.gui.application import SearchableAppWindow
20
21@@ -414,6 +417,11 @@
22 self._run_bill_check_search()
23
24 def on_Renegotiate__activate(self, action):
25+ try:
26+ Till.get_current(self.conn)
27+ except TillError, e:
28+ warning(str(e))
29+ return
30 receivable_views = self.results.get_selected_rows()
31 trans = new_transaction()
32 groups = list(set([trans.get(v.group) for v in receivable_views]))

Subscribers

People subscribed via source and target branches