diff options
| author | Olivier Dony <odo@openerp.com> | 2014-08-02 20:35:51 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2014-08-04 01:38:07 +0200 |
| commit | 6f0498beecbb0e8b82be22f7d8a5e1dc37601a31 (patch) | |
| tree | f5b8705e61374498015273053eafaa3e74829886 | |
| parent | 7273474d6591f2dc62423c92eb5ec661d597716c (diff) | |
| parent | b6acdc4a74ccefb883d03f622a3815c4ee074793 (diff) | |
[MERGE] Forward-port saas-3 up to b6acdc4
| -rw-r--r-- | addons/product_visible_discount/product_visible_discount.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py index cdc858dbbd6..9b0968ad1ac 100644 --- a/addons/product_visible_discount/product_visible_discount.py +++ b/addons/product_visible_discount/product_visible_discount.py @@ -67,7 +67,7 @@ class sale_order_line(osv.osv): result=res['value'] pricelist_obj=self.pool.get('product.pricelist') product_obj = self.pool.get('product.product') - if product: + if product and pricelist: if result.get('price_unit',False): price=result['price_unit'] else: @@ -81,7 +81,7 @@ class sale_order_line(osv.osv): new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist) if so_pricelist.visible_discount and list_price[pricelist] != 0 and new_list_price != 0: - if so_pricelist.currency_id.id != product.company_id.currency_id.id: + if product.company_id and so_pricelist.currency_id.id != product.company_id.currency_id.id: # new_list_price is in company's currency while price in pricelist currency new_list_price = self.pool['res.currency'].compute(cr, uid, product.company_id.currency_id.id, so_pricelist.currency_id.id, @@ -94,4 +94,6 @@ class sale_order_line(osv.osv): result['discount'] = 0.0 else: result['discount'] = 0.0 + else: + result['discount'] = 0.0 return res |
