[FIX] decimal_precision: properly invalidate cache when changing precisions
This was working previously because the cache was disabled, due to bug #988743. Now that the cache is working again, it needs to be properly invalidated whenever a decimal.precision record is created or deleted, otherwise all computations will use an incorrect precision. bzr revid: odo@openerp.com-20120523085234-2q8z7f1naydnjgsz
This commit is contained in:
parent
7c18cd8f04
commit
0373019bcf
|
@ -43,6 +43,16 @@ class decimal_precision(osv.osv):
|
|||
res = cr.fetchone()
|
||||
return res[0] if res else 2
|
||||
|
||||
def create(self, cr, uid, data, context=None):
|
||||
res = super(decimal_precision, self).create(cr, uid, data, context=context)
|
||||
self.precision_get.clear_cache(self)
|
||||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
res = super(decimal_precision, self).unlink(cr, uid, ids, context=context)
|
||||
self.precision_get.clear_cache(self)
|
||||
return res
|
||||
|
||||
def write(self, cr, uid, ids, data, *args, **argv):
|
||||
res = super(decimal_precision, self).write(cr, uid, ids, data, *args, **argv)
|
||||
self.precision_get.clear_cache(self)
|
||||
|
|
Loading…
Reference in New Issue