summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2010-01-25 18:04:53 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2010-01-25 18:04:53 +0530
commitcab8f8f0fb5d4fa0e7957d27942bdfd383ef399f (patch)
tree6ed82d12b93b03b29a00b4e0bf3ac5d4ea20cb71
parent470f5bf1258947b8fe1439f1143bc4d7c665e1c8 (diff)
[FIX] Related with O2M behavior corrected
lp bug: https://launchpad.net/bugs/413121 fixed bzr revid: jvo@tinyerp.com-20100125123453-ahsnyt52zy8du9oc
-rw-r--r--bin/osv/fields.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/osv/fields.py b/bin/osv/fields.py
index c99fafe7af7..541b9e77e71 100644
--- a/bin/osv/fields.py
+++ b/bin/osv/fields.py
@@ -711,15 +711,18 @@ class related(function):
field_detail = self._relations[i]
relation = field_detail['object']
if not t_data[self.arg[i]]:
+ if self._type not in ('one2many', 'many2many'):
+ t_id = t_data['id']
t_data = False
break
if field_detail['type'] in ('one2many', 'many2many'):
if self._type != "many2one":
- t_id=t_data.id
+ t_id = t_data.id
t_data = t_data[self.arg[i]][0]
else:
- t_id=t_data['id']
+ t_id = t_data['id']
t_data = t_data[self.arg[i]]
+
if t_id:
obj.pool.get(field_detail['object']).write(cr,uid,[t_id],{args[-1]:values}, context=context)