Force value of parent Reference field
Since 2.6, reference field can be used in One2Many so in this case the value should be forced like for Many2One. review2581002
This commit is contained in:
1 parent
24e7236c7a
commit
cb313d2557
1 file changed
+6
@@ -783,6 +783,12 @@ class ReferenceField(CharField):
|
||||
return None
|
||||
|
||||
def get(self, record):
|
||||
if record.parent_name == self.name:
|
||||
if record.parent:
|
||||
return '%s,%s' % (record.group.parent.model_name,
|
||||
record.parent.id)
|
||||
else:
|
||||
return None
|
||||
if (record.value.get(self.name)
|
||||
and record.value[self.name][0]
|
||||
and record.value[self.name][1] >= -1):
|
||||
|
||||
Reference in new issue
Block a user