[FIX] base_suspend_security: Adapt to upstream

On 9af8b31d921dcccb7bcf230271fd3ef4R4329, a new keyword argument was added
for `_browse`, so any overriding needs to add that argument, as it's the case
for this module.
This commit is contained in:
Pedro M. Baeza
2019-02-13 15:42:13 +01:00
parent 2436c886e9
commit 4ee3ee65c4
2 changed files with 8 additions and 2 deletions

View File

@@ -8,6 +8,12 @@ This module was written to allow you to call code with some `uid` while being s
Usually, you'll be in in the situation to want something like this if you inherit from a module you can't or don't want to change, and call `super()`. Usually, you'll be in in the situation to want something like this if you inherit from a module you can't or don't want to change, and call `super()`.
Installation
============
This version is only valid for being used since Odoo commit
9af8b31d921dcccb7bcf230271fd3ef4R4329 (merged on 2019-02-04).
Usage Usage
===== =====

View File

@@ -25,11 +25,11 @@ class ResUsers(models.Model):
_inherit = 'res.users' _inherit = 'res.users'
@classmethod @classmethod
def _browse(cls, ids, env, prefetch=None): def _browse(cls, ids, env, prefetch=None, add_prefetch=True):
"""be sure we browse ints, ids laread is normalized""" """be sure we browse ints, ids laread is normalized"""
return super(ResUsers, cls)._browse( return super(ResUsers, cls)._browse(
[ [
i if not isinstance(i, BaseSuspendSecurityUid) i if not isinstance(i, BaseSuspendSecurityUid)
else super(BaseSuspendSecurityUid, i).__int__() else super(BaseSuspendSecurityUid, i).__int__()
for i in ids for i in ids
], env, prefetch=prefetch) ], env, prefetch=prefetch, add_prefetch=add_prefetch)