~mga/openobject-addons/account_india

« back to all changes in this revision

Viewing changes to sale_margin_delivery/sale_margin_delivery.py

  • Committer: Fabien Pinckaers
  • Date: 2008-12-14 16:48:05 UTC
  • Revision ID: fp@tinyerp.com-20081214164805-el7vuhu6p54ftv5y
improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        res = {}
32
32
        for line in self.browse(cr, uid, ids):
33
33
            res[line.id] = 0
34
 
            cr.execute('select id from sale_order_line where order_id = %d and product_id = %d',(line.order_id.id,line.product_id.id))
 
34
            cr.execute('select id from sale_order_line where order_id = %s and product_id = %s',(line.order_id.id,line.product_id.id))
35
35
            sale_line_id = cr.fetchall()[0][0]
36
36
            sale_line_obj = self.pool.get('sale.order.line').browse(cr, uid,sale_line_id )
37
37
            res[line.id] = round((sale_line_obj.price_unit*line.product_qty*(100.0-sale_line_obj.discount)/100.0) -(sale_line_obj.product_id.standard_price*line.product_qty),2)