~zikzak/magentoerpconnect/check_vat

« back to all changes in this revision

Viewing changes to sale.py

  • Committer: Raphaël Valyi
  • Date: 2010-12-15 01:03:08 UTC
  • Revision ID: rvalyi@gmail.com-20101215010308-dh3q0h2evcertzxj
[FIX] defensive code to avoid potentially passing order amount paid as a string instead of float. Fuck you Magento

Show diffs side-by-side

added added

removed removed

Lines of Context:
424
424
                amount =  payment.get('amount_ordered', False)
425
425
            if amount:
426
426
                order = self.pool.get('sale.order').browse(cr, uid, order_id, context)
427
 
                self.generate_payment_with_pay_code(cr, uid, payment['method'], order.partner_id.id, amount, "mag_" + payment['payment_id'], "mag_" + data_record['increment_id'], order.date_order, paid, context) 
 
427
                self.generate_payment_with_pay_code(cr, uid, payment['method'], order.partner_id.id, float(amount), "mag_" + payment['payment_id'], "mag_" + data_record['increment_id'], order.date_order, paid, context) 
428
428
        return paid
429
429
 
430
430
# UPDATE ORDER STATUS FROM MAGENTO TO OPENERP IS UNSTABLE, AND NOT VERY USEFULL. MAYBE IT WILL BE REFACTORED