Add ability to put a key in ctx to disable generation of a price history line

This commit is contained in:
Alexis de Lattre
2016-03-11 14:41:42 +01:00
parent e22b56c7a9
commit 753333521f

View File

@@ -42,6 +42,7 @@ class ProductTemplate(orm.Model):
retrieve the cost of a product template for a given date''' retrieve the cost of a product template for a given date'''
if context is None: if context is None:
context = {} context = {}
if not context.get('dont_create_price_history'):
price_history_obj = self.pool['product.price.history'] price_history_obj = self.pool['product.price.history']
user_company = self.pool['res.users'].browse( user_company = self.pool['res.users'].browse(
cr, uid, uid, context=context).company_id.id cr, uid, uid, context=context).company_id.id