From 117d0d0ca2460d8d840307c746e31aa7c4385a9e Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 30 Sep 2014 17:19:00 +0200 Subject: [PATCH] [FIX] sale_margin: stored field functions cannot trigger other stored field functions the update of sale.order margin field was trigger with the margin stored field of sale.order.line: This cannot work with the old api --- addons/sale_margin/sale_margin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index 6329463805f..b5c1821ab98 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -84,7 +84,7 @@ class sale_order(osv.osv): _columns = { 'margin': fields.function(_product_margin, string='Margin', help="It gives profitability by calculating the difference between the Unit Price and the cost price.", store={ - 'sale.order.line': (_get_order, ['margin'], 20), + 'sale.order.line': (_get_order, ['margin', 'purchase_price'], 20), 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 20), }), }