Please review this at http://codereview.appspot.com/3775044/
Affected files:
M trytond/model/model.py
Index: trytond/model/model.py
===================================================================
--- a/trytond/model/model.py
+++ b/trytond/model/model.py
@@ -107,23 +107,7 @@
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):
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/
pgpeXOpvbzWOj.pgp
Description: PGP signature
