[Stoq-devel] [Bug 2714] - Problema ao utilizar vale-compra como forma de pagamento

bugzilla-daemon at async.com.br bugzilla-daemon at async.com.br
Tue Sep 12 17:13:43 BRT 2006


http://bugs.async.com.br/show_bug.cgi?id=2714  


Johan Dahlin <jdahlin at async.com.br> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #3575|                            |review-
               Flag|                            |




--- Comment #3 from Johan Dahlin <jdahlin at async.com.br>  2006-09-12 17:13 BRT ---
(From update of attachment 3575)
>Index: stoqlib/gui/wizards/salewizard.py
>===================================================================
>--- stoqlib/gui/wizards/salewizard.py	(revisão 4479)
>+++ stoqlib/gui/wizards/salewizard.py	(cópia de trabalho)
>@@ -618,10 +618,11 @@
> 
>     def finish(self):
>         if self.gift_certificates:
>             for certificate in self.gift_certificates:
>+                base_method = sysparam(self.conn).BASE_PAYMENT_METHOD
>+                adapter = IGiftCertificatePM(base_method)

You don't need to fetch base_method & adapter in each iteration, do it only
once,
before the loop.

Should the base method always have an IGiftCertificatePM implementation?
If not, then you need to handle the case when it returns None.

>+                payment = adapter._get_new_payment(total, self.payment_group, 1)
                                    ^

You're not allowed to call private methods outside of the class itself, this
needs to be addressed.


More information about the Stoq-devel mailing list