diff options
| author | Raphael Collet <rco@odoo.com> | 2020-04-07 13:51:30 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-05-18 09:51:43 +0000 |
| commit | ea3e39506a2b360545ec0cd1d3235e69ad16ea6c (patch) | |
| tree | 9d103c7a40911c988e1a3cbecfd8d6a76a3a9a85 /addons/stock/tests | |
| parent | 2e56191c8b86d05bbce17790de8a4732c0478013 (diff) | |
[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: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/stock/tests')
| -rw-r--r-- | addons/stock/tests/test_robustness.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/stock/tests/test_robustness.py b/addons/stock/tests/test_robustness.py index b53cb44ea7b..ef039188a32 100644 --- a/addons/stock/tests/test_robustness.py +++ b/addons/stock/tests/test_robustness.py @@ -140,9 +140,9 @@ class TestRobustness(SavepointCase): move1._action_confirm() move1._action_assign() - move1.result_package_id = False - + self.assertEqual(move1.move_line_ids.package_id, package) package.unpack() + self.assertEqual(move1.move_line_ids.package_id, self.env['stock.quant.package']) # unreserve move1._do_unreserve() |
