Comments (13)
I can't find a call to one of our modules in the stacktrace
from muk_base.
Sorry, I updated my previous comment with the correct stacktrace
from muk_base.
Hi, i resolve con this patch:
--- a/muk_security/models/res_users.py
+++ b/muk_security/models/res_users.py
@@ -49,17 +49,17 @@ class AccessUser(models.Model):
# Functions
#----------------------------------------------------------
- def browse(self, arg=None, *args, **kwargs):
+ def browse(self, arg=None, prefetch=None):^M
if isinstance(arg, helper.NoSecurityUid):
arg = super(helper.NoSecurityUid, arg).__int__()
- return super(AccessUser, self).browse(arg=arg, *args, **kwargs)
+ return super(AccessUser, self).browse(arg=arg, prefetch=prefetch)^M
@classmethod
- def _browse(cls, ids, *args, **kwargs):
+ def _browse(cls, ids, env, prefetch=None, add_prefetch=True):^M
def convert_security_uid(id):
if isinstance(id, helper.NoSecurityUid):
return super(helper.NoSecurityUid, id).__int__()
return id
access_ids = [convert_security_uid(id) for id in ids]
- return super(AccessUser, cls)._browse(access_ids, *args, **kwargs)
+ return super(AccessUser, cls)._browse(access_ids, env=env, prefetch=prefetch, add_prefetch=add_prefetch)^M
from muk_base.
But than it would be no longer compatible with older versions and actually it shouldn't change anything about the implementation. Thats why I use *args and **kwargs, they are more generic.
from muk_base.
the error that @MathAndrews report continue.
Latest error lines:
File "/opt/odoo/11.0/community/odoo/models.py", line 2737, in _read_from_database
target = self.browse([], self._prefetch)
File "/home/odoo/11.0/addons/muk-it/muk_base/muk_security/models/res_users.py", line 55, in browse
return super(AccessUser, self).browse(arg=arg, *args, **kwargs)
TypeError: browse() got multiple values for argument 'arg'
Debian Stretch 64 bits
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
odoo 11.0 CE
commit 85cbb070ad0223d76abff42532999d36f712f222
Author: Nans Lefebvre [email protected]
Date: Mon May 13 09:10:54 2019 +0000
from muk_base.
Hi @keshrath , in which situation this condition is true?
https://github.com/muk-it/muk_base/blob/11.0/muk_security/models/res_users.py#L53
thanks
from muk_base.
If you use suspend_security
like self.suspend_security().read([])
from muk_base.
Hello,
index c34988a..6cadd98 100644
--- a/muk_security/models/res_users.py
+++ b/muk_security/models/res_users.py
@@ -48,13 +48,14 @@ class AccessUser(models.Model):
#----------------------------------------------------------
# Functions
#----------------------------------------------------------
-
- def browse(self, arg=None, *args, **kwargs):
- if isinstance(arg, helper.NoSecurityUid):
- arg = super(helper.NoSecurityUid, arg).__int__()
- return super(AccessUser, self).browse(arg=arg, *args, **kwargs)
-
-
+^M
+ def browse(self, *args, **kwargs):^M
+ if len(args) and isinstance(args[0], helper.NoSecurityUid):^M
+ args = list(args)^M
+ args[0] = super(helper.NoSecurityUid, args[0]).__int__()^M
+ args = tuple(args)^M
+ return super(AccessUser, self).browse(*args, **kwargs)^M
+^M
@classmethod
def _browse(cls, ids, *args, **kwargs):
def convert_security_uid(id):
from muk_base.
Looks good, if it solves the problem. Can you do a PR?
from muk_base.
Hello, remote: Permission to muk-it/muk_base.git denied to gsisa.
from muk_base.
ah pull request is not a push: https://help.github.com/en/articles/creating-a-pull-request
from muk_base.
from muk_base.
Thanks
from muk_base.
Related Issues (20)
- V12 muk_utils update HOT 1
- [11] You forgot 'vals' in def unlink HOT 4
- suspend security fails, when NoSecurityUid used in domains HOT 6
- [11.0] Unable to install muk_dms_acces HOT 3
- [11.0] module muk_converter added widget iap_credit_checker to res.config view, but this widget does not exist in 11.0 HOT 3
- muk_utils tools/json.py module import itself? HOT 4
- Problem with v12 Not showing Branding and Avatar HOT 1
- Branding, Back-end Theme Sidebar Issue HOT 8
- [11.0] session_store with worker > 0
- issue with "force storage migration' HOT 1
- [13.0] Installation MuK Large Objects Attachment failed HOT 1
- [13.0] muk_attachment_lobject Failed migration HOT 3
- [13.0] session storage HOT 2
- Access error when saving on configuration / settings in multi-company setup
- muk_utils/models/ir_attachment breaks s3 backend HOT 1
- Force Migration Trigger from shell
- [13.0] psycopg2.OperationalError: ERROR: large object does not exist HOT 1
- AUTOMATED RULES
- [11.0] Error on delete groups HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from muk_base.