From f87570e83f1a94530b9752cfd5288fefd00adb47 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 30 Mar 2015 16:34:24 +0200 Subject: [PATCH] [FIX] base: no cache for ir.attachment._filestore, restore context Due to a compatibility problem between the new API implementation and the @ormcache decorator, the context parameter of ir.attachment._filestore() was dropped at rev. 0beb14f0d23c9cfecb4aeb329869716bee8f8c8a However the need for caching this method has disappeared in Odoo 8 (it used to require a DB query). So it is even better to drop the @ormcache decorator altogether, and keep the context parameter. This avoids a useless change of method signature, even if that was on a private method. --- openerp/addons/base/ir/ir_attachment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index e3cd3aa6db3..13d788799dc 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -71,8 +71,7 @@ class ir_attachment(osv.osv): def _storage(self, cr, uid, context=None): return self.pool['ir.config_parameter'].get_param(cr, SUPERUSER_ID, 'ir_attachment.location', 'file') - @tools.ormcache(skiparg=3) - def _filestore(self, cr, uid): + def _filestore(self, cr, uid, context=None): return tools.config.filestore(cr.dbname) def force_storage(self, cr, uid, context=None):