Do not set the Group's context when setting a default group on xxx2Many
The context of the field is dynamic so evaluating it only once when creating the group make it static. Also the group is already evaluating the parent field context on the fly when its context is retrieved. Closes #13726 (grafted from b21813a75b5beeb625b1e9533cbc498b7872555f) --HG-- branch : 6.0
This commit is contained in:
1 parent
de6842e50c
commit
c0d07f0615
2 files changed
+1
-4
No files matched your search
+1
-2
@@ -2440,8 +2440,7 @@
|
||||
if (record.model.name == this.description.relation) {
|
||||
model = record.model;
|
||||
}
|
||||
var context = record.expr_eval(this.description.context || {});
|
||||
var group = Sao.Group(model, context, []);
|
||||
var group = Sao.Group(model, {}, []);
|
||||
group.set_parent(record);
|
||||
group.parent_name = this.description.relation_field;
|
||||
group.child_name = this.name;
|
||||
|
||||
@@ -576,12 +576,10 @@ class O2MField(Field):
|
||||
from .group import Group
|
||||
parent_name = self.attrs.get('relation_field', '')
|
||||
fields = fields or {}
|
||||
context = record.expr_eval(self.attrs.get('context', {}))
|
||||
group = Group(self.attrs['relation'], fields,
|
||||
parent=record,
|
||||
parent_name=parent_name,
|
||||
child_name=self.name,
|
||||
context=context,
|
||||
parent_datetime_field=self.attrs.get('datetime_field'))
|
||||
if not fields and record.model_name == self.attrs['relation']:
|
||||
group.fields = record.group.fields
|
||||
|
||||
Reference in new issue
Block a user