Please review this at http://codereview.appspot.com/3078041/

Affected files:
  M sale.py


Index: sale.py
===================================================================
--- a/sale.py
+++ b/sale.py
@@ -1101,10 +1101,9 @@
     def on_change_with_amount(self, vals):
         currency_obj = self.pool.get('currency.currency')
         if vals.get('type') == 'line':
-            if isinstance(vals.get('_parent_sale.currency'), (int, long)):
+            currency = vals.get('_parent_sale.currency')
+            if currency and isinstance(currency, (int, long)):
                 currency =
currency_obj.browse(vals['_parent_sale.currency'])
-            else:
-                currency = vals['_parent_sale.currency']
             amount = Decimal(str(vals.get('quantity') or '0.0')) * \
                     (vals.get('unit_price') or Decimal('0.0'))
             if currency:



-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpEmmTISFIka.pgp
Description: PGP signature

Reply via email to