diff --git a/CHANGELOG b/CHANGELOG index 2c9135b4b3..997de0cb8a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Model doesn't convert anymore ids for inherited methods * Remove required attribute on Boolean fields * Add One2One field * Add AUTOINCREMENT to sqlite primary key diff --git a/trytond/model/model.py b/trytond/model/model.py index 7eb092d209..fdb48ffafa 100644 --- a/trytond/model/model.py +++ b/trytond/model/model.py @@ -107,23 +107,7 @@ class Model(object): model_obj = self.pool.get(model_name) if hasattr(model_obj, name) and \ callable(getattr(model_obj, name)): - def func(*args, **kwargs): - if args: - ids = args[0] - int_id = False - if isinstance(ids, (int, long)): - int_id = True - ids = [ids] - if reduce(lambda x, y: x and - isinstance(y, (int, long)), ids, True): - # Replace ids by the parent ids - ids = [getattr(x, field_name).id for x in - self.browse(ids)] - if int_id: - ids = ids[0] - args = tuple([ids] + list(args[1:])) - return getattr(model_obj, name)(*args, **kwargs) - return func + return getattr(model_obj, name) raise AttributeError def _inherits_reload(self):