[Stoq-devel] [Bug 3387] Retirar o valor 0.01 do dialogo de
sangria/sumprimento.
bugzilla-daemon at async.com.br
bugzilla-daemon at async.com.br
Tue Jun 12 11:45:20 BRT 2007
http://bugs.async.com.br/show_bug.cgi?id=3387
--- Comment #3 from Johan Dahlin <jdahlin at async.com.br> 2007-06-12 11:45:19 BRT ---
(From update of attachment 4160)
>Index: stoqlib/gui/editors/tilleditor.py
>@@ -213,6 +213,7 @@
> model_type = _BaseCashModel
> gladefile = 'BaseCashSlave'
> proxy_widgets = ('value', 'balance')
>+ confirm = True
>+ def on_confirm(self):
>+ return self.confirm
>@@ -230,12 +234,21 @@
> def on_value__validate(self, widget, value):
> zero = currency(0)
> if value <= zero:
>+ self.confirm = False
> return ValidationError(_("Value cannot be zero or less than zero"))
>+ self.confirm = True
Parece um hack... kiwi devo fazer isso pra você..
> def on_value__content_changed(self, entry):
>- value = self.model.get_balance() + self.model.value
>- self.proxy.update('balance', currency(value))
>+ try:
>+ if entry.read() < 0 or entry.read() == ValueUnset:
>+ value = self.model.get_balance()
>+ else:
>+ value = self.model.get_balance() + self.model.value
>+ self.proxy.update('balance', currency(value))
>+ except ValidationError:
>+ pass
É necessario mesmo? (também tá duplicando codigo aqui)
>- printer = FiscalPrinterHelper(self.conn, self.get_toplevel())
>- printer.remove_cash(abs(self.cash_slave.model.value))
>+ printer = FiscalPrinterHelper(self.conn, self.get_toplevel())
>+ printer.remove_cash(abs(self.cash_slave.model.value))
> return valid
>- printer = FiscalPrinterHelper(self.conn, self.get_toplevel())
>- printer.add_cash(self.cash_slave.model.value)
>+ printer = FiscalPrinterHelper(self.conn, self.get_toplevel())
>+ printer.add_cash(self.cash_slave.model.value)
> return valid
Apenas essa parte aqui não é suficiente para resolver esse bug?
--
Configure bugmail: http://bugs.async.com.br/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the Stoq-devel
mailing list