[IMP] - read may be harmful to performance
parent
67dcbb942d
commit
4d1e920a2b
|
@ -4,7 +4,8 @@
|
|||
{
|
||||
'name': 'Onchange Helper',
|
||||
'version': '12.0.1.0.0',
|
||||
'summary': 'Technical module that ease execution of onchange in Python code',
|
||||
'summary': 'Technical module that ease execution'
|
||||
' of onchange in Python code',
|
||||
'author': 'Akretion,Camptocamp,Odoo Community Association (OCA)',
|
||||
'website': 'https://github.com/OCA/server-tools',
|
||||
'license': 'AGPL-3',
|
||||
|
|
|
@ -31,7 +31,12 @@ class Base(models.AbstractModel):
|
|||
# If self is an empty record we will have an empty value
|
||||
if self:
|
||||
self.ensure_one()
|
||||
record_values = self._convert_to_write(self.read()[0])
|
||||
record_values = self._convert_to_write(
|
||||
{
|
||||
field_name: self[field_name]
|
||||
for field_name, field in self._fields.items()
|
||||
}
|
||||
)
|
||||
else:
|
||||
record_values = {}
|
||||
for field in self._fields:
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
|
||||
* Florian da Costa <florian.dacosta@akretion.com>
|
||||
* Andrea Stirpe <a.stirpe@onestein.nl>
|
||||
* Andrea Stirpe <a.stirpe@onestein.nl>
|
||||
|
|
|
@ -1 +1 @@
|
|||
This is a technical module. Its goal is to ease the play of onchange method directly called from Python code.
|
||||
This is a technical module. Its goal is to ease the play of onchange method directly called from Python code.
|
||||
|
|
Loading…
Reference in New Issue