From d31d78e0513402731710f90a092c08ffec0be5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 22 Dec 2011 19:13:28 +0100 Subject: [PATCH] Add Cache on ModelData.get_id issue2276 review208002 --- trytond/ir/model.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/trytond/ir/model.py b/trytond/ir/model.py index 11fea02c8a..f67a1f3a9b 100644 --- a/trytond/ir/model.py +++ b/trytond/ir/model.py @@ -471,6 +471,13 @@ class ModelData(ModelSQL, ModelView): def default_noupdate(self): return False + def write(self, ids, values): + result = super(ModelData, self).write(ids, values) + # Restart the cache for get_id + self.get_id.reset() + return result + + @Cache('ir_model_data.get_id') def get_id(self, module, fs_id): """ Return for an fs_id the corresponding db_id.