[IMP] optimized the code point_of_sale.py
authorBharat (OpenERP) <bde@tinyerp.com>
Wed, 21 Sep 2011 05:40:08 +0000 (11:10 +0530)
committerBharat (OpenERP) <bde@tinyerp.com>
Wed, 21 Sep 2011 05:40:08 +0000 (11:10 +0530)
bzr revid: bde@tinyerp.com-20110921054008-xay8jkfwjdodw4h1

addons/point_of_sale/point_of_sale.py

index eed582e..0fb1ce4 100644 (file)
@@ -675,17 +675,14 @@ class pos_order(osv.osv):
                     'quantity': line.qty,
                 }
                 inv_name = product_obj.name_get(cr, uid, [line.product_id.id], context=context)[0][1]
-                sale_description = product_obj.browse(cr, uid, [line.product_id.id], context=context)[0].description_sale
-                description = product_obj.browse(cr, uid, [line.product_id.id], context=context)[0].description
                 inv_line.update(inv_line_ref.product_id_change(cr, uid, [],
                                                                line.product_id.id,
                                                                line.product_id.uom_id.id,
                                                                line.qty, partner_id = order.partner_id.id,
                                                                fposition_id=order.partner_id.property_account_position.id)['value'])
+                sale_description = line.product_id.description_sale
                 if sale_description:
                     inv_line['note'] = sale_description
-                else:
-                    inv_line['note'] = description
                 inv_line['price_unit'] = line.price_unit
                 inv_line['discount'] = line.discount
                 inv_line['name'] = inv_name