Skip to content
Snippets Groups Projects
Commit ea3e3950 authored by Raphael Collet's avatar Raphael Collet
Browse files

[IMP] models: use slots for BaseModel


This restricts the attributes of a BaseModel instance to `env`, `_ids`
and `_prefetch_ids`.  This way, one can only assign fields on a record;
other assignments are programming errors.

This also reduces the memory footprint of records from 168 to 64 bytes
(-62%), and makes their instanciation faster.

closes odoo/odoo#51075

Related: odoo/enterprise#10529
Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
parent 2e56191c
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 76 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment