From d82b360309b7a3c5726bbffb2ac008aeffeb2197 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 5 Apr 2017 07:50:53 +0200 Subject: [PATCH 1/2] [CLA] backport signature for Tecnativa backport of dc8010c9b to 9.0 Asked in #21496 --- doc/cla/corporate/tecnativa.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/cla/corporate/tecnativa.md diff --git a/doc/cla/corporate/tecnativa.md b/doc/cla/corporate/tecnativa.md new file mode 100644 index 00000000000..72a73cbbe28 --- /dev/null +++ b/doc/cla/corporate/tecnativa.md @@ -0,0 +1,22 @@ +Spain, 2017-04-04 + +Tecnativa S.L. agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Pedro M. Baeza pedro.baeza@tecnativa.com https://github.com/pedrobaeza + +List of contributors: + +Pedro M. Baeza pedro.baeza@tecnativa.com https://github.com/pedrobaeza +Rafael Blasco rafael.blasco@tecnativa.com https://github.com/rafaelbn +Sergio Teruel sergio.teruel@tecnativa.com https://github.com/sergio-teruel +Carlos Dauden carlos.dauden@tecnativa.com https://github.com/carlosdauden +Jairo Llopis jairo.llopis@tecnativa.com https://github.com/yajo +Vicent Cubells vicent.cubells@tecnativa.com https://github.com/cubells +Luis Montalba luis.montalba@tecnativa.com https://github.com/luismontalba +David Vidal david.vidal@tecnativa.com https://github.com/chienandalu From 7a24a2f45f1d627f2f5978cda7e2fadbe41226e5 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 12 Dec 2017 13:36:23 +0100 Subject: [PATCH 2/2] [FIX] field: avoid overhead of record._set_dirty when setting fields (#21378) Setting fields as dirty was dramatically slow for huge one2many fields. --- openerp/fields.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openerp/fields.py b/openerp/fields.py index 4b2b5e443b5..c96eb7dacaa 100644 --- a/openerp/fields.py +++ b/openerp/fields.py @@ -851,11 +851,11 @@ class Field(object): spec = self.modified_draft(record) # set value in cache, inverse field, and mark record as dirty - record._cache[self] = value + env.cache[self][record.id] = value if env.in_onchange: for invf in record._field_inverses[self]: invf._update(value, record) - record._set_dirty(self.name) + env.dirty[record].add(self.name) # determine more dependent fields, and invalidate them if self.relational: @@ -867,7 +867,7 @@ class Field(object): record.write({self.name: self.convert_to_write(value)}) # Update the cache unless value contains a new record if all(getattr(value, '_ids', ())): - record._cache[self] = value + env.cache[self][record.id] = value ############################################################################ #