From 2a83ece3977f196aaa34f10bd7e853ba1f23e44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 7 Sep 2017 21:01:00 +0200 Subject: [PATCH] Keep a single instance of PYSON Encoder in SearchView issue6744 review36601002 --- src/common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common.js b/src/common.js index 50448fd0df..d21fc7cf54 100644 --- a/src/common.js +++ b/src/common.js @@ -468,6 +468,9 @@ Sao.common.MODELHISTORY = new Sao.common.ModelHistory(); Sao.common.ViewSearch = Sao.class_(Object, { + init: function() { + this.encoder = new Sao.PYSON.Encoder(); + }, load_searches: function() { this.searches = {}; return Sao.rpc({ @@ -486,7 +489,7 @@ 'params': [[{ 'model': model, 'name': name, - 'domain': new Sao.PYSON.Encoder().encode(domain) + 'domain': this.encoder.encode(domain) }], {}] }, Sao.Session.current_session).then(function(ids) { var id = ids[0];