[FIX] sale: use updated context instead of new one

Keep the existing information in the context for the price_get call instead of
creating a new one.
Closes #7646
This commit is contained in:
Valentin Chemiere 2015-07-16 19:43:42 +02:00 committed by Martin Trigaux
parent 707db0399e
commit 3033790ef1
1 changed files with 6 additions and 4 deletions

View File

@ -1176,11 +1176,13 @@ class sale_order_line(osv.osv):
'Please set one before choosing a product.') 'Please set one before choosing a product.')
warning_msgs += _("No Pricelist ! : ") + warn_msg +"\n\n" warning_msgs += _("No Pricelist ! : ") + warn_msg +"\n\n"
else: else:
ctx = dict(
context,
uom=uom or result.get('product_uom'),
date=date_order,
)
price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
product, qty or 1.0, partner_id, { product, qty or 1.0, partner_id, ctx)[pricelist]
'uom': uom or result.get('product_uom'),
'date': date_order,
})[pricelist]
if price is False: if price is False:
warn_msg = _("Cannot find a pricelist line matching this product and quantity.\n" warn_msg = _("Cannot find a pricelist line matching this product and quantity.\n"
"You have to change either the product, the quantity or the pricelist.") "You have to change either the product, the quantity or the pricelist.")